Merge branch 'refs/heads/develop'

This commit is contained in:
Ruud committed 2013-10-18 17:29:10 +02:00
commit 5af8fd0b21
3 files changed
+17 -11

No files matched your search

+10 -6
View File
@@ -298,6 +298,7 @@ class SourceUpdater(BaseUpdater):
def replaceWith(self, path): def replaceWith(self, path):
app_dir = ss(Env.get('app_dir')) app_dir = ss(Env.get('app_dir'))
data_dir = ss(Env.get('data_dir'))
# Get list of files we want to overwrite # Get list of files we want to overwrite
self.deletePyc() self.deletePyc()
@@ -329,12 +330,15 @@ class SourceUpdater(BaseUpdater):
log.error('Failed overwriting file "%s": %s', (tofile, traceback.format_exc())) log.error('Failed overwriting file "%s": %s', (tofile, traceback.format_exc()))
return False return False
if Env.get('app_dir') not in Env.get('data_dir'): for still_exists in existing_files:
for still_exists in existing_files:
try: if data_dir in still_exists:
os.remove(still_exists) continue
except:
log.error('Failed removing non-used file: %s', traceback.format_exc()) try:
os.remove(still_exists)
except:
log.error('Failed removing non-used file: %s', traceback.format_exc())
return True return True
+7 -5
View File
@@ -1,6 +1,6 @@
import collections
from couchpotato.core.helpers.encoding import simplifyString, toSafeString, ss from couchpotato.core.helpers.encoding import simplifyString, toSafeString, ss
from couchpotato.core.logger import CPLog from couchpotato.core.logger import CPLog
import collections
import hashlib import hashlib
import os.path import os.path
import platform import platform
@@ -137,16 +137,18 @@ def getImdb(txt, check_inside = False, multiple = False):
output.close() output.close()
try: try:
ids = re.findall('(tt\d{7})', txt) ids = re.findall('(tt\d{4,7})', txt)
if multiple: if multiple:
return list(set(ids)) if len(ids) > 0 else [] return list(set(['tt%07d' % tryInt(x[2:]) for x in ids])) if len(ids) > 0 else []
return ids[0]
return 'tt%07d' % tryInt(ids[0][2:])
except IndexError: except IndexError:
pass pass
return False return False
def tryInt(s, default=0): def tryInt(s, default = 0):
try: return int(s) try: return int(s)
except: return default except: return default
Regular → Executable
View File
File mode changed.