cleanup whitespace

This commit is contained in:
j 2008-06-01 15:23:26 +02:00
parent f650112413
commit f56aab091e

View file

@ -2,7 +2,7 @@
# -*- coding: utf-8 -*-
# -*- Mode: Python; -*-
# 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
#
@ -33,7 +33,7 @@ def _in_known_oxdb_extensions(term):
if re.compile(reg, re.IGNORECASE).findall(term):
return True
return False
def oxdb_filenameUmlaute(string):
string = u"%s" % string
string = string.replace(u'ae', u'ä')
@ -43,7 +43,7 @@ def oxdb_filenameUmlaute(string):
string = string.replace(u'Oe', u'Ö')
string = string.replace(u'Ue', u'Ü')
return string
def oxdb_director(director):
director = os.path.basename(os.path.dirname(director))
director = director.replace('&', ', ').replace(' , ', ', ')
@ -80,7 +80,7 @@ def formatNumber(n, sep=','):
newn.extend(ln)
newn.reverse()
return "".join(newn)
'''
format runtime for stats
'''
@ -104,7 +104,7 @@ def oxdb_runtimeformat(runtime):
years = int(days / 365)
days = days % 365
return "%s years %s days %s hours %s minutes %s seconds" % (years, days, hours, minutes, seconds)
def oxdb_lengthformat(mseconds):
"""
Format mseconds in a nice way
@ -149,7 +149,7 @@ def oxdb_bitformat(number):
def oxdb_pixelformat(number):
return oxdb_format(number, 'pixel', 'px')
from htmlentitydefs import name2codepoint
@ -186,27 +186,27 @@ def imdb2oxdb(imdb):
if imdb.startswith('0x') or imdb.startswith('ox') :
return imdb
return "0x%06X" % int(imdb)
def oxdb2imdb(oxdb):
if len(oxdb) == 8:
return "%07d" % float(oxdb)
return oxdb
def trimString(string, length):
if len(string) > length:
string = string[:length - 13] + '...' + string[-10:]
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',
'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',
'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',
'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',
'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',
'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')
def oxdb_makedir(folder):
@ -216,3 +216,4 @@ def oxdb_makedir(folder):
except os.error, e:
if e.errno != errno.EEXIST or not os.path.isdir(folder):
raise