Updater fixes

This commit is contained in:
Ruud
2011-10-22 22:19:37 +02:00
parent 7608de9018
commit a1a3a8e3ea
+5 -5
View File
@@ -104,8 +104,8 @@ class Updater(Plugin):
self.deletePyc() self.deletePyc()
return True return True
except Exception, e: except:
log.error('Failed updating via GIT: %s' % e) log.error('Failed updating via GIT: %s' % traceback.format_exc())
self.update_failed = True self.update_failed = True
@@ -115,13 +115,13 @@ class Updater(Plugin):
for root, dirs, files in os.walk(Env.get('app_dir')): for root, dirs, files in os.walk(Env.get('app_dir')):
pyc_files = filter(lambda filename: filename.endswith(".pyc"), files) pyc_files = filter(lambda filename: filename.endswith('.pyc'), files)
py_files = set(filter(lambda filename: filename.endswith(".py"), files)) py_files = set(filter(lambda filename: filename.endswith('.py'), files))
excess_pyc_files = filter(lambda pyc_filename: pyc_filename[:-1] not in py_files, pyc_files) excess_pyc_files = filter(lambda pyc_filename: pyc_filename[:-1] not in py_files, pyc_files)
for excess_pyc_file in excess_pyc_files: for excess_pyc_file in excess_pyc_files:
full_path = os.path.join(root, excess_pyc_file) full_path = os.path.join(root, excess_pyc_file)
log.debug("Removing old PYC file:" % full_path) log.debug('Removing old PYC file: %s' % full_path)
try: try:
os.remove(full_path) os.remove(full_path)
except: except: