[ckan-changes] commit/ckanext-harvest: amercader: Add support for config options in CLI

Bitbucket commits-noreply at bitbucket.org
Mon Jun 13 14:56:29 UTC 2011


1 new changeset in ckanext-harvest:

http://bitbucket.org/okfn/ckanext-harvest/changeset/3dd4cc85516a/
changeset:   3dd4cc85516a
user:        amercader
date:        2011-06-13 16:56:19
summary:     Add support for config options in CLI
affected #:  1 file (152 bytes)

--- a/ckanext/harvest/commands/harvester.py	Thu Jun 09 11:35:58 2011 +0200
+++ b/ckanext/harvest/commands/harvester.py	Mon Jun 13 15:56:19 2011 +0100
@@ -116,22 +116,27 @@
             print 'Please provide a source type'
             sys.exit(1)
         if len(self.args) >= 4:
-            active = not(self.args[3].lower() == 'false' or \
-                    self.args[3] == '0')
+            config = unicode(self.args[3])
+        else:
+            config = None
+        if len(self.args) >= 5:
+            active = not(self.args[4].lower() == 'false' or \
+                    self.args[4] == '0')
         else:
             active = True
-        if len(self.args) >= 5:
-            user_id = unicode(self.args[4])
+        if len(self.args) >= 6:
+            user_id = unicode(self.args[5])
         else:
             user_id = u''
-        if len(self.args) >= 6:
-            publisher_id = unicode(self.args[5])
+        if len(self.args) >= 7:
+            publisher_id = unicode(self.args[6])
         else:
             publisher_id = u''
         try:
             source = create_harvest_source({
                     'url':url,
                     'type':type,
+                    'config':config,
                     'active':active,
                     'user_id':user_id,
                     'publisher_id':publisher_id})

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

--

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