[ckan-changes] commit/ckanext-admin: rgrp: [refactor][s]: move plugin into plugin.py to avoid issues when doing installation stuff (have plugin in __init__ means code is triggered as part of any pip or easy_install operation).
Bitbucket
commits-noreply at bitbucket.org
Fri Sep 30 22:28:17 UTC 2011
1 new changeset in ckanext-admin:
http://bitbucket.org/okfn/ckanext-admin/changeset/3f444753edd3/
changeset: 3f444753edd3
user: rgrp
date: 2011-10-01 00:28:10
summary: [refactor][s]: move plugin into plugin.py to avoid issues when doing installation stuff (have plugin in __init__ means code is triggered as part of any pip or easy_install operation).
affected #: 3 files (-1 bytes)
--- a/ckanext/admin/__init__.py Sun Jun 12 14:30:26 2011 +0000
+++ b/ckanext/admin/__init__.py Fri Sep 30 22:28:10 2011 +0000
@@ -11,38 +11,3 @@
import pkgutil
__path__ = pkgutil.extend_path(__path__, __name__)
-import os
-from logging import getLogger
-from ckan.plugins import implements, SingletonPlugin
-from ckan.plugins import IRoutes, IConfigurer
-# from formalchemy.ext.pylons import maps # routes generator
-
-log = getLogger(__name__)
-
-class AdminPlugin(SingletonPlugin):
- '''Admin plugin.
- '''
-
- implements(IRoutes, inherit=True)
- implements(IConfigurer, inherit=True)
-
- def after_map(self, map):
- map.connect('ckanadmin_index', '/ckan-admin',
- controller='ckanext.admin.controller:AdminController',
- action='index')
- map.connect('ckanadmin', '/ckan-admin/{action}',
- controller='ckanext.admin.controller:AdminController',
- )
- # TODO get admin controller working again #829
- # maps.admin_map(map, controller='admin', url='/admin/model')
- return map
-
- def update_config(self, config):
- rootdir = os.path.dirname(__file__)
- our_public_dir = os.path.join(rootdir, 'public')
- template_dir = os.path.join(rootdir, 'templates')
- config['extra_public_paths'] = ','.join([our_public_dir,
- config.get('extra_public_paths', '')])
- config['extra_template_paths'] = ','.join([template_dir,
- config.get('extra_template_paths', '')])
-
--- a/setup.py Sun Jun 12 14:30:26 2011 +0000
+++ b/setup.py Fri Sep 30 22:28:10 2011 +0000
@@ -25,6 +25,6 @@
"""
[ckan.plugins]
# Add plugins here, eg
- admin=ckanext.admin:AdminPlugin
+ admin=ckanext.admin.plugin:AdminPlugin
""",
)
Repository URL: https://bitbucket.org/okfn/ckanext-admin/
--
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