|
From: SVN c. m. f. t. SWORD-A. p. <swo...@li...> - 2012-01-22 18:04:30
|
Revision: 459
http://sword-app.svn.sourceforge.net/sword-app/?rev=459&view=rev
Author: richard-jones
Date: 2012-01-22 18:04:24 +0000 (Sun, 22 Jan 2012)
Log Message:
-----------
allow entry document object to be retrieved from deposit request
Modified Paths:
--------------
sss/branches/sss-2/sss/core.py
Modified: sss/branches/sss-2/sss/core.py
===================================================================
--- sss/branches/sss-2/sss/core.py 2012-01-22 17:09:24 UTC (rev 458)
+++ sss/branches/sss-2/sss/core.py 2012-01-22 18:04:24 UTC (rev 459)
@@ -187,6 +187,8 @@
if self.parsed:
for element in self.dom.getchildren():
+ if isinstance(element, etree._Comment):
+ continue
field = self._canonical_tag(element.tag)
ssslog.debug("Attempting to intepret field: '%s'" % field)
if field == "atom_id" and element.text is not None:
@@ -649,8 +651,15 @@
self.content_type = "application/octet-stream"
self.content = None
self.atom = None
+ self.entry_document = None
self.filename = "unnamed.file"
self.too_large = False
+
+ def get_entry_document(self):
+ if self.entry_document is None:
+ if self.atom is not None:
+ self.entry_document = EntryDocument(xml_source=self.atom)
+ return self.entry_document
class DepositResponse(object):
"""
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|