cleanup some imports
[enigma2.git] / lib / python / Plugins / SystemPlugins / SkinSelector / plugin.py
index 49156db48293fa2b0c49263b2e28ac271b47c699..fdb2683418f48caa735b1f0024d880af4b574f3b 100755 (executable)
@@ -1,26 +1,24 @@
+# -*- coding: iso-8859-1 -*-
 # (c) 2006 Stephan Reichholf
 # This Software is Free, use it where you want, when you want for whatever you want and modify it if you want but don't remove my copyright!
 # (c) 2006 Stephan Reichholf
 # This Software is Free, use it where you want, when you want for whatever you want and modify it if you want but don't remove my copyright!
-
-from enigma import *
 from Screens.Screen import Screen
 from Screens.Screen import Screen
+from Screens.Standby import TryQuitMainloop
 from Screens.MessageBox import MessageBox
 from Components.ActionMap import NumberActionMap
 from Components.Pixmap import Pixmap
 from Screens.MessageBox import MessageBox
 from Components.ActionMap import NumberActionMap
 from Components.Pixmap import Pixmap
-from Components.GUIComponent import *
 from Components.MenuList import MenuList
 from Plugins.Plugin import PluginDescriptor
 from Components.MenuList import MenuList
 from Plugins.Plugin import PluginDescriptor
-
 from Components.config import config
 from Components.config import config
-from Tools.Directories import SCOPE_SKIN
-
 from Components.config import config
 
 from Components.config import config
 
-import os, sys
+from os import path, walk
 
 class SkinSelector(Screen):
 
 class SkinSelector(Screen):
+       # for i18n:
+       # _("Choose your Skin")
        skin = """
        skin = """
-               <screen position="75,138" size="600,300" title="Choose your Skin" >
-                       <widget name="SkinList" position="10,10" size="275,280" scrollbarMode="showOnDemand" />
+               <screen position="75,138" size="600,320" title="Choose your Skin" >
+                       <widget name="SkinList" position="10,10" size="275,300" scrollbarMode="showOnDemand" />
                        <widget name="Preview" position="305,45" size="280,210" alphatest="on"/>
                </screen>
                """
                        <widget name="Preview" position="305,45" size="280,210" alphatest="on"/>
                </screen>
                """
@@ -34,10 +32,9 @@ class SkinSelector(Screen):
                Screen.__init__(self, session)
 
                self.skinlist = []
                Screen.__init__(self, session)
 
                self.skinlist = []
-               self.session = session
                self.previewPath = ""
 
                self.previewPath = ""
 
-               os.path.walk(self.root, self.find, "")
+               path.walk(self.root, self.find, "")
 
                self.skinlist.sort()
                self["SkinList"] = MenuList(self.skinlist)
 
                self.skinlist.sort()
                self["SkinList"] = MenuList(self.skinlist)
@@ -104,7 +101,7 @@ class SkinSelector(Screen):
                else:
                        pngpath = self.root+self["SkinList"].getCurrent()+"/prev.png"
 
                else:
                        pngpath = self.root+self["SkinList"].getCurrent()+"/prev.png"
 
-               if not os.path.exists(pngpath):
+               if not path.exists(pngpath):
                        # FIXME: don't use hardcoded path
                        pngpath = "/usr/lib/enigma2/python/Plugins/SystemPlugins/SkinSelector/noprev.png"
 
                        # FIXME: don't use hardcoded path
                        pngpath = "/usr/lib/enigma2/python/Plugins/SystemPlugins/SkinSelector/noprev.png"
 
@@ -115,7 +112,7 @@ class SkinSelector(Screen):
 
        def restartGUI(self, answer):
                if answer is True:
 
        def restartGUI(self, answer):
                if answer is True:
-                       quitMainloop(3)
+                       self.session.open(TryQuitMainloop, 3)
 
 def SkinSelMain(session, **kwargs):
        session.open(SkinSelector)
 
 def SkinSelMain(session, **kwargs):
        session.open(SkinSelector)