Spring cleanup

This commit is contained in:
Ruud committed 2014-03-29 23:44:14 +01:00
1 parent 83c5d701b3
commit 99e77e409a
98 files changed
+469 -489

No files matched your search

+2 -1
View File
@@ -2,7 +2,7 @@ from urllib import unquote
import re
from couchpotato.core.helpers.encoding import toUnicode
from couchpotato.core.helpers.variable import natsortKey, tryInt
from couchpotato.core.helpers.variable import natsortKey
def getParams(params):
@@ -44,6 +44,7 @@ def getParams(params):
return dictToList(temp)
non_decimal = re.compile(r'[^\d.]+')
def dictToList(params):
if type(params) is dict:
+4 -3
View File
@@ -216,6 +216,7 @@ def tryFloat(s):
return float(s)
except: return 0
def natsortKey(string_):
"""See http://www.codinghorror.com/blog/archives/001018.html"""
return [int(s) if s.isdigit() else s for s in re.split(r'(\d+)', string_)]
@@ -247,9 +248,6 @@ def getTitle(media_dict):
except:
log.error('Could not get title for %s', getIdentifier(media_dict))
return None
log.error('Could not get title for %s', getIdentifier(media_dict))
return None
except:
log.error('Could not get title for library item: %s', media_dict)
return None
@@ -296,8 +294,11 @@ def isSubFolder(sub_folder, base_folder):
# Returns True if sub_folder is the same as or inside base_folder
return base_folder and sub_folder and ss(os.path.normpath(base_folder).rstrip(os.path.sep) + os.path.sep) in ss(os.path.normpath(sub_folder).rstrip(os.path.sep) + os.path.sep)
# From SABNZBD
re_password = [re.compile(r'(.+){{([^{}]+)}}$'), re.compile(r'(.+)\s+password\s*=\s*(.+)$', re.I)]
def scanForPassword(name):
m = None
for reg in re_password: