Browse Source

Updater fixes

pull/62/head
Ruud 14 years ago
parent
commit
a1a3a8e3ea
  1. 10
      couchpotato/core/plugins/updater/main.py

10
couchpotato/core/plugins/updater/main.py

@ -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:

Loading…
Cancel
Save