Components/config.py: Refactor evil imports
authorMike Looijmans <milo@openpli.org>
Wed, 30 Dec 2015 15:23:44 +0000 (16:23 +0100)
committerMike Looijmans <milo@openpli.org>
Wed, 30 Dec 2015 15:23:44 +0000 (16:23 +0100)
Get rid of "from os import path as os_path" and similar badness.

lib/python/Components/config.py

index b32a041..369f775 100644 (file)
@@ -2,8 +2,8 @@ from enigma import getPrevAsciiCode
 from Tools.NumericalTextInput import NumericalTextInput
 from Tools.Directories import resolveFilename, SCOPE_CONFIG, fileExists
 from Components.Harddisk import harddiskmanager
-from copy import copy as copy_copy
-from os import path as os_path
+import copy
+import os
 from time import localtime, strftime
 
 # ConfigElement, the base class of all ConfigElements.
@@ -505,7 +505,7 @@ class ConfigSequence(ConfigElement):
                self.censor_char = censor_char
 
                self.last_value = self.default = default
-               self.value = copy_copy(default)
+               self.value = copy.copy(default)
                self.endNotifier = None
 
        def validate(self):
@@ -647,7 +647,7 @@ class ConfigSequence(ConfigElement):
        def onDeselect(self, session):
                if self.last_value != self._value:
                        self.changedFinal()
-                       self.last_value = copy_copy(self._value)
+                       self.last_value = copy.copy(self._value)
 
 ip_limits = [(0,255),(0,255),(0,255),(0,255)]
 class ConfigIP(ConfigSequence):
@@ -1384,7 +1384,7 @@ class ConfigLocations(ConfigElement):
                                self.addedMount(x)
 
        def getMountpoint(self, file):
-               file = os_path.realpath(file)+"/"
+               file = os.path.realpath(file)+"/"
                for m in self.mountpoints:
                        if file.startswith(m):
                                return m