freemyipod r271 - Code Review

Jump to: navigation, search
Repository:freemyipod
Revision:r270‎ | r271 | r272 >
Date:17:56, 22 November 2010
Author:farthen
Status:new
Tags:
Comment:
emBIOS: embios.py: Run on unknown devices
Modified paths:
  • /embios/trunk/tools/embios.py (modified) (history)

Diff [purge]

Index: embios/trunk/tools/embios.py
@@ -266,8 +266,12 @@
267267 """
268268 if infotype == "version":
269269 resp = self.embios.getversioninfo()
 270+ try:
 271+ hwtype = libembiosdata.hwtypes[resp.hwtypeid]
 272+ except KeyError:
 273+ hwtype = "UNKNOWN (ID = " + self._hex(resp.hwtypeid) + ")"
270274 self.logger.info("Connected to "+libembiosdata.swtypes[resp.swtypeid] + " v" + str(resp.majorv) + "." + str(resp.minorv) +
271 - "." + str(resp.patchv) + " r" + str(resp.revision) + " running on " + libembiosdata.hwtypes[resp.hwtypeid] + "\n")
 275+ "." + str(resp.patchv) + " r" + str(resp.revision) + " running on " + hwtype + "\n")
272276 elif infotype == "packetsize":
273277 resp = self.embios.getpacketsizeinfo()
274278 self.logger.info("Maximum packet sizes: "+str(resp))