[Erp5-report] r29823 - /erp5/trunk/products/ERP5/interfaces/uploadable.py
nobody at svn.erp5.org
nobody at svn.erp5.org
Mon Oct 19 20:49:27 CEST 2009
Author: jp
Date: Mon Oct 19 20:49:27 2009
New Revision: 29823
URL: http://svn.erp5.org?rev=29823&view=rev
Log:
Added updateContentFromURL method
Modified:
erp5/trunk/products/ERP5/interfaces/uploadable.py
Modified: erp5/trunk/products/ERP5/interfaces/uploadable.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/interfaces/uploadable.py?rev=29823&r1=29822&r2=29823&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/interfaces/uploadable.py [utf8] (original)
+++ erp5/trunk/products/ERP5/interfaces/uploadable.py [utf8] Mon Oct 19 20:49:27 2009
@@ -28,6 +28,7 @@
##############################################################################
from zope.interface import Interface
+MAX_REPEAT = 0 # XXX - this variable should be put somewhere else
class IUploadable(Interface):
"""
@@ -91,4 +92,23 @@
Returns the list of acceptable formats for upload
where format is an extension (ex. 'png') which can be
passed to IConvertable.convert or to IDownloadable.index_html
+ """
+
+ def updateContentFromURL(url=None, repeat=MAX_REPEAT, crawling_depth=0):
+ """
+ Download and update content of this document from the specified URL.
+ If no url is specified, Document which support the IUrlGetter
+ interface use the Url of the document itself.
+
+ url -- optional URL to download the updated content from.
+ required whenever document does not implement IUrlGetter
+
+ repeat -- optional max number of retries for download
+
+ crawling_depth -- optional crawling depth for documents which
+ implement ICrawlable
+
+ NOTE: implementation is normally delegated to ContributionTool.
+
+ XXX - it is unclear whether MAX_REPEAT should be part of signature
"""
More information about the Erp5-report
mailing list