add uname info

This commit is contained in:
cuu 2018-05-29 05:53:19 +08:00
parent 12b605e024
commit 5bcc26dab7
5 changed files with 36 additions and 18 deletions

View File

@ -2,6 +2,7 @@
import pygame
#import math
import subprocess
#from beeprint import pp
from libs.roundrects import aa_round_rect
@ -94,6 +95,19 @@ class AboutPage(Page):
Page.__init__(self)
self._Icons = {}
def Uname(self):
out = {}
out["key"]="uname"
out["label"]= "Kernel:"
st = subprocess.check_output(["uname","-srmpo"])
st = st.strip("\n")
st = st.strip("\t")
out["value"] = st
self._AList["uname"] = out
return
def CpuMhz(self):
try:
@ -202,8 +216,8 @@ class AboutPage(Page):
start_y = 10
last_height = 0
for i,u in enumerate( ["processor","armcores","cpuscalemhz","features","memory"] ):
#for i,u in enumerate( ["processor","cpucores","cpumhz","flags","memory"] ):
for i,u in enumerate( ["processor","armcores","cpuscalemhz","features","memory","uname"] ):
#for i,u in enumerate( ["processor","cpucores","cpumhz","flags","memory","uname"] ):
if u not in self._AList:
continue
@ -251,6 +265,7 @@ class AboutPage(Page):
self.CpuInfo()
self.MemInfo()
self.CpuMhz()
self.Uname()
self.GenList()

View File

@ -118,7 +118,6 @@ class FavListPage(Page):
files_path = glob.glob(path+"/*")
print(files_path)
ret = []
for i ,v in enumerate(files_path):
@ -144,8 +143,8 @@ class FavListPage(Page):
dirmap["file"] = v
ret.append(dirmap)
else:
print("not file or dir")
# else:
# print("not file or dir")
return ret
@ -157,8 +156,8 @@ class FavListPage(Page):
if alist == False:
print("listfiles return false")
return
print("fav list alist: ")
print(alist)
# print("fav list alist: ")
# print(alist)
self._MyList = []
start_x = 0

View File

@ -152,8 +152,8 @@ class RomListPage(Page):
if pieces[ len(pieces)-1 ].lower() in self._Emulator["EXT"]:
dirmap["file"] = v
ret.append(dirmap)
else:
print("not file or dir")
# else:
# print("not file or dir")
return ret
@ -165,8 +165,6 @@ class RomListPage(Page):
if alist == False:
print("listfiles return false")
return
print("rom list alist: ")
print(alist)
self._MyList = []
start_x = 0

View File

@ -46,7 +46,8 @@ class MessageBox(Label):
self._Text = text
def Draw(self):
self._Width = 0
self._Height = 0
self._CanvasHWND.fill( (255,255,255))
words = self._Text.split(' ')
@ -71,7 +72,12 @@ class MessageBox(Label):
lines += word_height
self._CanvasHWND.blit(word_surface, (x, y))
if len(words) == 1: # single line
x += word_width
else:
x += word_width + space
if x > self._Width:
self._Width = x
@ -90,6 +96,7 @@ class MessageBox(Label):
if self._HWND != None:
rect = midRect(self._Parent._Width/2,self._Parent._Height/2,self._Width,self._Height,Width,Height)
self._HWND.blit(self._CanvasHWND,rect,(0,0,self._Width,self._Height))
#self._HWND.blit(self._CanvasHWND,rect)
pygame.draw.rect(self._HWND,(0,0,0),(x-padding,y-padding, self._Width+padding*2,self._Height+padding*2),1)

View File

@ -56,7 +56,6 @@ class MultiLabel: ##Multi Line Label
lines = 0
for i,line in enumerate(words[:4]):
for word in line[:12]:
#print(word)
word_surface = font.render(word, True, color)
word_width = word_surface.get_width()
word_height = word_surface.get_height()
@ -64,7 +63,7 @@ class MultiLabel: ##Multi Line Label
if row_total_width+space >= max_width:
x = pos[0] # Reset the x.
y += word_height # Start on new row.
row_total_width = 0
row_total_width = word_width
if lines == 0:
lines += word_height