Merge pull request #183 from ckan/pep8-from-174
A few more PEP8 changes taken from #174
This commit is contained in:
commit
3d35814f3a
|
@ -6,8 +6,7 @@ log = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
def harvest_source_delete(context, data_dict):
|
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,
|
This method just proxies the request to package_delete,
|
||||||
which will delete the actual harvest type dataset and the
|
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
|
:param id: the name or id of the harvest source to delete
|
||||||
:type id: string
|
:type id: string
|
||||||
|
|
||||||
:returns: the newly created harvest source
|
|
||||||
:rtype: dictionary
|
|
||||||
|
|
||||||
'''
|
'''
|
||||||
log.info('Deleting harvest source: %r', data_dict)
|
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):
|
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)
|
package_dict = p.toolkit.get_action('package_show')(context, data_dict)
|
||||||
|
|
||||||
p.toolkit.get_action('harvest_source_clear')(
|
p.toolkit.get_action('harvest_source_clear')(
|
||||||
|
|
|
@ -91,7 +91,6 @@ def harvest_source_clear(context, data_dict):
|
||||||
|
|
||||||
:param id: the id of the harvest source to clear
|
:param id: the id of the harvest source to clear
|
||||||
:type id: string
|
:type id: string
|
||||||
|
|
||||||
'''
|
'''
|
||||||
|
|
||||||
check_access('harvest_source_clear', context, data_dict)
|
check_access('harvest_source_clear', context, data_dict)
|
||||||
|
|
|
@ -68,7 +68,6 @@ def harvest_source_url_validator(key, data, errors, context):
|
||||||
package_id = data.get(key[:-1] + ("id",))
|
package_id = data.get(key[:-1] + ("id",))
|
||||||
|
|
||||||
new_url = _normalize_url(data[key])
|
new_url = _normalize_url(data[key])
|
||||||
#pkg_id = data.get(('id',),'')
|
|
||||||
|
|
||||||
q = model.Session.query(model.Package.url, model.Package.state) \
|
q = model.Session.query(model.Package.url, model.Package.state) \
|
||||||
.filter(model.Package.type == DATASET_TYPE_NAME)
|
.filter(model.Package.type == DATASET_TYPE_NAME)
|
||||||
|
|
Loading…
Reference in New Issue