freemyipod r854 - Code Review

Jump to: navigation, search
Repository:freemyipod
Revision:r853‎ | r854 | r855 >
Date:01:06, 2 January 2012
Author:theseven
Status:new
Tags:
Comment:
(lib)emcoreldr.py: Python3 fixes
Modified paths:
  • /emcore/trunk/tools/emcoreldr.py (modified) (history)
  • /emcore/trunk/tools/libemcoreldr.py (modified) (history)

Diff [purge]

Index: emcore/trunk/tools/libemcoreldr.py
@@ -147,7 +147,7 @@
148148
149149 while True:
150150 data = f.read(65536)
151 - if data == "": break
 151+ if data == b"": break
152152 self.write(offset, data)
153153 offset += len(data)
154154 self.__myprint(".")
Index: emcore/trunk/tools/emcoreldr.py
@@ -30,29 +30,29 @@
3131
3232
3333 def usage():
34 - print ""
35 - print "Please provide a command and (if needed) parameters as command line arguments"
36 - print ""
37 - print "Available commands:"
38 - print ""
39 - print " upload <address> <file>"
40 - print " Uploads the specified file to the specified memory address on the device."
41 - print ""
42 - print " download <address> <size> <file>"
43 - print " Downloads <size> bytes of data from the specified address on the device,"
44 - print " and stores it in the specified file."
45 - print ""
46 - print " execute <address> <stack>"
47 - print " Executes code at the specified address in the device's memory."
48 - print " The stack pointer will be set to <stack> before jumping to <address>."
49 - print " iBugger will probably lose control of the device,"
50 - print " if the code isn't explicitly written for it."
51 - print ""
52 - print " run <file>"
53 - print " Loads the specified file to 0x08000000 (SDRAM) and executes it."
54 - print " This is what you usually want to do."
55 - print ""
56 - print "All numbers can be provided as either hex (0x prefix), binary (0b prefix) or decimal (no prefix)"
 34+ print("")
 35+ print("Please provide a command and (if needed) parameters as command line arguments")
 36+ print("")
 37+ print("Available commands:")
 38+ print("")
 39+ print(" upload <address> <file>")
 40+ print(" Uploads the specified file to the specified memory address on the device.")
 41+ print("")
 42+ print(" download <address> <size> <file>")
 43+ print(" Downloads <size> bytes of data from the specified address on the device,")
 44+ print(" and stores it in the specified file.")
 45+ print("")
 46+ print(" execute <address> <stack>")
 47+ print(" Executes code at the specified address in the device's memory.")
 48+ print(" The stack pointer will be set to <stack> before jumping to <address>.")
 49+ print(" iBugger will probably lose control of the device,")
 50+ print(" if the code isn't explicitly written for it.")
 51+ print("")
 52+ print(" run <file>")
 53+ print(" Loads the specified file to 0x08000000 (SDRAM) and executes it.")
 54+ print(" This is what you usually want to do.")
 55+ print("")
 56+ print("All numbers can be provided as either hex (0x prefix), binary (0b prefix) or decimal (no prefix)")
5757 exit(2)
5858
5959