Example #1
0
    def GenList(self):
        if self._Config == None:
            return

        self._AList = {}
        self._MyList = []
        ## map ini to self._AList
        for i, v in enumerate(self._Config.items("Settings")):
            self._AList[v[0]] = v[
                1]  ## {'BGCOLOR': '#eab934', 'Enabled': 'False',...}

        start_x = 10
        start_y = 0

        for i, v in enumerate(self._AList):
            li = InfoPageListItem()
            li._Parent = self
            li._PosX = start_x
            li._PosY = start_y + i * InfoPageListItem._Height
            li._Width = Width - 10
            li._Fonts["normal"] = self._ListFontObj
            li._Fonts["small"] = fonts["varela12"]

            li.Init(v)
            li._Flag = v
            li.SetSmallText(self._AList[v])
            if v != "Enabled":
                li._ReadOnly = True

            self._MyList.append(li)
    def GenList(self):

        self._MyList = []
        ## map ini to self._AList
        files_path = glob.glob(self._CORES_PATH+"/*")
        
        start_x  = 10
        start_y  = 0
        counter = 0 
        for i,v in enumerate( files_path):
            if os.path.basename(v) in self._HiddenSos:
                continue
            
            filename, file_extension = os.path.splitext(v)

            alias_file = filename+file_extension + ".alias"
            
            if file_extension in self._AllowedExts:
                li = InfoPageListItem()
                li._Parent = self
                li._PosX   = start_x
                li._PosY   = start_y + counter*InfoPageListItem._Height
                li._Width  = Width-10
                li._Fonts["normal"] = self._ListFontObj
                li._Fonts["small"] = MySkinManager.GiveFont("varela12")
                li._ReadOnly = True
                
                if os.path.isfile(alias_file):
                    fp = open(alias_file, "r")
                    alias = fp.read()
                    alias = alias.strip()
                    label_text = alias.decode("utf8")
                    li.Init( label_text )
                    fp.close()
                else:
                    li.Init( os.path.basename(v) )
                li._Flag = v
                ##li.SetSmallText( v )
                
                self._MyList.append(li)
                counter += 1