freemyipod r592 - Code Review

Jump to: navigation, search
Repository:freemyipod
Revision:r591‎ | r592 | r593 >
Date:20:26, 12 February 2011
Author:farthen
Status:new
Tags:
Comment:
emCORE tools: libemcore.py: Fix some accidentally introduced tabs
Modified paths:
  • /emcore/trunk/tools/libemcore.py (modified) (history)

Diff [purge]

Index: emcore/trunk/tools/libemcore.py
@@ -285,19 +285,19 @@
286286 """ Reads a zero terminated string from memory
287287 Reads only a maximum of 'maxlength' chars.
288288 """
289 - if addr == 0: return "<NULL>"
 289+ if addr == 0: return "<NULL>"
290290 cin_maxsize = self.lib.dev.packetsizelimit.cin - self.lib.headersize
291291 string = ""
292 - done = False
 292+ done = False
293293 while not done and (len(string) < maxlength or maxlength < 0):
294294 data = self._readmem(addr, min(maxlength - len(string), cin_maxsize))
295295 length = data.find(b"\0")
296296 if length >= 0:
297 - data = data[:length]
298 - done = True
299 - for i in range(len(data)):
300 - byte = ord(data[i : i + 1])
301 - if byte < 0x20: string = string + replacement
 297+ data = data[:length]
 298+ done = True
 299+ for i in range(len(data)):
 300+ byte = ord(data[i : i + 1])
 301+ if byte < 0x20: string = string + replacement
302302 else: string = string + chr(byte)
303303 addr += cin_maxsize
304304 return string
@@ -389,8 +389,8 @@
390390 threadstruct = threadstruct._to_bunch()
391391 threadstruct.id = id # only for the purpose of detecting the idle thread as it is always the first one
392392 threadstruct.addr = structptr
393 - if threadstruct.name != 0:
394 - threadstruct.name = self.readstring(threadstruct.name)
 393+ if threadstruct.name != 0:
 394+ threadstruct.name = self.readstring(threadstruct.name)
395395 else: threadstruct.name = "[Thread %08X]" % structptr
396396 threadstruct.state = thread_state(threadstruct.state)
397397 threads.append(threadstruct)