7 from ConfigParser
import ConfigParser
8 from gettext
import gettext
as _
11 def __init__(self
, image_file
= None):
12 self
.image_file
= image_file
13 image_name
= os
.path
.basename(self
.image_file
)
14 #Replace any characters that could screw us up.
15 self
.mount_location
= os
.path
.join(os
.path
.expanduser('~'), image_name
.replace(' ', '_'))
16 self
.mount_location
= self
.mount_location
.replace('.', '_')
19 if os
.path
.exists(self
.mount_location
) and os
.listdir(self
.mount_location
) != []:
22 mount_command
= "fuseiso -p '%s' '%s'" % (self
.image_file
, self
.mount_location
)
23 if os
.system(mount_command
) != 0:
31 if os
.path
.exists(self
.mount_location
):
32 unmount_command
= "fusermount -u '%s'" % (self
.mount_location
)
33 if os
.system(unmount_command
) != 0:
40 def burn(self
, is_brasero
= True):
43 burn_command
= "brasero --image '%s'" % (self
.image_file
)
45 burn_command
= "nautilus-cd-burner --source-iso='%s'" % (self
.image_file
)
46 subprocess
.Popen(burn_command
, shell
=True)
51 browse_command
= "Thunar '%s'" % (self
.mount_location
)
53 if os
.path
.exists(self
.mount_location
):
54 subprocess
.Popen(browse_command
, shell
=True)