def Generate(self, game, branches, current): start_x = 0 start_y = 0 i = 0 self._Game = game for branch in branches: li = InfoPageListItem() li._Parent = self li._PosX = start_x li._PosY = start_y + i*InfoPageListItem._Height li._Width = Width li._Fonts["normal"] = self._ListFontObj li._Fonts["small"] = self._ListSmFontObj li._LinkObj = branch li.Init(branch) if branch == current: self._PsIndex = i li._PosX = 2 self._MyList.append(li) i = i + 1
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 Init(self): self._SubPage = SelectPage() self._SubPage._Screen = self._Screen self._SubPage._Name = "Select Branch" self._SubPage.Init() self._ListFontObj = MyLangManager.TrFont("varela15") self._ListSmFontObj = MySkinManager.GiveFont("varela12") if self._Screen != None: if self._Screen._CanvasHWND != None and self._CanvasHWND == None: self._HWND = self._Screen._CanvasHWND self._CanvasHWND = self._Screen._CanvasHWND self._PosX = self._Index*self._Screen._Width self._Width = self._Screen._Width ## equal to screen width self._Height = self._Screen._Height ps = GamePageSelector() ps._Parent = self self._Ps = ps self._PsIndex = 0 self._Scroller = ListScroller() self._Scroller._Parent = self self._Scroller._PosX = 2 self._Scroller._PosY = 2 self._Scroller.Init() start_x = 0 start_y = 0 i = 0 games = git.get_games() for game in games: li = InfoPageListItem() li._Parent = self li._PosX = start_x li._PosY = start_y + i*InfoPageListItem._Height li._Width = Width li._Fonts["normal"] = self._ListFontObj li._Fonts["small"] = self._ListSmFontObj li._LinkObj = game li.Init( game.split("/")[-1] ) sm_text = str(len(git.get_branches(game)[0])) li.SetSmallText(sm_text) li._PosX = 2 self._MyList.append(li) i = i + 1
def GenList(self): if self._AList == None: return self._MyList = [] self._PsIndex = 0 start_x = 0 start_y = 0 for i, v in enumerate(self._AList): #print(i,v) # (0, dbus.String(u'AddressType')) li = InfoPageListItem() li._Parent = self li._PosX = start_x li._PosY = start_y + i * InfoPageListItem._Height li._Width = Width li._Fonts["normal"] = self._ListFontObj if v == "UUIDs": li._Fonts["small"] = self._ListSm2FontObj else: li._Fonts["small"] = self._ListSmFontObj li.Init(str(v)) li._Flag = v if v == "UUIDs": if len(self._AList[v]) > 1: pp(self._AList[v][0]) sm_text = str(self._AList[v][0]) else: sm_text = "<empty>" else: sm_text = str(self._AList[v]) if sm_text == "0": sm_text = "No" elif sm_text == "1": sm_text = "Yes" sm_text = sm_text[:20] li.SetSmallText(sm_text) li._PosX = 2 self._MyList.append(li)
def GenList(self): self._MyList = [] if self._NetworkId != -1: self._AList["ip"]["value"] = "Not Connected" if self._Wireless.GetCurrentNetworkID( self._Wireless.GetIwconfig()) == self._NetworkId: ip = self._Wireless.GetWirelessIP('') if ip is not None: self._AList["ip"]["value"] = ip self._AList["bssid"]["value"] = self._Wireless.GetWirelessProperty( self._NetworkId, "bssid") if FileExists("/sys/class/net/wlan0/address"): self._AList["mac_addr"]["value"] = ReadTheFileContent( "/sys/class/net/wlan0/address").strip().upper() else: self._AList["mac_addr"]["value"] = "" start_x = 0 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 li._Fonts["normal"] = self._ListFontObj li._Fonts["small"] = MyLangManager.TrFont("varela12") if self._AList[v]["label"] != "": li.Init(self._AList[v]["label"]) else: li.Init(self._AList[v]["key"]) li._Flag = self._AList[v]["key"] li.SetSmallText(self._AList[v]["value"]) 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
def GenList(self): self._MyList = [] if self._NetworkId != -1: self._AList["ip"]["value"] = "Not Connected" if self._Wireless.GetCurrentNetworkID( self._Wireless.GetIwconfig()) == self._NetworkId: ip = self._Wireless.GetWirelessIP('') if ip is not None: self._AList["ip"]["value"] = ip self._AList["bssid"]["value"] = self._Wireless.GetWirelessProperty( self._NetworkId, "bssid") start_x = 0 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 li._Fonts["normal"] = self._ListFontObj li._Fonts["small"] = fonts["varela12"] if self._AList[v]["label"] != "": li.Init(self._AList[v]["label"]) else: li.Init(self._AList[v]["key"]) li._Flag = self._AList[v]["key"] li.SetSmallText(self._AList[v]["value"]) self._MyList.append(li)
def GenList(self): start_x = 0 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 li._Fonts["normal"] = self._ListFontObj li._Fonts["small"] = MySkinManager.GiveFont("varela12") if self._AList[v]["label"] != "": li.Init( self._AList[v]["label"] ) else: li.Init( self._AList[v]["key"] ) li._Flag = self._AList[v]["key"] li.SetSmallText( self._AList[v]["value"] ) self._MyList.append(li)