freemyipod r79 - Code Review

Jump to: navigation, search
Repository:freemyipod
Revision:r78‎ | r79 | r80 >
Date:13:10, 10 August 2010
Author:benedikt93
Status:new
Tags:
Comment:
fix libembios.py bugs
Modified paths:
  • /embios/trunk/tools/embios.py (modified) (history)
  • /embios/trunk/tools/libembios.py (modified) (history)

Diff [purge]

Index: embios/trunk/tools/embios.py
@@ -123,7 +123,7 @@
124124 if len(argv) < 6: usage()
125125 data = ""
126126 ptr = 5
127 - while ptr < lean(argv):
 127+ while ptr < len(argv):
128128 data += struct.pack("<B", int(argv[ptr]))
129129 ptr += 1
130130 dev.i2csend(int(argv[2]), int(argv[3]), int(argv[4]), data)
Index: embios/trunk/tools/libembios.py
@@ -60,7 +60,7 @@
6161 self.dev = dev
6262
6363 self.svnrev, self.major, self.minor, self.patch, self.type, self.devtype = i[1:6]
64 - self.__myprint("Connected to emBIOS %s v%d.%d.%d (SVN revision: %d) on %s, USB version %s" \
 64+ self.__myprint("Connected to emBIOS %s v%d.%d.%d (SVN revision: %d) on %s, USB version %s\n" \
6565 % (self.type2name(self.type), self.major, self.minor, self.patch, self.svnrev, \
6666 self.devtype2name(self.devtype), dev.deviceVersion))
6767
@@ -134,7 +134,7 @@
135135 @staticmethod
136136 def type2name(type):
137137 if type == 1: return "Debugger"
138 - else: return "UNKNOWN (%8x)" % type
 138+ else: return "UNKNOWN (0x%08x)" % type
139139
140140
141141 @staticmethod
@@ -143,7 +143,7 @@
144144 if devtype == 0x47334e49: return "iPod Nano 3G"
145145 if devtype == 0x47344e49: return "iPod Nano 4G"
146146 if devtype == 0x4c435049: return "iPod Classic"
147 - else: return "UNKNOWN (%8x)" % devtype
 147+ else: return "UNKNOWN (0x%08x)" % devtype
148148
149149
150150 #=====================================================================================
@@ -838,7 +838,7 @@
839839
840840 try:
841841 i = 0
842 - while (out[0] == 1) and (!silent): # Process information struct version == 1 && !silent
 842+ while out[0] == 1 and not silent: # Process information struct version == 1 && !silent
843843 processinfoprint += "--------------------------------------------------------------------------------"
844844 processinfoprint += "R0: 0x%08x, R1: 0x%08x, R2: 0x%08x, R3: 0x%08x,\n\
845845 R4: 0x%08x, R5: 0x%08x, R6: 0x%08x, R7: 0x%08x,\n\