From b838d56089a300653a370e10307faaf79e1efa5b Mon Sep 17 00:00:00 2001 From: Dominik Moritz Date: Tue, 25 Sep 2012 12:19:18 +0100 Subject: [PATCH] reformat and removed imports from ckan/ckan/lib/plugins.py --- ckan/lib/plugins.py | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/ckan/lib/plugins.py b/ckan/lib/plugins.py index 5acc733eeaf..691a4830689 100644 --- a/ckan/lib/plugins.py +++ b/ckan/lib/plugins.py @@ -78,7 +78,7 @@ def register_package_plugins(map): controller='package', action='read') map.connect('%s_action' % package_type, '/%s/{action}/{id}' % package_type, controller='package', - requirements=dict(action='|'.join(['edit', 'authz', 'history' ])) + requirements=dict(action='|'.join(['edit', 'authz', 'history'])) ) if package_type in _package_plugins: @@ -92,8 +92,6 @@ def register_package_plugins(map): _default_package_plugin = DefaultDatasetForm() - - def register_group_plugins(map): """ Register the various IGroupForm instances. @@ -138,7 +136,7 @@ def register_group_plugins(map): controller='group', action='read') map.connect('%s_action' % group_type, '/%s/{action}/{id}' % group_type, controller='group', - requirements=dict(action='|'.join(['edit', 'authz', 'history' ])) + requirements=dict(action='|'.join(['edit', 'authz', 'history'])) ) if group_type in _group_plugins: @@ -203,7 +201,6 @@ def history_template(self): """ return 'package/history.html' - def package_form(self): return 'package/new_package_form.html' @@ -215,7 +212,7 @@ def form_to_db_schema_options(self, options): If a context is provided, and it contains a schema, it will be returned. ''' - schema = options.get('context',{}).get('schema',None) + schema = options.get('context', {}).get('schema', None) if schema: return schema @@ -248,7 +245,7 @@ def db_to_form_schema_options(self, options): If a context is provided, and it contains a schema, it will be returned. ''' - schema = options.get('context',{}).get('schema',None) + schema = options.get('context', {}).get('schema', None) if schema: return schema return self.db_to_form_schema() @@ -273,11 +270,9 @@ def check_data_dict(self, data_dict, schema=None): raise dictization_functions.DataError(data_dict) def setup_template_variables(self, context, data_dict): - from pylons import config - authz_fn = logic.get_action('group_list_authz') c.groups_authz = authz_fn(context, data_dict) - data_dict.update({'available_only':True}) + data_dict.update({'available_only': True}) c.groups_available = authz_fn(context, data_dict) @@ -300,7 +295,6 @@ def setup_template_variables(self, context, data_dict): c.auth_for_change_state = False - class DefaultGroupForm(object): """ Provides a default implementation of the pluggable Group controller @@ -352,7 +346,6 @@ def edit_template(self): """ return 'group/edit.html' - def group_form(self): return 'group/new_group_form.html' @@ -364,7 +357,7 @@ def form_to_db_schema_options(self, options): If a context is provided, and it contains a schema, it will be returned. ''' - schema = options.get('context',{}).get('schema',None) + schema = options.get('context', {}).get('schema', None) if schema: return schema @@ -396,7 +389,7 @@ def db_to_form_schema_options(self, options): If a context is provided, and it contains a schema, it will be returned. ''' - schema = options.get('context',{}).get('schema',None) + schema = options.get('context', {}).get('schema', None) if schema: return schema return self.db_to_form_schema()