[ckan-changes] commit/ckanext-harvest: 2 new changesets

Bitbucket commits-noreply at bitbucket.org
Fri Jul 29 10:31:13 UTC 2011


2 new changesets in ckanext-harvest:

http://bitbucket.org/okfn/ckanext-harvest/changeset/f41fee725c07/
changeset:   f41fee725c07
user:        amercader
date:        2011-07-29 11:47:55
summary:     Added tag ckanext-harvest-0.1 for changeset 9bc6d9d11f17
affected #:  1 file (61 bytes)

--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/.hgtags	Fri Jul 29 10:47:55 2011 +0100
@@ -0,0 +1,1 @@
+9bc6d9d11f17730276a277dc25fdb1d400242fd5 ckanext-harvest-0.1


http://bitbucket.org/okfn/ckanext-harvest/changeset/cf83d4846e1d/
changeset:   cf83d4846e1d
user:        amercader
date:        2011-07-29 12:31:03
summary:     Make harvesters work with latest ckan release
affected #:  2 files (61 bytes)

--- a/ckanext/harvest/harvesters/base.py	Fri Jul 29 10:47:55 2011 +0100
+++ b/ckanext/harvest/harvesters/base.py	Fri Jul 29 11:31:03 2011 +0100
@@ -122,15 +122,17 @@
             package_dict['tags'] = tags
 
             # Check if package exists
-            context.update({'id':package_dict['id']})
+            data_dict = {}
+            data_dict['id'] = package_dict['id']
             try:
-                existing_package_dict = package_show(context)
+                existing_package_dict = package_show(context, data_dict)
                 # Check modified date
                 if not 'metadata_modified' in package_dict or \
                    package_dict['metadata_modified'] > existing_package_dict.get('metadata_modified'):
                     log.info('Package with GUID %s exists and needs to be updated' % harvest_object.guid)
                     # Update package
-                    updated_package = package_update_rest(package_dict, context)
+                    context.update({'id':package_dict['id']})
+                    updated_package = package_update_rest(context, package_dict)
 
                     harvest_object.package_id = updated_package['id']
                     harvest_object.save()
@@ -139,13 +141,12 @@
 
             except NotFound:
                 # Package needs to be created
-                del context['id']
 
                 # Check if name has not already been used
                 package_dict['name'] = self._check_name(package_dict['name'])
 
                 log.info('Package with GUID %s does not exist, let\'s create it' % harvest_object.guid)
-                new_package = package_create_rest(package_dict, context)
+                new_package = package_create_rest(context, package_dict)
                 harvest_object.package_id = new_package['id']
                 harvest_object.save()
 


--- a/setup.py	Fri Jul 29 10:47:55 2011 +0100
+++ b/setup.py	Fri Jul 29 11:31:03 2011 +0100
@@ -1,7 +1,7 @@
 from setuptools import setup, find_packages
 import sys, os
 
-version = '0.1'
+version = '0.2'
 
 setup(
 	name='ckanext-harvest',

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