whitespace cleanup,
authorMoritz Venn <ritzmo@users.schwerkraft.elitedvb.net>
Sun, 15 Mar 2009 08:06:50 +0000 (08:06 +0000)
committerMoritz Venn <ritzmo@users.schwerkraft.elitedvb.net>
Sun, 15 Mar 2009 08:06:50 +0000 (08:06 +0000)
cleanup imports

networkbrowser/src/AutoMount.py
networkbrowser/src/MountEdit.py
networkbrowser/src/MountManager.py
networkbrowser/src/MountView.py
networkbrowser/src/NetworkBrowser.py
networkbrowser/src/UserDialog.py
networkbrowser/src/UserManager.py
networkbrowser/src/__init__.py
networkbrowser/src/plugin.py

index 58f4099..5217ca8 100755 (executable)
@@ -1,12 +1,12 @@
 # -*- coding: utf-8 -*-\r
 # for localized messages\r
 from __init__ import _\r
-from re import compile as re_compile, search as re_search\r
-from os import system, popen, path as os_path, listdir, mkdir, rmdir, makedirs\r
+from re import compile as re_compile\r
+from os import path as os_path, mkdir, rmdir\r
 \r
-from enigma import eTimer, eConsoleAppContainer\r
+from enigma import eTimer\r
 from Components.Console import Console\r
-from Components.Harddisk import harddiskmanager                        #global harddiskmanager\r
+from Components.Harddisk import harddiskmanager #global harddiskmanager\r
 \r
 from xml.etree.cElementTree import parse as cet_parse\r
 \r
@@ -25,7 +25,6 @@ class AutoMount():
                self.timer = eTimer()\r
                self.timer.callback.append(self.mountTimeout)\r
 \r
-\r
                self.getAutoMountPoints()\r
 \r
        def getAutoMountPoints(self, callback = None):\r
@@ -33,7 +32,7 @@ class AutoMount():
                automounts = []\r
                self.automounts = {}\r
                self.activeMountsCounter = 0\r
-       \r
+\r
                if not os_path.exists(XML_FSTAB):\r
                        return\r
                tree = cet_parse(XML_FSTAB).getroot()\r
@@ -48,7 +47,7 @@ class AutoMount():
                # Read out NFS Mounts\r
                for nfs in tree.findall("nfs"):\r
                        for mount in nfs.findall("mount"):\r
-                               data = { 'isMounted': False, 'active': False, 'ip': False, 'sharename': False, 'sharedir': False, 'username': False, 'password': False, 'mounttype' : False, 'options' : False }            \r
+                               data = { 'isMounted': False, 'active': False, 'ip': False, 'sharename': False, 'sharedir': False, 'username': False, 'password': False, 'mounttype' : False, 'options' : False }\r
                                try:\r
                                        data['mounttype'] = 'nfs'.encode("UTF-8")\r
                                        data['active'] = getValue(mount.findall("active"), False).encode("UTF-8")\r
@@ -59,13 +58,13 @@ class AutoMount():
                                        data['sharename'] = getValue(mount.findall("sharename"), "MEDIA").encode("UTF-8")\r
                                        data['options'] = getValue(mount.findall("options"), "rw,nolock").encode("UTF-8")\r
                                        print "NFSMOUNT",data\r
-                                       self.automounts[data['sharename']] = data \r
+                                       self.automounts[data['sharename']] = data\r
                                except Exception, e:\r
                                        print "[MountManager] Error reading Mounts:", e\r
                        # Read out CIFS Mounts\r
                for nfs in tree.findall("cifs"):\r
                        for mount in nfs.findall("mount"):\r
-                               data = { 'isMounted': False, 'active': False, 'ip': False, 'sharename': False, 'sharedir': False, 'username': False, 'password': False, 'mounttype' : False, 'options' : False }            \r
+                               data = { 'isMounted': False, 'active': False, 'ip': False, 'sharename': False, 'sharedir': False, 'username': False, 'password': False, 'mounttype' : False, 'options' : False }\r
                                try:\r
                                        data['mounttype'] = 'cifs'.encode("UTF-8")\r
                                        data['active'] = getValue(mount.findall("active"), False).encode("UTF-8")\r
@@ -78,25 +77,25 @@ class AutoMount():
                                        data['username'] = getValue(mount.findall("username"), "guest").encode("UTF-8")\r
                                        data['password'] = getValue(mount.findall("password"), "").encode("UTF-8")\r
                                        print "CIFSMOUNT",data\r
-                                       self.automounts[data['sharename']] = data \r
+                                       self.automounts[data['sharename']] = data\r
                                except Exception, e:\r
                                        print "[MountManager] Error reading Mounts:", e\r
 \r
                print "[AutoMount.py] -getAutoMountPoints:self.automounts -->",self.automounts\r
                if len(self.automounts) == 0:\r
-                       print "[AutoMount.py]  self.automounts without mounts",self.automounts\r
+                       print "[AutoMount.py] self.automounts without mounts",self.automounts\r
                        if callback is not None:\r
                                callback(True)\r
                else:\r
                        for sharename, sharedata in self.automounts.items():\r
-                               self.CheckMountPoint(sharedata, callback)                       \r
+                               self.CheckMountPoint(sharedata, callback)\r
 \r
        def CheckMountPoint(self, data, callback):\r
                print "[AutoMount.py] CheckMountPoint"\r
                print "[AutoMount.py] activeMounts:--->",self.activeMountsCounter\r
                if not self.MountConsole:\r
                        self.MountConsole = Console()\r
-               \r
+\r
                self.command = None\r
                if self.activeMountsCounter == 0:\r
                        print "self.automounts without active mounts",self.automounts\r
@@ -109,7 +108,7 @@ class AutoMount():
                        if data['active'] == 'False' or data['active'] is False:\r
                                path = '/media/net/'+ data['sharename']\r
                                self.command = 'umount -f '+ path\r
-                               \r
+\r
                        if data['active'] == 'True' or data['active'] is True:\r
                                path = '/media/net/'+ data['sharename']\r
                                if os_path.exists(path) is False:\r
@@ -118,12 +117,12 @@ class AutoMount():
                                if tmpsharedir[-1:] == "$":\r
                                        tmpdir = tmpsharedir.replace("$", "\\$")\r
                                        tmpsharedir = tmpdir\r
-                                       \r
+\r
                                if data['mounttype'] == 'nfs':\r
                                        if not os_path.ismount(path):\r
                                                tmpcmd = 'mount -t nfs -o tcp,'+ data['options'] +',rsize=8192,wsize=8192 ' + data['ip'] + ':' + tmpsharedir + ' ' + path\r
                                                self.command = tmpcmd.encode("UTF-8")\r
-                                               \r
+\r
                                if data['mounttype'] == 'cifs':\r
                                        if not os_path.ismount(path):\r
                                                tmpusername = data['username'].replace(" ", "\\ ")\r
@@ -135,7 +134,7 @@ class AutoMount():
                                self.MountConsole.ePopen(self.command, self.CheckMountPointFinished, [data, callback])\r
                        else:\r
                                self.CheckMountPointFinished(None,None, [data, callback])\r
-                                       \r
+\r
        def CheckMountPointFinished(self, result, retval, extra_args):\r
                print "[AutoMount.py] CheckMountPointFinished"\r
                print "[AutoMount.py] result",result\r
@@ -157,7 +156,7 @@ class AutoMount():
                                        if not os_path.ismount(path):\r
                                                rmdir(path)\r
                                                harddiskmanager.removeMountedPartition(path)\r
-                               \r
+\r
                if self.MountConsole:\r
                        if len(self.MountConsole.appContainers) == 0:\r
                                if callback is not None:\r
@@ -167,7 +166,7 @@ class AutoMount():
        def mountTimeout(self):\r
                self.timer.stop()\r
                if self.MountConsole:\r
-                       if len(self.MountConsole.appContainers) == 0:           \r
+                       if len(self.MountConsole.appContainers) == 0:\r
                                print "self.automounts after mounting",self.automounts\r
                                if self.callback is not None:\r
                                        self.callback(True)\r
@@ -274,7 +273,7 @@ class AutoMount_Unused:
                self.MountConsole = Console()\r
                self.activeMountsCounter = 0\r
                self.getAutoMountPoints()\r
-               \r
+\r
        # helper function\r
        def regExpMatch(self, pattern, string):\r
                if string is None:\r
@@ -305,7 +304,7 @@ class AutoMount_Unused:
                        fp.close()\r
                except:\r
                        print "[AutoMount.py] /etc/auto.network - opening failed"\r
-                       \r
+\r
                ipRegexp = '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}'\r
                cifsIpLinePattern = re_compile('://' + ipRegexp + '/')\r
                nfsIpLinePattern = re_compile(ipRegexp + ':/')\r
@@ -318,7 +317,7 @@ class AutoMount_Unused:
                        if len(split) == 2 and split[0][0] == '*':\r
                                continue\r
                        if len(split) == 3:\r
-                               data = { 'isMounted': False, 'active': False, 'ip': False, 'sharename': False, 'sharedir': False, 'username': False, 'password': False, 'mounttype' : False, 'options' : False }            \r
+                               data = { 'isMounted': False, 'active': False, 'ip': False, 'sharename': False, 'sharedir': False, 'username': False, 'password': False, 'mounttype' : False, 'options' : False }\r
                                currshare = ""\r
                                if split[0][0] == '#':\r
                                        data['active'] = False\r
@@ -328,7 +327,7 @@ class AutoMount_Unused:
                                        data['active'] = True\r
                                        self.activeMountsCounter +=1\r
                                        currshare = split[0]\r
-                                       data['sharename'] = currshare        \r
+                                       data['sharename'] = currshare\r
                                if '-fstype=cifs' in split[1]:\r
                                        data['mounttype'] = 'cifs'\r
                                        options = split[1][split[1].index('-fstype=cifs')+13 : split[1].index(',user=')]\r
@@ -352,7 +351,7 @@ class AutoMount_Unused:
                                                        tmpdir = tmpsharedir.replace("\$", "$")\r
                                                        tmpsharedir = tmpdir\r
                                                data['sharedir'] = tmpsharedir\r
-                                               \r
+\r
                                if '-fstype=nfs' in split[1]:\r
                                        data['mounttype'] = 'nfs'\r
                                        options = split[1][split[1].index('-fstype=nfs')+12 : ]\r
@@ -368,16 +367,16 @@ class AutoMount_Unused:
                                                        tmpdir = tmpsharedir.replace("\$", "$")\r
                                                        tmpsharedir = tmpdir\r
                                                data['sharedir'] = tmpsharedir\r
-                                               \r
-                               self.automounts[currshare] = data                \r
+\r
+                               self.automounts[currshare] = data\r
                if len(self.automounts) == 0:\r
-                       print "[AutoMount.py]  self.automounts without mounts",self.automounts\r
+                       print "[AutoMount.py] self.automounts without mounts",self.automounts\r
                        if callback is not None:\r
                                callback(True)\r
                else:\r
                        #print "automounts",self.automounts\r
                        for sharename, sharedata in self.automounts.items():\r
-                               self.CheckMountPoint(sharedata, callback)                       \r
+                               self.CheckMountPoint(sharedata, callback)\r
 \r
        def CheckMountPoint(self, data, callback):\r
                print "[AutoMount.py] CheckMountPoint"\r
@@ -387,7 +386,7 @@ class AutoMount_Unused:
                if self.activeMountsCounter == 0:\r
                #if data['active'] is False:\r
                        if self.MountConsole:\r
-                               if len(self.MountConsole.appContainers) == 0:           \r
+                               if len(self.MountConsole.appContainers) == 0:\r
                                        print "self.automounts without active mounts",self.automounts\r
                                        if callback is not None:\r
                                                callback(True)\r
@@ -416,8 +415,6 @@ class AutoMount_Unused:
                                print "[AutoMount.py] cifscmd--->",cifscmd\r
                                self.MountConsole.ePopen(cifscmd, self.CheckMountPointFinished, [data, callback])\r
 \r
-\r
-                                       \r
        def CheckMountPointFinished(self, result, retval, extra_args):\r
                print "[AutoMount.py] CheckMountPointFinished"\r
                (data, callback ) = extra_args\r
@@ -431,7 +428,7 @@ class AutoMount_Unused:
                        if self.automounts.has_key(data['sharename']):\r
                                self.automounts[data['sharename']]['isMounted'] = False\r
                umountcmd = 'umount /tmp/'+ data['sharename']\r
-               self.MountConsole.ePopen(umountcmd, self.CleanMountPointFinished, [data, callback])                             \r
+               self.MountConsole.ePopen(umountcmd, self.CleanMountPointFinished, [data, callback])\r
 \r
        def CleanMountPointFinished(self, result, retval, extra_args):\r
                print "[AutoMount.py] CleanMountPointFinished"\r
@@ -440,7 +437,7 @@ class AutoMount_Unused:
                if os_path.exists(path):\r
                        rmdir(path)\r
                if self.MountConsole:\r
-                       if len(self.MountConsole.appContainers) == 0:           \r
+                       if len(self.MountConsole.appContainers) == 0:\r
                                print "self.automounts after mountcheck",self.automounts\r
                                if callback is not None:\r
                                        callback(True)\r
@@ -499,7 +496,7 @@ class AutoMount_Unused:
                                        tmpdir = tmpsharedir.replace("$", "\\$")\r
                                        tmpsharedir = tmpdir\r
                                fp.write( tmpsharedir + "\n")\r
-               fp.write("\n")                          \r
+               fp.write("\n")\r
                fp.close()\r
 \r
        def restartAutoFS(self,callback = None):\r
@@ -511,7 +508,7 @@ class AutoMount_Unused:
                self.commands.append("rm -rf /var/run/autofs")\r
                self.commands.append("/etc/init.d/autofs start")\r
                self.restartConsole.eBatch(self.commands, self.restartAutoFSFinished, callback, debug=True)\r
-       \r
+\r
        def restartAutoFSFinished(self,extra_args):\r
                print "[AutoMount.py] restartAutoFSFinished "\r
                ( callback ) = extra_args\r
index 54bb40b..110ae5c 100755 (executable)
@@ -6,12 +6,12 @@ from Screens.MessageBox import MessageBox
 from Screens.VirtualKeyBoard import VirtualKeyBoard
 from Components.ActionMap import ActionMap
 from Components.Button import Button
-from Components.config import config, ConfigYesNo, ConfigIP, NoSave, ConfigText, ConfigEnableDisable, ConfigPassword, ConfigSelection, getConfigListEntry, ConfigNothing
+from Components.config import config, ConfigIP, NoSave, ConfigText, ConfigEnableDisable, ConfigPassword, ConfigSelection, getConfigListEntry
 from Components.ConfigList import ConfigListScreen
-from Components.Label import Label,MultiColorLabel
-from Components.Pixmap import Pixmap,MultiPixmap
+from Components.Label import Label
+from Components.Pixmap import Pixmap
 from Components.ActionMap import ActionMap, NumberActionMap
-from enigma import eTimer, ePoint, eSize, RT_HALIGN_LEFT, eListboxPythonMultiContent, gFont
+from enigma import ePoint
 from AutoMount import iAutoMount, AutoMount
 
 class AutoMountEdit(Screen, ConfigListScreen):
@@ -23,7 +23,7 @@ class AutoMountEdit(Screen, ConfigListScreen):
                         <widget name="ButtonRedtext" position="410,365" size="140,21" zPosition="10" font="Regular;21" transparent="1" />
                         <widget name="ButtonRed" pixmap="skin_default/buttons/button_red.png" position="390,365" zPosition="10" size="15,16" transparent="1" alphatest="on" />
                         <widget name="VKeyIcon" pixmap="skin_default/vkey_icon.png" position="40,345" zPosition="10" size="60,48" transparent="1" alphatest="on" />
-                        <widget name="HelpWindow" pixmap="skin_default/vkey_icon.png" position="175,325" zPosition="1" size="1,1" transparent="1" alphatest="on" />     
+                        <widget name="HelpWindow" pixmap="skin_default/vkey_icon.png" position="175,325" zPosition="1" size="1,1" transparent="1" alphatest="on" />
                         <ePixmap pixmap="skin_default/bottombar.png" position="10,310" size="540,120" zPosition="1" transparent="1" alphatest="on" />
                 </screen>"""
 
@@ -35,13 +35,13 @@ class AutoMountEdit(Screen, ConfigListScreen):
                 self.mountinfo = mountinfo
                 if self.mountinfo is None:
                         #Initialize blank mount enty
-                        self.mountinfo = { 'isMounted': False, 'active': False, 'ip': False, 'sharename': False, 'sharedir': False, 'username': False, 'password': False, 'mounttype' : False, 'options' : False } 
-                
+                        self.mountinfo = { 'isMounted': False, 'active': False, 'ip': False, 'sharename': False, 'sharedir': False, 'username': False, 'password': False, 'mounttype' : False, 'options' : False }
+
                 self.applyConfigRef = None
                 self.updateConfigRef = None
                 self.mounts = iAutoMount.getMountsList()
                 self.createConfig()
-                
+
                 self["actions"] = NumberActionMap(["SetupActions"],
                 {
                         "ok": self.ok,
@@ -49,7 +49,7 @@ class AutoMountEdit(Screen, ConfigListScreen):
                         "cancel": self.close,
                         "red": self.close,
                 }, -2)
+
                 self["VirtualKB"] = ActionMap(["ShortcutActions"],
                 {
                         "green": self.KeyGreen,
@@ -69,7 +69,7 @@ class AutoMountEdit(Screen, ConfigListScreen):
 
 
         def layoutFinished(self):
-                self.setTitle(_("Mounts editor"))        
+                self.setTitle(_("Mounts editor"))
                 self["ButtonGreen"].hide()
                 self["VKeyIcon"].hide()
                 self["VirtualKB"].setEnabled(False)
@@ -95,22 +95,22 @@ class AutoMountEdit(Screen, ConfigListScreen):
                 self.optionsEntry = None
                 self.usernameEntry = None
                 self.passwordEntry = None
-                
+
                 self.sharetypelist = []
                 self.sharetypelist.append(("nfs", _("NFS share")))
-                self.sharetypelist.append(("cifs", _("CIFS share")))    
+                self.sharetypelist.append(("cifs", _("CIFS share")))
 
                 if self.mountinfo.has_key('mounttype'):
                         mounttype = self.mountinfo['mounttype']
                 else:
                         mounttype = "nfs"
-                        
+
                 if self.mountinfo.has_key('active'):
                         active = self.mountinfo['active']
                         if active == 'True':
                                 active = True
                         if active == 'False':
-                                active = False                        
+                                active = False
                 else:
                         active = True
                 if self.mountinfo.has_key('ip'):
@@ -119,11 +119,11 @@ class AutoMountEdit(Screen, ConfigListScreen):
                         else:
                                 ip = self.convertIP(self.mountinfo['ip'])
                 else:
-                        ip = [192, 168, 0, 0]                   
+                        ip = [192, 168, 0, 0]
                 if self.mountinfo.has_key('sharename'):
                         sharename = self.mountinfo['sharename']
                 else:
-                        sharename = "Sharename"                 
+                        sharename = "Sharename"
                 if self.mountinfo.has_key('sharedir'):
                         sharedir = self.mountinfo['sharedir']
                 else:
@@ -152,10 +152,10 @@ class AutoMountEdit(Screen, ConfigListScreen):
                 if username is False:
                         username = ""
                 if password is False:
-                        password = ""                           
+                        password = ""
                 if mounttype is False:
                         mounttype = "nfs"
-                
+
                 self.activeConfigEntry = NoSave(ConfigEnableDisable(default = active))
                 self.ipConfigEntry = NoSave(ConfigIP(default = ip))
                 self.sharenameConfigEntry = NoSave(ConfigText(default = sharename, visible_width = 50, fixed_size = False))
@@ -164,15 +164,15 @@ class AutoMountEdit(Screen, ConfigListScreen):
                 self.usernameConfigEntry = NoSave(ConfigText(default = username, visible_width = 50, fixed_size = False))
                 self.passwordConfigEntry = NoSave(ConfigPassword(default = password, visible_width = 50, fixed_size = False))
                 self.mounttypeConfigEntry = NoSave(ConfigSelection(self.sharetypelist, default = mounttype ))
-                
+
         def createSetup(self):
                 self.list = []
                 self.activeEntry = getConfigListEntry(_("Active"), self.activeConfigEntry)
                 self.list.append(self.activeEntry)
                 self.sharenameEntry = getConfigListEntry(_("Local share name"), self.sharenameConfigEntry)
-                self.list.append(self.sharenameEntry)   
+                self.list.append(self.sharenameEntry)
                 self.mounttypeEntry = getConfigListEntry(_("Mount type"), self.mounttypeConfigEntry)
-                self.list.append(self.mounttypeEntry)           
+                self.list.append(self.mounttypeEntry)
                 self.ipEntry = getConfigListEntry(_("Server IP"), self.ipConfigEntry)
                 self.list.append(self.ipEntry)
                 self.sharedirEntry = getConfigListEntry(_("Server share"), self.sharedirConfigEntry)
@@ -196,7 +196,7 @@ class AutoMountEdit(Screen, ConfigListScreen):
         def newConfig(self):
                 if self["config"].getCurrent() == self.mounttypeEntry:
                         self.createSetup()
-        
+
         def KeyGreen(self):
                 print "Green Pressed"
                 if self["config"].getCurrent() == self.sharenameEntry:
@@ -210,7 +210,6 @@ class AutoMountEdit(Screen, ConfigListScreen):
                 if self["config"].getCurrent() == self.passwordEntry:
                         self.session.openWithCallback(lambda x : self.VirtualKeyBoardCallback(x, 'password'), VirtualKeyBoard, title = (_("Enter password:")), text = self.passwordConfigEntry.value)
 
-        
         def VirtualKeyBoardCallback(self, callback = None, entry = None):
                 if callback is not None and len(callback) and entry is not None and len(entry):
                         if entry == 'sharename':
@@ -268,7 +267,7 @@ class AutoMountEdit(Screen, ConfigListScreen):
                         iAutoMount.setMountsAttribute(self.sharenameConfigEntry.value, "sharename", self.sharenameConfigEntry.value)
                         iAutoMount.setMountsAttribute(self.sharenameConfigEntry.value, "active", self.activeConfigEntry.value)
                         iAutoMount.setMountsAttribute(self.sharenameConfigEntry.value, "ip", self.ipConfigEntry.getText())
-                        iAutoMount.setMountsAttribute(self.sharenameConfigEntry.value, "sharedir", self.sharedirConfigEntry.value)                      
+                        iAutoMount.setMountsAttribute(self.sharenameConfigEntry.value, "sharedir", self.sharedirConfigEntry.value)
                         iAutoMount.setMountsAttribute(self.sharenameConfigEntry.value, "mounttype", self.mounttypeConfigEntry.value)
                         iAutoMount.setMountsAttribute(self.sharenameConfigEntry.value, "options", self.optionsConfigEntry.value)
                         iAutoMount.setMountsAttribute(self.sharenameConfigEntry.value, "username", self.usernameConfigEntry.value)
@@ -300,27 +299,27 @@ class AutoMountEdit(Screen, ConfigListScreen):
                         data['active'] = self.activeConfigEntry.value
                         data['ip'] = self.ipConfigEntry.getText()
                         data['sharename'] = self.sharenameConfigEntry.value
-                        data['sharedir'] = self.sharedirConfigEntry.value                       
+                        data['sharedir'] = self.sharedirConfigEntry.value
                         data['options'] =  self.optionsConfigEntry.value
                         data['mounttype'] = self.mounttypeConfigEntry.value
                         data['username'] = self.usernameConfigEntry.value
                         data['password'] = self.passwordConfigEntry.value
                         self.applyConfigRef = None
                         self.applyConfigRef = self.session.openWithCallback(self.applyConfigfinishedCB, MessageBox, _("Please wait for activation of your network mount..."), type = MessageBox.TYPE_INFO, enable_input = False)
-                        iAutoMount.automounts[self.sharenameConfigEntry.value] = data 
+                        iAutoMount.automounts[self.sharenameConfigEntry.value] = data
                         iAutoMount.writeMountsConfig()
-                        iAutoMount.getAutoMountPoints(self.applyConfigDataAvail)                        
+                        iAutoMount.getAutoMountPoints(self.applyConfigDataAvail)
                 else:
                         self.close()
 
         def applyConfigDataAvail(self, data):
                 if data is True:
                         self.applyConfigRef.close(True)
-    
+
         def applyConfigfinishedCB(self,data):
                 if data is True:
                         self.session.openWithCallback(self.applyfinished, MessageBox, _("Your network mount has been activated."), type = MessageBox.TYPE_INFO, timeout = 10)
-        
+
         def applyfinished(self,data):
                 if data is not None:
                         if data is True:
index 8a17d7f..43091ad 100755 (executable)
@@ -4,23 +4,20 @@ from __init__ import _
 from Screens.Screen import Screen\r
 from Screens.MessageBox import MessageBox\r
 from Screens.VirtualKeyBoard import VirtualKeyBoard\r
-from enigma import loadPNG, eListboxPythonMultiContent, gFont, eTimer\r
 from Components.Label import Label\r
 from Components.Pixmap import Pixmap\r
 from Components.ActionMap import ActionMap\r
-from Components.MultiContent import MultiContentEntryText, MultiContentEntryPixmapAlphaTest\r
 from Components.Network import iNetwork\r
 from Components.Sources.List import List\r
 from Tools.LoadPixmap import LoadPixmap\r
 from Tools.Directories import resolveFilename, SCOPE_PLUGINS, SCOPE_SKIN_IMAGE\r
-from os import system, popen, path as os_path, listdir\r
+from os import path as os_path\r
 \r
 from MountView import AutoMountView\r
 from MountEdit import AutoMountEdit\r
 from AutoMount import iAutoMount, AutoMount\r
 from UserManager import UserManager\r
 \r
-\r
 class AutoMountManager(Screen):\r
        skin = """\r
                <screen name="AutoMountManager" position="90,140" size="560,350" title="AutoMountManager">\r
@@ -57,16 +54,16 @@ class AutoMountManager(Screen):
                self["ButtonRed"] = Pixmap()\r
                self["ButtonRedtext"] = Label(_("Close"))\r
                self["introduction"] = Label(_("Press OK to select."))\r
-               \r
+\r
                self.list = []\r
                self["config"] = List(self.list)\r
                self.updateList()\r
-               self.onClose.append(self.cleanup)       \r
+               self.onClose.append(self.cleanup)\r
                self.onShown.append(self.setWindowTitle)\r
 \r
        def setWindowTitle(self):\r
                self.setTitle(_("MountManager"))\r
-               \r
+\r
        def cleanup(self):\r
                iNetwork.stopRestartConsole()\r
                iNetwork.stopGetInterfacesConsole()\r
@@ -80,10 +77,9 @@ class AutoMountManager(Screen):
                self.list.append((_("Change hostname"),"hostname", _("Change the hostname of your Dreambox."), okpng))\r
                self["config"].setList(self.list)\r
 \r
-\r
        def exit(self):\r
                self.close()\r
-               \r
+\r
        def keyOK(self, returnValue = None):\r
                if returnValue == None:\r
                        returnValue = self["config"].getCurrent()[1]\r
@@ -95,12 +91,13 @@ class AutoMountManager(Screen):
                                self.userEdit()\r
                        elif returnValue is "hostname":\r
                                self.hostEdit()\r
+\r
        def addMount(self):\r
                self.session.open(AutoMountEdit, self.skin_path)\r
 \r
        def viewMounts(self):\r
                self.session.open(AutoMountView, self.skin_path)\r
-               \r
+\r
        def userEdit(self):\r
                self.session.open(UserManager, self.skin_path)\r
 \r
@@ -110,7 +107,7 @@ class AutoMountManager(Screen):
                        self.hostname = fp.read()\r
                        fp.close()\r
                        self.session.openWithCallback(self.hostnameCallback, VirtualKeyBoard, title = (_("Enter new hostname for your Dreambox")), text = self.hostname)\r
-       \r
+\r
        def hostnameCallback(self, callback = None):\r
                if callback is not None and len(callback):\r
                        fp = open('/etc/hostname', 'w+')\r
@@ -121,7 +118,7 @@ class AutoMountManager(Screen):
        def restartLan(self):\r
                iNetwork.restartNetwork(self.restartLanDataAvail)\r
                self.restartLanRef = self.session.openWithCallback(self.restartfinishedCB, MessageBox, _("Please wait while your network is restarting..."), type = MessageBox.TYPE_INFO, enable_input = False)\r
-                       \r
+\r
        def restartLanDataAvail(self, data):\r
                if data is True:\r
                        iNetwork.getInterfaces(self.getInterfacesDataAvail)\r
index 8d558ba..8a41538 100755 (executable)
@@ -4,28 +4,21 @@ from __init__ import _
 from Screens.Screen import Screen\r
 from Screens.MessageBox import MessageBox\r
 from Components.Label import Label\r
-from Components.Pixmap import Pixmap\r
 from Components.ActionMap import ActionMap\r
-from Components.MenuList import MenuList\r
-from Components.MultiContent import MultiContentEntryText, MultiContentEntryPixmapAlphaTest\r
 from Components.Network import iNetwork\r
-from Components.Console import Console\r
 from Components.Sources.List import List\r
-from enigma import eListboxPythonMultiContent, gFont, eTimer\r
 from Tools.LoadPixmap import LoadPixmap\r
 from Tools.Directories import resolveFilename, SCOPE_PLUGINS, SCOPE_SKIN_IMAGE\r
-from os import system, popen, path as os_path, listdir\r
 from AutoMount import iAutoMount, AutoMount\r
 from MountEdit import AutoMountEdit\r
 \r
-\r
 class AutoMountView(Screen):\r
         skin = """\r
                 <screen name="AutoMountView" position="90,140" size="560,350" title="MountView">\r
                         <widget name="legend1" position="0,0" zPosition="1" size="130,40" font="Regular;18" halign="center" valign="center" />\r
                         <widget name="legend2" position="130,0" zPosition="1" size="310,40" font="Regular;18" halign="center" valign="center" />\r
                         <widget name="legend3" position="410,0" zPosition="1" size="100,40" font="Regular;18" halign="center" valign="center" />\r
-                        <ePixmap pixmap="skin_default/div-h.png" position="0,40" zPosition="2" size="560,2" />  \r
+                        <ePixmap pixmap="skin_default/div-h.png" position="0,40" zPosition="2" size="560,2" />\r
                         <widget source="config" render="Listbox" position="5,50" size="555,200" scrollbarMode="showOnDemand">\r
                                 <convert type="TemplatedMultiContent">\r
                                         {"template": [\r
@@ -48,7 +41,7 @@ class AutoMountView(Screen):
                         <widget name="deletetext" position="50,305" size="350,21" zPosition="10" font="Regular;21" transparent="1" />\r
                         <ePixmap pixmap="skin_default/bottombar.png" position="10,250" size="540,120" zPosition="1" transparent="1" alphatest="on" />\r
                 </screen>"""\r
-                \r
+\r
         def __init__(self, session, plugin_path):\r
                 self.skin_path = plugin_path\r
                 self.session = session\r
@@ -69,7 +62,7 @@ class AutoMountView(Screen):
                 self["introduction"] = Label(_("Press OK to edit the settings."))\r
                 self["ButtonRedtext"] = Label(_("Close"))\r
                 self["deletetext"] = Label(_("Delete selected mount"))\r
-                \r
+\r
                 self.list = []\r
                 self["config"] = List(self.list)\r
                 self.showMountsList()\r
@@ -108,11 +101,10 @@ class AutoMountView(Screen):
                 if cur:\r
                         returnValue = cur[1]\r
                         self.session.openWithCallback(self.MountEditClosed, AutoMountEdit, self.skin_path, iAutoMount.automounts[returnValue])\r
-                \r
+\r
         def MountEditClosed(self, returnValue = None):\r
                 if returnValue == None:\r
                         self.showMountsList()\r
-          \r
 \r
         def delete(self, returnValue = None):\r
                 cur = self["config"].getCurrent()\r
@@ -134,11 +126,9 @@ class AutoMountView(Screen):
         def applyConfigfinishedCB(self,data):\r
                 if data is True:\r
                         self.session.openWithCallback(self.ConfigfinishedCB, MessageBox, _("Your network mount has been removed."), type = MessageBox.TYPE_INFO, timeout = 10)\r
-        \r
-                \r
+\r
         def ConfigfinishedCB(self,data):\r
                 if data is not None:\r
                         if data is True:\r
                                 self.showMountsList()\r
-                        \r
 \r
index 16e0a44..99376eb 100755 (executable)
@@ -4,10 +4,7 @@ from __init__ import _
 from enigma import eTimer, getDesktop
 from Screens.Screen import Screen
 from Screens.MessageBox import MessageBox
-from Components.config import config, ConfigText, ConfigPassword, getConfigListEntry, ConfigNothing, ConfigSubsection, ConfigSubList, ConfigSubDict, ConfigIP
-from Components.ConfigList import ConfigListScreen
 from Components.Label import Label
-from Components.Pixmap import Pixmap
 from Components.ActionMap import ActionMap, NumberActionMap
 from Components.Sources.List import List
 from Components.Network import iNetwork
@@ -15,7 +12,7 @@ from Components.Input import Input
 from Tools.Directories import resolveFilename, SCOPE_PLUGINS, SCOPE_SKIN_IMAGE
 from Tools.LoadPixmap import LoadPixmap
 from cPickle import dump, load
-from os import path as os_path, unlink, stat, mkdir,remove
+from os import path as os_path, stat, mkdir, remove
 from time import time
 from stat import ST_MTIME
 
@@ -31,7 +28,7 @@ def write_cache(cache_file, cache_data):
                try:
                        mkdir( os_path.dirname(cache_file) )
                except OSError:
-                           print os_path.dirname(cache_file), 'is a file'
+                       print os_path.dirname(cache_file), 'is a file'
        fd = open(cache_file, 'w')
        dump(cache_data, fd, -1)
        fd.close()
@@ -89,7 +86,7 @@ class NetworkBrowser(Screen):
                        <ePixmap pixmap="skin_default/buttons/button_yellow.png" position="30,420" zPosition="10" size="15,16" transparent="1" alphatest="on" />
                        <widget name="rescantext" position="50,420" size="300,21" zPosition="10" font="Regular;21" transparent="1" />
                </screen>"""
-               
+
        def __init__(self, session, iface,plugin_path):
                Screen.__init__(self, session)
                self.skin_path = plugin_path
@@ -101,15 +98,15 @@ class NetworkBrowser(Screen):
                self.device = None
                self.mounts = None
                self.expanded = []
-               self.cache_ttl = 604800  #Seconds cache is considered valid, 7 Days should be ok
-               self.cache_file = '/etc/enigma2/networkbrowser.cache' #Path to cache directory          
-               
+               self.cache_ttl = 604800 #Seconds cache is considered valid, 7 Days should be ok
+               self.cache_file = '/etc/enigma2/networkbrowser.cache' #Path to cache directory
+
                self["closetext"] = Label(_("Close"))
                self["mounttext"] = Label(_("Mounts management"))
                self["rescantext"] = Label(_("Rescan network"))
                self["infotext"] = Label(_("Press OK to mount!"))
                self["searchtext"] = Label(_("Scan IP"))
-               
+
                self["shortcuts"] = ActionMap(["ShortcutActions", "WizardActions"],
                {
                        "ok": self.go,
@@ -119,18 +116,18 @@ class NetworkBrowser(Screen):
                        "yellow": self.keyYellow,
                        "blue": self.keyBlue,
                })
-               
+
                self.list = []
                self.statuslist = []
                self.listindex = 0
                self["list"] = List(self.list)
                self["list"].onSelectionChanged.append(self.selectionChanged)
-               
+
                self.onLayoutFinish.append(self.startRun)
                self.onShown.append(self.setWindowTitle)
-               self.onClose.append(self.cleanup)       
+               self.onClose.append(self.cleanup)
                self.Timer = eTimer()
-               self.Timer.callback.append(self.TimerFire)              
+               self.Timer.callback.append(self.TimerFire)
 
        def cleanup(self):
                del self.Timer
@@ -146,22 +143,22 @@ class NetworkBrowser(Screen):
                if self.cache_ttl > 0 and self.vc != 0:
                        self.process_NetworkIPs()
                else:
-                       self.Timer.start(3000)          
-               
+                       self.Timer.start(3000)
+
        def TimerFire(self):
                self.Timer.stop()
                self.process_NetworkIPs()
-               
+
        def setWindowTitle(self):
                self.setTitle(_("Browse network neighbourhood"))
-               
+
        def keyGreen(self):
                self.session.open(AutoMountManager, None, self.skin_path)
 
        def keyYellow(self):
                if (os_path.exists(self.cache_file) == True):
                        remove(self.cache_file)
-               self.startRun() 
+               self.startRun()
 
        def keyBlue(self):
                self.session.openWithCallback(self.scanIPclosed,ScanIP)
@@ -182,13 +179,13 @@ class NetworkBrowser(Screen):
                        self.statuslist = []
                        if status == 'update':
                                statuspng = LoadPixmap(cached=True, path=resolveFilename(SCOPE_PLUGINS, "SystemPlugins/NetworkBrowser/icons/update.png"))
-                               self.statuslist.append(( ['info'], statuspng, _("Searching your network. Please wait..."), None, None, None, None  ))
-                               self['list'].setList(self.statuslist)   
+                               self.statuslist.append(( ['info'], statuspng, _("Searching your network. Please wait..."), None, None, None, None ))
+                               self['list'].setList(self.statuslist)
                        elif status == 'error':
                                statuspng = LoadPixmap(cached=True, path=resolveFilename(SCOPE_PLUGINS, "SystemPlugins/NetworkBrowser/icons/error.png"))
-                               self.statuslist.append(( ['info'], statuspng, _("No network devices found!"), None, None, None, None  ))
-                               self['list'].setList(self.statuslist)                           
-       
+                               self.statuslist.append(( ['info'], statuspng, _("No network devices found!"), None, None, None, None ))
+                               self['list'].setList(self.statuslist)
+
        def process_NetworkIPs(self):
                self.inv_cache = 0
                self.vc = valid_cache(self.cache_file, self.cache_ttl)
@@ -206,7 +203,7 @@ class NetworkBrowser(Screen):
                        self.updateHostsList()
                else:
                        self.setStatus('error')
-                       
+
        def getNetworkIPs(self):
                nwlist = []
                sharelist = []
@@ -216,7 +213,7 @@ class NetworkBrowser(Screen):
                        nwlist.append(netscan.netzInfo(strIP))
                tmplist = nwlist[0]
                return tmplist
-       
+
        def getNetworkShares(self,hostip,hostname,devicetype):
                sharelist = []
                self.sharecache_file = None
@@ -233,7 +230,7 @@ class NetworkBrowser(Screen):
                else:
                        username = "username"
                        password = "password"
-                       
+
                if devicetype == 'unix':
                        smblist=netscan.smbShare(hostip,hostname,username,password)
                        for x in smblist:
@@ -249,7 +246,7 @@ class NetworkBrowser(Screen):
                        for x in smblist:
                                if len(x) == 6:
                                        if x[3] != 'IPC$':
-                                               sharelist.append(x)                     
+                                               sharelist.append(x)
                return sharelist
 
        def updateHostsList(self):
@@ -265,7 +262,7 @@ class NetworkBrowser(Screen):
                        name = hostentry[2] + " ( " +hostentry[1].strip() + " )"
                        print hostentry
                        expandableIcon = LoadPixmap(cached=True, path=resolveFilename(SCOPE_PLUGINS, "SystemPlugins/NetworkBrowser/icons/host.png"))
-                       self.list.append(( hostentry, expandableIcon, name, None, None, None, None  ))
+                       self.list.append(( hostentry, expandableIcon, name, None, None, None, None ))
                self["list"].setList(self.list)
                self["list"].setIndex(self.listindex)
 
@@ -287,14 +284,14 @@ class NetworkBrowser(Screen):
                                hostentry = self.network[x][0][1]
                                name = hostentry[2] + " ( " +hostentry[1].strip() + " )"
                                expandedIcon = LoadPixmap(cached=True, path=resolveFilename(SCOPE_PLUGINS, "SystemPlugins/NetworkBrowser/icons/host.png"))
-                               self.list.append(( hostentry, expandedIcon, name,  None, None, None, None  ))
+                               self.list.append(( hostentry, expandedIcon, name, None, None, None, None ))
                                for share in networkshares:
                                        self.list.append(self.BuildNetworkShareEntry(share))
                        else: # HOSTLIST - VIEW
                                hostentry = self.network[x][0][1]
                                name = hostentry[2] + " ( " +hostentry[1].strip() + " )"
                                expandableIcon = LoadPixmap(cached=True, path=resolveFilename(SCOPE_PLUGINS, "SystemPlugins/NetworkBrowser/icons/host.png"))
-                               self.list.append(( hostentry, expandableIcon, name,  None, None, None, None  ))
+                               self.list.append(( hostentry, expandableIcon, name, None, None, None, None ))
                self["list"].setList(self.list)
                self["list"].setIndex(self.listindex)
 
@@ -331,7 +328,7 @@ class NetworkBrowser(Screen):
                        isMountedpng = LoadPixmap(cached=True, path=resolveFilename(SCOPE_PLUGINS, "SystemPlugins/NetworkBrowser/icons/ok.png"))
                else:
                        isMountedpng = LoadPixmap(cached=True, path=resolveFilename(SCOPE_PLUGINS, "SystemPlugins/NetworkBrowser/icons/cancel.png"))
-                       
+
                return((share, verticallineIcon, None, sharedir, sharedescription, newpng, isMountedpng))
 
        def selectionChanged(self):
@@ -339,11 +336,11 @@ class NetworkBrowser(Screen):
                self.listindex = self["list"].getIndex()
                print len(current)
                if current:
-                       if current[0][0] in ( "nfsShare", "smbShare"):
+                       if current[0][0] in ("nfsShare", "smbShare"):
                                self["infotext"].show()
                        else:
                                self["infotext"].hide()
-               
+
        def go(self):
                sel = self["list"].getCurrent()
                if sel is None:
@@ -395,13 +392,13 @@ class NetworkBrowser(Screen):
        def UserDialogClosed(self, *ret):
                if ret is not None and len(ret):
                        self.go()
-                       
+
        def openMountEdit(self, selection):
                if selection is not None and len(selection):
                        mounts = iAutoMount.getMountsList()
                        if selection[0] == 'nfsShare': # share entry selected
                                #Initialize blank mount enty
-                               data = { 'isMounted': False, 'active': False, 'ip': False, 'sharename': False, 'sharedir': False, 'username': False, 'password': False, 'mounttype' : False, 'options' : False } 
+                               data = { 'isMounted': False, 'active': False, 'ip': False, 'sharename': False, 'sharedir': False, 'username': False, 'password': False, 'mounttype' : False, 'options' : False }
                                # add data
                                data['mounttype'] = 'nfs'
                                data['active'] = True
@@ -416,7 +413,7 @@ class NetworkBrowser(Screen):
                                self.session.openWithCallback(self.MountEditClosed,AutoMountEdit, self.skin_path, data)
                        if selection[0] == 'smbShare': # share entry selected
                                #Initialize blank mount enty
-                               data = { 'isMounted': False, 'active': False, 'ip': False, 'sharename': False, 'sharedir': False, 'username': False, 'password': False, 'mounttype' : False, 'options' : False } 
+                               data = { 'isMounted': False, 'active': False, 'ip': False, 'sharename': False, 'sharedir': False, 'username': False, 'password': False, 'mounttype' : False, 'options' : False }
                                # add data
                                data['mounttype'] = 'cifs'
                                data['active'] = True
@@ -458,7 +455,7 @@ class ScanIP(Screen):
                        <ePixmap pixmap="skin_default/buttons/green.png" position="160,40" zPosition="2" size="140,40" transparent="1" alphatest="on" />
                        <widget name="edittext" position="170,50" size="300,21" zPosition="10" font="Regular;21" transparent="1" />
                </screen>"""
-               
+
        def __init__(self, session):
                Screen.__init__(self, session)
                self.session = session
@@ -471,13 +468,13 @@ class ScanIP(Screen):
 
                self["closetext"] = Label(_("Cancel"))
                self["edittext"] = Label(_("OK"))
-               
+
                if (y>=720):
                        self["text"] = Input(text, maxSize=False, type=Input.TEXT)
                else:
                        self["text"] = Input(text, maxSize=False, visible_width = 55, type=Input.TEXT)
-                       
-               self["actions"] = NumberActionMap(["WizardActions", "InputActions", "TextEntryActions", "KeyboardInputActions","ShortcutActions"], 
+
+               self["actions"] = NumberActionMap(["WizardActions", "InputActions", "TextEntryActions", "KeyboardInputActions","ShortcutActions"],
                {
                        "ok": self.go,
                        "back": self.exit,
@@ -502,7 +499,7 @@ class ScanIP(Screen):
                }, -1)
 
                self.onLayoutFinish.append(self.layoutFinished)
-               
+
        def exit(self):
                self.close(None)
 
@@ -512,30 +509,31 @@ class ScanIP(Screen):
 
        def setWindowTitle(self):
                self.setTitle(_("Enter IP to scan..."))
-               
+
        def go(self):
                text = self["text"].getText()
                if text:
                        self.close(text)
-               
+
        def keyLeft(self):
                self["text"].left()
-       
+
        def keyRight(self):
                self["text"].right()
-       
+
        def keyHome(self):
                self["text"].home()
-       
+
        def keyEnd(self):
                self["text"].end()
-       
+
        def keyDeleteForward(self):
                self["text"].delete()
-       
+
        def keyDeleteBackward(self):
                self["text"].deleteBackward()
-       
+
        def keyNumberGlobal(self, number):
                print "pressed", number
                self["text"].number(number)
+
index 8290790..cf00067 100755 (executable)
@@ -5,15 +5,14 @@ from Screens.Screen import Screen
 from Screens.MessageBox import MessageBox
 from Screens.VirtualKeyBoard import VirtualKeyBoard
 from Components.ActionMap import ActionMap
-from Components.Button import Button
-from Components.config import config, ConfigText, ConfigPassword, NoSave, getConfigListEntry, ConfigNothing, ConfigSubsection, ConfigSubList, ConfigSubDict
+from Components.config import ConfigText, ConfigPassword, NoSave, getConfigListEntry
 from Components.ConfigList import ConfigListScreen
-from Components.Label import Label,MultiColorLabel
-from Components.Pixmap import Pixmap,MultiPixmap
+from Components.Label import Label
+from Components.Pixmap import Pixmap
 from Components.ActionMap import ActionMap, NumberActionMap
-from enigma import eTimer, ePoint, eSize, RT_HALIGN_LEFT, eListboxPythonMultiContent, gFont
+from enigma import ePoint
 from cPickle import dump, load
-from os import path as os_path, system as os_system, unlink, stat, mkdir
+from os import path as os_path, unlink, stat, mkdir
 from time import time
 from stat import ST_MTIME
 
@@ -23,7 +22,7 @@ def write_cache(cache_file, cache_data):
                try:
                        mkdir( os_path.dirname(cache_file) )
                except OSError:
-                           print os_path.dirname(cache_file), 'is a file'
+                       print os_path.dirname(cache_file), 'is a file'
        fd = open(cache_file, 'w')
        dump(cache_data, fd, -1)
        fd.close()
@@ -56,7 +55,7 @@ class UserDialog(Screen, ConfigListScreen):
                        <widget name="ButtonRedtext" position="410,345" size="140,21" zPosition="10" font="Regular;21" transparent="1" />
                        <widget name="ButtonRed" pixmap="skin_default/buttons/button_red.png" position="390,345" zPosition="10" size="15,16" transparent="1" alphatest="on" />
                        <widget name="VKeyIcon" pixmap="skin_default/vkey_icon.png" position="35,310" zPosition="10" size="60,48" transparent="1" alphatest="on" />
-                       <widget name="HelpWindow" pixmap="skin_default/vkey_icon.png" position="175,300" zPosition="1" size="1,1" transparent="1" alphatest="on" />     
+                       <widget name="HelpWindow" pixmap="skin_default/vkey_icon.png" position="175,300" zPosition="1" size="1,1" transparent="1" alphatest="on" />
                        <ePixmap pixmap="skin_default/bottombar.png" position="10,290" size="540,120" zPosition="1" transparent="1" alphatest="on" />
                </screen>"""
 
@@ -65,10 +64,10 @@ class UserDialog(Screen, ConfigListScreen):
                self.session = session
                Screen.__init__(self, self.session)
                self.hostinfo = hostinfo
-               self.cache_ttl = 86400  #600 is default, 0 disables, Seconds cache is considered valid
+               self.cache_ttl = 86400 #600 is default, 0 disables, Seconds cache is considered valid
                self.cache_file = '/etc/enigma2/' + self.hostinfo + '.cache' #Path to cache directory
                self.createConfig()
-               
+
                self["shortcuts"] = ActionMap(["ShortcutActions","WizardActions"],
                {
                        "red": self.close,
@@ -95,7 +94,7 @@ class UserDialog(Screen, ConfigListScreen):
 
        def layoutFinished(self):
                print self["config"].getCurrent()
-               self.setTitle(_("Enter user and password for host: ")+ self.hostinfo)   
+               self.setTitle(_("Enter user and password for host: ")+ self.hostinfo)
                self["ButtonGreen"].show()
                self["VKeyIcon"].show()
                self["VirtualKB"].setEnabled(True)
@@ -114,7 +113,7 @@ class UserDialog(Screen, ConfigListScreen):
                self.passwordEntry = None
                self.username = None
                self.password = None
-               
+
                if os_path.exists(self.cache_file):
                        print 'Loading user cache from ',self.cache_file
                        try:
@@ -130,7 +129,7 @@ class UserDialog(Screen, ConfigListScreen):
 
                self.username = NoSave(ConfigText(default = username, visible_width = 50, fixed_size = False))
                self.password = NoSave(ConfigPassword(default = password, visible_width = 50, fixed_size = False))
-               
+
        def createSetup(self):
                self.list = []
                self.usernameEntry = getConfigListEntry(_("Username"), self.username)
@@ -142,14 +141,12 @@ class UserDialog(Screen, ConfigListScreen):
                self["config"].l.setList(self.list)
                self["config"].onSelectionChanged.append(self.selectionChanged)
 
-
        def KeyGreen(self):
                if self["config"].getCurrent() == self.usernameEntry:
                        self.session.openWithCallback(lambda x : self.VirtualKeyBoardCallback(x, 'username'), VirtualKeyBoard, title = (_("Enter username:")), text = self.username.value)
                if self["config"].getCurrent() == self.passwordEntry:
                        self.session.openWithCallback(lambda x : self.VirtualKeyBoardCallback(x, 'password'), VirtualKeyBoard, title = (_("Enter password:")), text = self.password.value)
 
-       
        def VirtualKeyBoardCallback(self, callback = None, entry = None):
                if callback is not None and len(callback) and entry is not None and len(entry):
                        if entry == 'username':
@@ -177,7 +174,7 @@ class UserDialog(Screen, ConfigListScreen):
 
        def ok(self):
                current = self["config"].getCurrent()
-               self.hostdata = { 'username': self.username.value, 'password': self.password.value } 
+               self.hostdata = { 'username': self.username.value, 'password': self.password.value }
                write_cache(self.cache_file, self.hostdata)
                self.close(True)
-               
+
index 38263c4..c5b7305 100755 (executable)
@@ -10,7 +10,7 @@ from Components.Sources.List import List
 from Tools.LoadPixmap import LoadPixmap\r
 from Tools.Directories import resolveFilename, SCOPE_PLUGINS, SCOPE_SKIN_IMAGE\r
 from UserDialog import UserDialog\r
-from os import path as os_path, system as os_system, unlink, stat, mkdir, listdir\r
+from os import unlink, listdir\r
 \r
 class UserManager(Screen):\r
        skin = """\r
@@ -50,7 +50,7 @@ class UserManager(Screen):
                self["ButtonRedtext"] = Label(_("Close"))\r
                self["introduction"] = Label(_("Press OK to edit selected settings."))\r
                self["deletetext"] = Label(_("Delete"))\r
-               \r
+\r
                self.list = []\r
                self["config"] = List(self.list)\r
                self.updateList()\r
@@ -72,7 +72,7 @@ class UserManager(Screen):
 \r
        def exit(self):\r
                self.close()\r
-               \r
+\r
        def keyOK(self, returnValue = None):\r
                cur = self["config"].getCurrent()\r
                if cur:\r
@@ -89,3 +89,4 @@ class UserManager(Screen):
                        if os_path.exists(cachefile):\r
                                unlink(cachefile)\r
                                self.updateList()\r
+\r
index c1cbb55..de26355 100755 (executable)
@@ -25,6 +25,6 @@ def _(txt):
                print "[NetworkBrowser] fallback to default translation for", txt\r
                t = gettext.gettext(txt)\r
        return t\r
-       \r
+\r
 localeInit()\r
-language.addCallback(localeInit)
\ No newline at end of file
+language.addCallback(localeInit)\r
index 3bef7e1..4e9eacc 100755 (executable)
@@ -6,7 +6,6 @@ from Plugins.Plugin import PluginDescriptor
 from NetworkBrowser import NetworkBrowser\r
 from Components.Network import iNetwork\r
 from MountManager import AutoMountManager\r
-from os import path\r
 \r
 plugin_path = ""\r
 \r