Merge pull request #183 from ckan/pep8-from-174

A few more PEP8 changes taken from #174
This commit is contained in:
David Read 2015-11-03 22:14:37 +00:00
commit 3d35814f3a
3 changed files with 4 additions and 11 deletions

View File

@ -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')(

View File

@ -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)

View File

@ -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)