migrate to new config

This commit is contained in:
j 2012-01-10 15:39:22 +05:30
parent 887f09464b
commit 2b8e2e8219

View file

@ -136,11 +136,15 @@ def item_data(data):
value = value.replace('\r\n', '\n').strip()
d[{
u'id': u'oldId',
u'categories': u'category',
u'categories': u'topic',
u'source': u'project',
u'collection': u'source',
u'languages': u'language',
}.get(key, key)] = value
if 'director' in d:
d['director'] = unicode(d['director']).strip().split(', ')
d['director'] = unicode(d['director']).replace(' and ', ', ').strip().split(', ')
d['director'] = filter(lambda x: x.strip().lower() not in ('none', 'n/a', '', 'various'),
d['director'])
for key in ('layers', 'duration', 'size', 'public'):
if key in d:
del d[key]