<widget source="space_label" render="Label" position="20,414" size="520,22" zPosition="2" font="Regular;18" halign="center" transparent="1" foregroundColor="#000000" />
</screen>"""
- def __init__(self, session, project = None):
+ def __init__(self, session):
Screen.__init__(self, session)
- self.project = project
self["key_red"] = StaticText(_("Exit"))
self["key_green"] = StaticText(_("Update"))
self["details"] = ScrollLabel()
self["info"] = StaticText()
- self["toolboxactions"] = ActionMap(["ColorActions", "DVDToolbox"],
+ self["toolboxactions"] = ActionMap(["ColorActions", "DVDToolbox", "OkCancelActions"],
{
"red": self.close,
"green": self.update,
job = DVDinfoJob(self)
job_manager.AddJob(job)
- def infoJobCB(self):
+ def infoJobCB(self, in_background=False):
capacity = 1
used = 0
infotext = ""
capacity = used
used = 0
elif line.find("Free Blocks:") > -1:
- size = line[15:-3].split('*')
- size = int(size[0])*int(size[1])*1024
+ try:
+ size = eval(line[14:].replace("KB","*1024"))
+ except:
+ size = 0
if size > 0:
- capacity = size
- used = capacity-used
+ capacity = size / 1048576
+ if used:
+ used = capacity-used
print "[free blocks] capacity=%d, used=%d" % (capacity, used)
infotext += line
self["details"].setText(infotext)
self.toolbox = job.toolbox
self.postconditions.append(DVDformatTaskPostcondition())
self.setTool("/bin/dvd+rw-format")
- self.args += [ harddiskmanager.getCD() ]
+ self.args += [ "/dev/" + harddiskmanager.getCD() ]
self.end = 1100
def prepare(self):
self.toolbox = job.toolbox
self.postconditions.append(DVDinfoTaskPostcondition())
self.setTool("/bin/dvd+rw-mediainfo")
- self.args += [ harddiskmanager.getCD() ]
+ self.args += [ "/dev/" + harddiskmanager.getCD() ]
def prepare(self):
self.error = None