Merge commit 'origin/bug_138_networkwizard_fixes' into experimental
[enigma2.git] / lib / python / Plugins / SystemPlugins / DefaultServicesScanner / plugin.py
index 62f0d9b..4d0a992 100644 (file)
@@ -42,7 +42,7 @@ class DefaultServiceScan(ServiceScan):
 
        def __init__(self, session, scanList):
                try:
-                       unlink("rm " + resolveFilename(SCOPE_CONFIG) + "/lamedb");
+                       unlink(resolveFilename(SCOPE_CONFIG) + "/lamedb");
                except OSError:
                        pass
                db = eDVBDB.getInstance()
@@ -91,12 +91,15 @@ class DefaultServicesScannerPlugin(ScanSetup):
 
        def scanFinished(self, value = None):
                print "finished"
+               print "self.scanIndex:", self.scanIndex
                db = eDVBDB.getInstance()
-               satint = self.multiscanlist[self.scanIndex][0]
-               print "scanned sat:", satint
-               db.saveServicelist("/tmp/lamedb." + str(satint))
-               file = open("/tmp/sat" + str(satint) + ".info", "w")
-               xml = """<default>
+               print "self.multiscanlist:", self.multiscanlist
+               if len(self.multiscanlist) - 1 >= self.scanIndex and len(self.multiscanlist[self.scanIndex]) > 0:
+                       satint = self.multiscanlist[self.scanIndex][0]
+                       print "scanned sat:", satint
+                       db.saveServicelist("/tmp/lamedb." + str(satint))
+                       file = open("/tmp/sat" + str(satint) + ".info", "w")
+                       xml = """<default>
        <prerequisites>
                <tag type="services" />
                <bcastsystem type="DVB-S" />
@@ -113,8 +116,8 @@ class DefaultServicesScannerPlugin(ScanSetup):
                </file>
        </files>
 </default>""" % (satint, "Dream", nimmanager.getSatDescription(satint), satint)
-               file.write(xml)
-               file.close()
+                       file.write(xml)
+                       file.close()
                
                self.scanIndex += 1
                if self.scanIndex + 1 >= len(self.multiscanlist):