Permalink
Browse files

Reconstitue dc:date.Taken as dc:date_Taken

  • Loading branch information...
1 parent 635174e commit c2ff9f22dbf2089f1d40876c276b9cb965fc47ab @mortenf mortenf committed Oct 30, 2010
Showing with 17 additions and 0 deletions.
  1. +5 −0 planet/reconstitute.py
  2. +12 −0 tests/data/reconstitute/dc_date_taken.xml
View
@@ -279,6 +279,11 @@ def reconstitute(feed, entry):
date(xentry, 'updated', entry_updated(feed.feed, entry, time.gmtime()))
date(xentry, 'published', entry.get('published_parsed',None))
+ if entry.has_key('dc_date.taken'):
+ date_Taken = createTextElement(xentry, '%s:%s' % ('dc','date_Taken'), '%s' % entry.get('dc_date.taken', None))
+ date_Taken.setAttribute('xmlns:%s' % 'dc', 'http://purl.org/dc/elements/1.1/')
+ xentry.appendChild(date_Taken)
+
for tag in entry.get('tags',[]):
category(xentry, tag)
@@ -0,0 +1,12 @@
+<!--
+Description: Dublin Core date: Taken (as used by e.g. flickr)
+Expect: dc_date_taken == '2010-10-15T16:10:05-01:00'
+-->
+
+<feed xmlns="http://www.w3.org/2005/Atom"
+ xmlns:dc="http://purl.org/dc/elements/1.1/">
+ <entry>
+ <dc:date.Taken>2010-10-15T16:10:05-01:00</dc:date.Taken>
+ </entry>
+</feed>
+

0 comments on commit c2ff9f2

Please sign in to comment.