[ckan-changes] commit/ckanext-inspire: amercader: Add attribute to force the import of a harvest object even the reference date has not changed

Bitbucket commits-noreply at bitbucket.org
Tue May 10 16:10:15 UTC 2011


1 new changeset in ckanext-inspire:

http://bitbucket.org/okfn/ckanext-inspire/changeset/09892e10b02d/
changeset:   r26:09892e10b02d
user:        amercader
date:        2011-05-10 18:10:04
summary:     Add attribute to force the import of a harvest object even the reference date has not changed
affected #:  1 file (206 bytes)

--- a/ckanext/inspire/harvesters.py	Tue May 10 13:23:14 2011 +0100
+++ b/ckanext/inspire/harvesters.py	Tue May 10 17:10:04 2011 +0100
@@ -52,6 +52,8 @@
 
     validator=None
 
+    force_import = False
+
     def _is_wms(self,url):
         try:
             s = wms.WebMapService(url)
@@ -203,8 +205,14 @@
             # Use reference date instead of content to determine if the package
             # needs to be updated
             if last_harvested_object.reference_date < self.obj.reference_date \
-                or last_harvested_object.reference_date is None:
-                log.info('Package for %s needs to be created or updated' % gemini_guid)
+                or last_harvested_object.reference_date is None \
+                or self.force_import:
+
+                if self.force_import:
+                    log.info('Import forced for package %s' % gemini_guid)
+                else:
+                    log.info('Package for %s needs to be created or updated' % gemini_guid)
+
                 package = last_harvested_object.package
             else:
                 if last_harvested_object.content != self.obj.content:

Repository URL: https://bitbucket.org/okfn/ckanext-inspire/

--

This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.




More information about the ckan-changes mailing list