freemyipod r475 - Code Review

Jump to: navigation, search
Repository:freemyipod
Revision:r474‎ | r475 | r476 >
Date:03:52, 22 January 2011
Author:farthen
Status:new
Tags:
Comment:
emcore tools: bugfix: mixed hex and decimal in some default arguments
Modified paths:
  • /emcore/trunk/tools/emcore.py (modified) (history)
  • /emcore/trunk/tools/libemcore.py (modified) (history)

Diff [purge]

Index: emcore/trunk/tools/emcore.py
@@ -877,7 +877,7 @@
878878 self.logger.info("done\n")
879879
880880 @command
881 - def readrawstoragefile(self, volume, sector, count, file, buffsize = 100000, buffer = None):
 881+ def readrawstoragefile(self, volume, sector, count, file, buffsize = 0x100000, buffer = None):
882882 """
883883 Reads <count> sectors starting at <sector> from storage <volume> to file <file>,
884884 buffering them in memory at [buffer] in chunks of [buffsize] bytes (both optional).
@@ -912,7 +912,7 @@
913913 self.logger.info("done\n")
914914
915915 @command
916 - def writerawstoragefile(self, volume, sector, count, file, buffsize = 100000, buffer = None):
 916+ def writerawstoragefile(self, volume, sector, count, file, buffsize = 0x100000, buffer = None):
917917 """
918918 Writes contents of <file> to <count> sectors starting at <sector> on storage <volume>,
919919 buffering them in memory at [buffer] in chunks of [buffsize] bytes (both optional).
@@ -1005,7 +1005,7 @@
10061006 self.logger.info(" done\n")
10071007
10081008 @command
1009 - def get(self, remotename, localname, buffsize = 10000, buffer = None):
 1009+ def get(self, remotename, localname, buffsize = 0x10000, buffer = None):
10101010 """
10111011 Downloads a file
10121012 <remotename>: filename on the device
@@ -1040,7 +1040,7 @@
10411041 self.logger.info(" done\n")
10421042
10431043 @command
1044 - def gettree(self, remotepath, localpath, buffsize = 10000, buffer = None):
 1044+ def gettree(self, remotepath, localpath, buffsize = 0x10000, buffer = None):
10451045 """
10461046 Downloads a directory tree
10471047 <remotepath>: path on the device
@@ -1074,7 +1074,7 @@
10751075 self.emcore.free(buffer)
10761076
10771077 @command
1078 - def put(self, localname, remotename, buffsize = 10000, buffer = None):
 1078+ def put(self, localname, remotename, buffsize = 0x10000, buffer = None):
10791079 """
10801080 Uploads a file
10811081 <localname>: filename on the computer
@@ -1111,7 +1111,7 @@
11121112 self.logger.info(" done\n")
11131113
11141114 @command
1115 - def puttree(self, localpath, remotepath, buffsize = 10000, buffer = None):
 1115+ def puttree(self, localpath, remotepath, buffsize = 0x10000, buffer = None):
11161116 """
11171117 Uploads a directory tree
11181118 <localpath>: path on the computer
Index: emcore/trunk/tools/libemcore.py
@@ -618,7 +618,7 @@
619619 return result
620620
621621 @command(timeout = 50000)
622 - def storage_read_sectors_md(self, volume, sector, count, size = 100000, addr = None):
 622+ def storage_read_sectors_md(self, volume, sector, count, size = 0x100000, addr = None):
623623 """ Read sectors from as storage device. If addr is not given it allocates a buffer itself. """
624624 if addr is None:
625625 addr = self.malloc(size)
@@ -633,7 +633,7 @@
634634 if result.rc > 0x80000000:
635635 raise DeviceError("storage_read_sectors_md(volume=%d, sector=%d, count=%d, addr=0x%08X) failed with RC 0x%08X" % (volume, sector, count, addr, rc))
636636
637 - def storage_write_sectors_md(self, volume, sector, count, size = 100000, addr = None):
 637+ def storage_write_sectors_md(self, volume, sector, count, size = 0x100000, addr = None):
638638 """ Read sectors from as storage device. If addr is not given it allocates a buffer itself. """
639639 if addr is None:
640640 addr = self.malloc(size)
@@ -665,7 +665,7 @@
666666 return result.size
667667
668668 @command(timeout = 30000)
669 - def file_read(self, fd, size = 100000, addr = None):
 669+ def file_read(self, fd, size = 0x100000, addr = None):
670670 """ Reads data from a file referenced by a handle. If addr is not given it allocates a buffer itself. """
671671 if addr is None:
672672 addr = self.malloc(size)
@@ -682,7 +682,7 @@
683683 return result.rc
684684
685685 @command(timeout = 30000)
686 - def file_write(self, fd, size = 100000, addr = None):
 686+ def file_write(self, fd, size = 0x100000, addr = None):
687687 """ Writes data from a file referenced by a handle. If addr is not given it allocates a buffer itself. """
688688 if addr is None:
689689 addr = self.malloc(size)