freemyipod r486 - Code Review

Jump to: navigation, search
Repository:freemyipod
Revision:r485‎ | r486 | r487 >
Date:17:35, 22 January 2011
Author:theseven
Status:new
Tags:
Comment:
emcore.py: Fix some possible exception suppressors
Modified paths:
  • /emcore/trunk/tools/emcore.py (modified) (history)

Diff [purge]

Index: emcore/trunk/tools/emcore.py
@@ -1074,11 +1074,11 @@
10751075 while True:
10761076 try:
10771077 entry = self.emcore.dir_read(handle)
1078 - if entry.name == "." or entry.name == "..": continue
1079 - elif entry.attributes & 0x10:
1080 - self.gettree(remotepath + "/" + entry.name, localpath + "/" + entry.name, buffsize, buffer)
1081 - else: self.get(remotepath + "/" + entry.name, localpath + "/" + entry.name, buffsize, buffer)
10821078 except: break
 1079+ if entry.name == "." or entry.name == "..": continue
 1080+ elif entry.attributes & 0x10:
 1081+ self.gettree(remotepath + "/" + entry.name, localpath + "/" + entry.name, buffsize, buffer)
 1082+ else: self.get(remotepath + "/" + entry.name, localpath + "/" + entry.name, buffsize, buffer)
10831083 finally:
10841084 if malloc == True:
10851085 self.emcore.free(buffer)
@@ -1171,10 +1171,10 @@
11721172 while True:
11731173 try:
11741174 entry = self.emcore.dir_read(handle)
1175 - if entry.attributes & 0x10: size = "DIR"
1176 - else: size = locale.format("%d", entry.size, True).rjust(13)
1177 - self.logger.info(entry.name.ljust(50) + " - " + size + "\n")
11781175 except: break
 1176+ if entry.attributes & 0x10: size = "DIR"
 1177+ else: size = locale.format("%d", entry.size, True).rjust(13)
 1178+ self.logger.info(entry.name.ljust(50) + " - " + size + "\n")
11791179 self.emcore.dir_close(handle)
11801180
11811181 @command
@@ -1188,10 +1188,10 @@
11891189 while True:
11901190 try:
11911191 entry = self.emcore.dir_read(handle)
1192 - if entry.name == "." or entry.name == "..": continue
1193 - elif entry.attributes & 0x10: self.find(path + "/" + entry.name)
1194 - else: self.logger.info(path + "/" + entry.name + "\n")
11951192 except: break
 1193+ if entry.name == "." or entry.name == "..": continue
 1194+ elif entry.attributes & 0x10: self.find(path + "/" + entry.name)
 1195+ else: self.logger.info(path + "/" + entry.name + "\n")
11961196 self.emcore.dir_close(handle)
11971197
11981198 @command