SystemPlugins/FastScan/plugin.py: Refactor evil imports
authorAthanasios Oikonomou <athoik@gmail.com>
Thu, 31 Dec 2015 06:21:17 +0000 (08:21 +0200)
committerMike Looijmans <milo@openpli.org>
Thu, 31 Dec 2015 08:50:09 +0000 (09:50 +0100)
Get rid of "from os import path as os_path" and similar badness.

Signed-off-by: Mike Looijmans <milo@openpli.org>

lib/python/Plugins/SystemPlugins/FastScan/plugin.py

index 389a95e..a27d7ae 100644 (file)
@@ -1,6 +1,4 @@
 # -*- coding: utf-8 -*-
-from os import path as os_path, walk as os_walk, unlink as os_unlink
-
 from Plugins.Plugin import PluginDescriptor
 
 from Screens.Screen import Screen
@@ -16,6 +14,8 @@ from Components.ActionMap import ActionMap
 
 from enigma import eFastScan, eDVBFrontendParametersSatellite, eTimer
 
+import os
+
 config.misc.fastscan = ConfigSubsection()
 config.misc.fastscan.last_configuration = ConfigText(default = "()")
 config.misc.fastscan.auto = ConfigYesNo(default = True)
@@ -73,17 +73,17 @@ class FastScanStatus(Screen):
                self.scan.scanProgress.get().append(self.scanProgress)
                fstfile = None
                fntfile = None
-               for root, dirs, files in os_walk('/tmp/'):
+               for root, dirs, files in os.walk('/tmp/'):
                        for f in files:
                                if f.endswith('.bin'):
                                        if '_FST' in f:
-                                               fstfile = os_path.join(root, f)
+                                               fstfile = os.path.join(root, f)
                                        elif '_FNT' in f:
-                                               fntfile = os_path.join(root, f)
+                                               fntfile = os.path.join(root, f)
                if fstfile and fntfile:
                        self.scan.startFile(fntfile, fstfile)
-                       os_unlink(fstfile)
-                       os_unlink(fntfile)
+                       os.unlink(fstfile)
+                       os.unlink(fntfile)
                else:
                        self.scan.start(self.scanTuner)