make background parameter optional (directly runnable)
[enigma2.git] / lib / python / Plugins / Extensions / DVDBurn / DVDToolbox.py
index 30487b690ff1c88a1f3345d9fdde7f9c9cec0960..e762f9ab4023f5583cee1f07e8688eae88d1a2a4 100644 (file)
@@ -69,7 +69,7 @@ class DVDToolbox(Screen):
                job = DVDinfoJob(self)
                job_manager.AddJob(job)
                
-       def infoJobCB(self):
+       def infoJobCB(self, in_background=False):
                capacity = 1
                used = 0
                infotext = ""
@@ -96,8 +96,10 @@ class DVDToolbox(Screen):
                                        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