Added converter string_to_unicode_list to dcparser. Added handling of 'identifier...
authorMarek Stępniowski <marek@stepniowski.com>
Sat, 6 Sep 2008 13:34:44 +0000 (15:34 +0200)
committerMarek Stępniowski <marek@stepniowski.com>
Sat, 6 Sep 2008 13:34:44 +0000 (15:34 +0200)
lib/dcparser/converters.py
lib/dcparser/dcparser.py

index b49c417..85e4153 100644 (file)
@@ -30,6 +30,13 @@ def str_to_unicode(value, previous):
     return unicode(value)
 
 
+def str_to_unicode_list(value, previous):
+    if previous is None:
+        previous = []
+    previous.append(str_to_unicode(value))
+    return previous
+
+
 def str_to_person(value, previous):
     comma_count = value.count(',')
     
index 5df7700..7d43862 100644 (file)
@@ -57,6 +57,8 @@ class BookInfo(object):
         DC('publisher')      : ('publisher', converters.str_to_unicode),
         DC('source')         : ('source_name', converters.str_to_unicode),
         DC('source.URL')     : ('source_url', converters.str_to_unicode),
+        DC('identifier.url') : ('url', converters.str_to_unicode),
+        DC('relation.hasPart') : ('parts', converters.str_to_unicode_list),
     }
 
     @classmethod