couchpotato.core.helpers.variable module

couchpotato.core.helpers.variable.cleanHost(host, protocol=True, ssl=False, username=None, password=None)[source]

Return a cleaned up host with given url options set

Changes protocol to https if ssl is set to True and http if ssl is set to false. >>> cleanHost(“localhost:80”, ssl=True) ‘https://localhost:80/’ >>> cleanHost(“localhost:80”, ssl=False) ‘http://localhost:80/’

Username and password is managed with the username and password variables >>> cleanHost(“localhost:80”, username=”user”, password=”passwd”) ‘http://user:passwd@localhost:80/’

Output without scheme (protocol) can be forced with protocol=False >>> cleanHost(“localhost:80”, protocol=False) ‘localhost:80’

couchpotato.core.helpers.variable.compareVersions(version1, version2)[source]
couchpotato.core.helpers.variable.dictIsSubset(a, b)[source]
couchpotato.core.helpers.variable.find(func, iterable)[source]
couchpotato.core.helpers.variable.flattenList(l)[source]
couchpotato.core.helpers.variable.fnEscape(pattern)[source]
couchpotato.core.helpers.variable.getDataDir()[source]
couchpotato.core.helpers.variable.getDownloadDir()[source]
couchpotato.core.helpers.variable.getExt(filename)[source]
couchpotato.core.helpers.variable.getFreeSpace(directories)[source]
couchpotato.core.helpers.variable.getIdentifier(media)[source]
couchpotato.core.helpers.variable.getImdb(txt, check_inside=False, multiple=False)[source]
couchpotato.core.helpers.variable.getSize(paths)[source]
couchpotato.core.helpers.variable.getTitle(media_dict)[source]
couchpotato.core.helpers.variable.getUserDir()[source]
couchpotato.core.helpers.variable.isDict(obj)[source]
couchpotato.core.helpers.variable.isLocalIP(ip)[source]
couchpotato.core.helpers.variable.isSubFolder(sub_folder, base_folder)[source]
couchpotato.core.helpers.variable.md5(text)[source]
couchpotato.core.helpers.variable.mergeDicts(a, b, prepend_list=False)[source]
couchpotato.core.helpers.variable.natsortKey(string_)[source]

See http://www.codinghorror.com/blog/archives/001018.html

couchpotato.core.helpers.variable.possibleTitles(raw_title)[source]
couchpotato.core.helpers.variable.randomString(size=8, chars='ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789')[source]
couchpotato.core.helpers.variable.removeDuplicate(l)[source]
couchpotato.core.helpers.variable.removeEmpty(l)[source]
couchpotato.core.helpers.variable.removeListDuplicates(seq)[source]
couchpotato.core.helpers.variable.removePyc(folder, only_excess=True, show_logs=True)[source]
couchpotato.core.helpers.variable.scanForPassword(name)[source]
couchpotato.core.helpers.variable.sha1(text)[source]
couchpotato.core.helpers.variable.splitString(str, split_on=', ', clean=True)[source]
couchpotato.core.helpers.variable.toIterable(value)[source]
couchpotato.core.helpers.variable.tryFloat(s)[source]
couchpotato.core.helpers.variable.tryInt(s, default=0)[source]
couchpotato.core.helpers.variable.underscoreToCamel(name)[source]