本文整理汇总了Python中Tools.HardwareInfo.HardwareInfo.upper方法的典型用法代码示例。如果您正苦于以下问题:Python HardwareInfo.upper方法的具体用法?Python HardwareInfo.upper怎么用?Python HardwareInfo.upper使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Tools.HardwareInfo.HardwareInfo
的用法示例。
在下文中一共展示了HardwareInfo.upper方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: NFIFlash
# 需要导入模块: from Tools.HardwareInfo import HardwareInfo [as 别名]
# 或者: from Tools.HardwareInfo.HardwareInfo import upper [as 别名]
class NFIFlash(Screen):
skin = """
<screen name="NFIFlash" position="90,95" size="560,420" title="Image flash utility">
<ePixmap pixmap="skin_default/buttons/green.png" position="140,0" zPosition="0" size="140,40" transparent="1" alphatest="on" />
<ePixmap pixmap="skin_default/buttons/yellow.png" position="280,0" zPosition="0" size="140,40" transparent="1" alphatest="on" />
<ePixmap pixmap="skin_default/buttons/blue.png" position="420,0" zPosition="0" size="140,40" transparent="1" alphatest="on" />
<widget source="key_green" render="Label" position="140,0" zPosition="1" size="140,40" font="Regular;20" valign="center" halign="center" backgroundColor="#1f771f" transparent="1" />
<widget source="key_yellow" render="Label" position="280,0" zPosition="1" size="140,40" font="Regular;20" valign="center" halign="center" backgroundColor="#a08500" transparent="1" />
<widget source="key_blue" render="Label" position="420,0" zPosition="1" size="140,40" font="Regular;20" valign="center" halign="center" backgroundColor="#18188b" transparent="1" />
<widget source="listlabel" render="Label" position="16,44" size="200,21" valign="center" font="Regular;18" />
<widget name="filelist" position="0,68" size="260,260" scrollbarMode="showOnDemand" />
<widget source="infolabel" render="Label" position="270,44" size="280,284" font="Regular;16" />
<widget source="job_progressbar" render="Progress" position="10,374" size="540,26" borderWidth="1" backgroundColor="#254f7497" />
<widget source="job_progresslabel" render="Label" position="180,378" zPosition="2" font="Regular;18" halign="center" transparent="1" size="200,22" foregroundColor="#000000" />
<widget source="statusbar" render="Label" position="10,404" size="540,16" font="Regular;16" foregroundColor="#cccccc" />
</screen>"""
def __init__(self, session, cancelable = True, close_on_finish = False):
self.skin = NFIFlash.skin
Screen.__init__(self, session)
self["job_progressbar"] = Progress()
self["job_progresslabel"] = StaticText("")
self["finished"] = Boolean()
self["infolabel"] = StaticText("")
self["statusbar"] = StaticText(_("Please select .NFI flash image file from medium"))
self["listlabel"] = StaticText(_("select .NFI flash file")+":")
self["key_green"] = StaticText()
self["key_yellow"] = StaticText()
self["key_blue"] = StaticText()
self["actions"] = ActionMap(["OkCancelActions", "ColorActions", "DirectionActions"],
{
"green": self.ok,
"yellow": self.reboot,
"ok": self.ok,
"left": self.left,
"right": self.right,
"up": self.up,
"down": self.down
}, -1)
currDir = "/media/usb/"
self.filelist = FileList(currDir, matchingPattern = "^.*\.(nfi|NFI)")
self["filelist"] = self.filelist
self.nfifile = ""
self.md5sum = ""
self.job = None
self.box = HardwareInfo().get_device_name()
def closeCB(self):
if ( self.job is None or self.job.status is not self.job.IN_PROGRESS ) and not self.no_autostart:
self.close()
#else:
#if self.cancelable:
#self.cancel()
def up(self):
self["filelist"].up()
self.check_for_NFO()
def down(self):
self["filelist"].down()
self.check_for_NFO()
def right(self):
self["filelist"].pageDown()
self.check_for_NFO()
def left(self):
self["filelist"].pageUp()
self.check_for_NFO()
def check_for_NFO(self):
self.session.summary.setText(self["filelist"].getFilename())
if self["filelist"].getFilename() is None:
return
if self["filelist"].getCurrentDirectory() is not None:
self.nfifile = self["filelist"].getCurrentDirectory()+self["filelist"].getFilename()
if self.nfifile.upper().endswith(".NFI"):
self["key_green"].text = _("Flash")
nfofilename = self.nfifile[0:-3]+"nfo"
if fileExists(nfofilename):
nfocontent = open(nfofilename, "r").read()
self["infolabel"].text = nfocontent
pos = nfocontent.find("MD5:")
if pos > 0:
self.md5sum = nfocontent[pos+5:pos+5+32] + " " + self.nfifile
else:
self.md5sum = ""
else:
self["infolabel"].text = _("No details for this image file") + ":\n" + self["filelist"].getFilename()
self.md5sum = ""
else:
self["infolabel"].text = ""
self["key_green"].text = ""
#.........这里部分代码省略.........