From 1ccb0dae44e11a3420a1c4fbe9129e347dd9375a Mon Sep 17 00:00:00 2001 From: David Read Date: Tue, 3 Nov 2015 22:12:49 +0000 Subject: [PATCH] A few more PEP8 changes taken from #174. --- ckanext/harvest/logic/action/delete.py | 9 ++------- ckanext/harvest/logic/action/update.py | 1 - ckanext/harvest/logic/validators.py | 5 ++--- 3 files changed, 4 insertions(+), 11 deletions(-) diff --git a/ckanext/harvest/logic/action/delete.py b/ckanext/harvest/logic/action/delete.py index 36eff6b..70e8c0a 100644 --- a/ckanext/harvest/logic/action/delete.py +++ b/ckanext/harvest/logic/action/delete.py @@ -6,8 +6,7 @@ log = logging.getLogger(__name__) def harvest_source_delete(context, data_dict): - ''' - Deletes an existing harvest source + '''Deletes an existing harvest source This method just proxies the request to package_delete, which will delete the actual harvest type dataset and the @@ -15,10 +14,6 @@ def harvest_source_delete(context, data_dict): :param id: the name or id of the harvest source to delete :type id: string - - :returns: the newly created harvest source - :rtype: dictionary - ''' log.info('Deleting harvest source: %r', data_dict) @@ -28,7 +23,7 @@ def harvest_source_delete(context, data_dict): if context.get('clear_source', False): - # We need the id, the name won't work + # We need the id. The name won't work. package_dict = p.toolkit.get_action('package_show')(context, data_dict) p.toolkit.get_action('harvest_source_clear')( diff --git a/ckanext/harvest/logic/action/update.py b/ckanext/harvest/logic/action/update.py index b51f37f..bd06d2c 100644 --- a/ckanext/harvest/logic/action/update.py +++ b/ckanext/harvest/logic/action/update.py @@ -91,7 +91,6 @@ def harvest_source_clear(context, data_dict): :param id: the id of the harvest source to clear :type id: string - ''' check_access('harvest_source_clear', context, data_dict) diff --git a/ckanext/harvest/logic/validators.py b/ckanext/harvest/logic/validators.py index 5299273..5ce079b 100644 --- a/ckanext/harvest/logic/validators.py +++ b/ckanext/harvest/logic/validators.py @@ -68,7 +68,6 @@ def harvest_source_url_validator(key, data, errors, context): package_id = data.get(key[:-1] + ("id",)) new_url = _normalize_url(data[key]) - #pkg_id = data.get(('id',),'') q = model.Session.query(model.Package.url, model.Package.state) \ .filter(model.Package.type == DATASET_TYPE_NAME) @@ -89,7 +88,7 @@ def harvest_source_url_validator(key, data, errors, context): def harvest_source_type_exists(value, context): - #TODO: use new description interface + # TODO: use new description interface # Get all the registered harvester types available_types = [] @@ -153,7 +152,7 @@ def harvest_source_extra_validator(key, data, errors, context): extra_data, extra_errors = validate(data.get(key, {}), extra_schema) for key in extra_data.keys(): - #only allow keys that appear in at least one harvester + # only allow keys that appear in at least one harvester if key not in all_extra_fields: extra_data.pop(key)