cleanup whitespace
This commit is contained in:
parent
f650112413
commit
f56aab091e
1 changed files with 14 additions and 13 deletions
|
@ -2,7 +2,7 @@
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
# -*- Mode: Python; -*-
|
# -*- Mode: Python; -*-
|
||||||
# vi:si:et:sw=2:sts=2:ts=2
|
# vi:si:et:sw=2:sts=2:ts=2
|
||||||
# OXDb Import client, crawls the filesystem and gathers information about
|
# OXDb Import client, crawls the filesystem and gathers information about
|
||||||
# movies
|
# movies
|
||||||
#
|
#
|
||||||
|
|
||||||
|
@ -33,7 +33,7 @@ def _in_known_oxdb_extensions(term):
|
||||||
if re.compile(reg, re.IGNORECASE).findall(term):
|
if re.compile(reg, re.IGNORECASE).findall(term):
|
||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
|
|
||||||
def oxdb_filenameUmlaute(string):
|
def oxdb_filenameUmlaute(string):
|
||||||
string = u"%s" % string
|
string = u"%s" % string
|
||||||
string = string.replace(u'ae', u'ä')
|
string = string.replace(u'ae', u'ä')
|
||||||
|
@ -43,7 +43,7 @@ def oxdb_filenameUmlaute(string):
|
||||||
string = string.replace(u'Oe', u'Ö')
|
string = string.replace(u'Oe', u'Ö')
|
||||||
string = string.replace(u'Ue', u'Ü')
|
string = string.replace(u'Ue', u'Ü')
|
||||||
return string
|
return string
|
||||||
|
|
||||||
def oxdb_director(director):
|
def oxdb_director(director):
|
||||||
director = os.path.basename(os.path.dirname(director))
|
director = os.path.basename(os.path.dirname(director))
|
||||||
director = director.replace('&', ', ').replace(' , ', ', ')
|
director = director.replace('&', ', ').replace(' , ', ', ')
|
||||||
|
@ -80,7 +80,7 @@ def formatNumber(n, sep=','):
|
||||||
newn.extend(ln)
|
newn.extend(ln)
|
||||||
newn.reverse()
|
newn.reverse()
|
||||||
return "".join(newn)
|
return "".join(newn)
|
||||||
|
|
||||||
'''
|
'''
|
||||||
format runtime for stats
|
format runtime for stats
|
||||||
'''
|
'''
|
||||||
|
@ -104,7 +104,7 @@ def oxdb_runtimeformat(runtime):
|
||||||
years = int(days / 365)
|
years = int(days / 365)
|
||||||
days = days % 365
|
days = days % 365
|
||||||
return "%s years %s days %s hours %s minutes %s seconds" % (years, days, hours, minutes, seconds)
|
return "%s years %s days %s hours %s minutes %s seconds" % (years, days, hours, minutes, seconds)
|
||||||
|
|
||||||
def oxdb_lengthformat(mseconds):
|
def oxdb_lengthformat(mseconds):
|
||||||
"""
|
"""
|
||||||
Format mseconds in a nice way
|
Format mseconds in a nice way
|
||||||
|
@ -149,7 +149,7 @@ def oxdb_bitformat(number):
|
||||||
|
|
||||||
def oxdb_pixelformat(number):
|
def oxdb_pixelformat(number):
|
||||||
return oxdb_format(number, 'pixel', 'px')
|
return oxdb_format(number, 'pixel', 'px')
|
||||||
|
|
||||||
|
|
||||||
from htmlentitydefs import name2codepoint
|
from htmlentitydefs import name2codepoint
|
||||||
|
|
||||||
|
@ -186,27 +186,27 @@ def imdb2oxdb(imdb):
|
||||||
if imdb.startswith('0x') or imdb.startswith('ox') :
|
if imdb.startswith('0x') or imdb.startswith('ox') :
|
||||||
return imdb
|
return imdb
|
||||||
return "0x%06X" % int(imdb)
|
return "0x%06X" % int(imdb)
|
||||||
|
|
||||||
def oxdb2imdb(oxdb):
|
def oxdb2imdb(oxdb):
|
||||||
if len(oxdb) == 8:
|
if len(oxdb) == 8:
|
||||||
return "%07d" % float(oxdb)
|
return "%07d" % float(oxdb)
|
||||||
return oxdb
|
return oxdb
|
||||||
|
|
||||||
def trimString(string, length):
|
def trimString(string, length):
|
||||||
if len(string) > length:
|
if len(string) > length:
|
||||||
string = string[:length - 13] + '...' + string[-10:]
|
string = string[:length - 13] + '...' + string[-10:]
|
||||||
return string
|
return string
|
||||||
|
|
||||||
languages = ('be', 'bg', 'ba', 'wo', 'bn', 'bo', 'bh', 'bi', 'ji', 'br', 'ja',
|
languages = ('be', 'bg', 'ba', 'wo', 'bn', 'bo', 'bh', 'bi', 'ji', 'br', 'ja',
|
||||||
'ru', 'rw', 'tl', 'rm', 'rn', 'ro', 'gu', 'jw', 'gd', 'ga', 'sv', 'gn', 'gl',
|
'ru', 'rw', 'tl', 'rm', 'rn', 'ro', 'gu', 'jw', 'gd', 'ga', 'sv', 'gn', 'gl',
|
||||||
'om', 'tn', 'fa', 'oc', 'ss', 'or', 'hy', 'hr', 'sw', 'hu', 'hi', 'su', 'ha',
|
'om', 'tn', 'fa', 'oc', 'ss', 'or', 'hy', 'hr', 'sw', 'hu', 'hi', 'su', 'ha',
|
||||||
'ps', 'pt', 'sk', 'pa', 'pl', 'el', 'eo', 'en', 'zh', 'sm', 'eu', 'et', 'sa',
|
'ps', 'pt', 'sk', 'pa', 'pl', 'el', 'eo', 'en', 'zh', 'sm', 'eu', 'et', 'sa',
|
||||||
'es', 'mg', 'uz', 'ml', 'mo', 'mn', 'mi', 'as', 'mk', 'ur', 'mt', 'ms', 'mr',
|
'es', 'mg', 'uz', 'ml', 'mo', 'mn', 'mi', 'as', 'mk', 'ur', 'mt', 'ms', 'mr',
|
||||||
'my', 'fr', 'fy', 'ia', 'zu', 'fi', 'fj', 'fo', 'nl', 'no', 'na', 'ne', 'xh',
|
'my', 'fr', 'fy', 'ia', 'zu', 'fi', 'fj', 'fo', 'nl', 'no', 'na', 'ne', 'xh',
|
||||||
'co', 'ca', 'cy', 'cs', 'ka', 'kk', 'sr', 'sq', 'ko', 'kn', 'km', 'kl', 'ks',
|
'co', 'ca', 'cy', 'cs', 'ka', 'kk', 'sr', 'sq', 'ko', 'kn', 'km', 'kl', 'ks',
|
||||||
'si', 'sh', 'so', 'sn', 'ku', 'sl', 'ky', 'sg', 'sd', 'yo', 'de', 'da', 'dz',
|
'si', 'sh', 'so', 'sn', 'ku', 'sl', 'ky', 'sg', 'sd', 'yo', 'de', 'da', 'dz',
|
||||||
'la', 'ln', 'lo', 'tt', 'tr', 'ts', 'lv', 'to', 'lt', 'tk', 'th', 'ti', 'tg',
|
'la', 'ln', 'lo', 'tt', 'tr', 'ts', 'lv', 'to', 'lt', 'tk', 'th', 'ti', 'tg',
|
||||||
'te', 'ta', 'aa', 'ab', 'uk', 'af', 'vi', 'is', 'am', 'it', 'iw', 'vo', 'ik',
|
'te', 'ta', 'aa', 'ab', 'uk', 'af', 'vi', 'is', 'am', 'it', 'iw', 'vo', 'ik',
|
||||||
'ar', 'in', 'ay', 'az', 'ie', 'qu', 'st', 'tw')
|
'ar', 'in', 'ay', 'az', 'ie', 'qu', 'st', 'tw')
|
||||||
|
|
||||||
def oxdb_makedir(folder):
|
def oxdb_makedir(folder):
|
||||||
|
@ -216,3 +216,4 @@ def oxdb_makedir(folder):
|
||||||
except os.error, e:
|
except os.error, e:
|
||||||
if e.errno != errno.EEXIST or not os.path.isdir(folder):
|
if e.errno != errno.EEXIST or not os.path.isdir(folder):
|
||||||
raise
|
raise
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue