[ckan-changes] commit/ckanext-stats: dread: [setup]: Move plugin setup to plugin.py. Removes inherent dependency on ckan to even run setup.py.

Bitbucket commits-noreply at bitbucket.org
Tue May 17 14:28:01 UTC 2011


1 new changeset in ckanext-stats:

http://bitbucket.org/okfn/ckanext-stats/changeset/dd72eee95413/
changeset:   r11:dd72eee95413
user:        dread
date:        2011-05-17 16:27:13
summary:     [setup]: Move plugin setup to plugin.py. Removes inherent dependency on ckan to even run setup.py.
affected #:  3 files (2.2 KB)

--- a/ckanext/stats/__init__.py	Tue Feb 15 13:05:07 2011 +0000
+++ b/ckanext/stats/__init__.py	Tue May 17 15:27:13 2011 +0100
@@ -9,34 +9,3 @@
 '''
 __version__ = '0.1'
 
-import os
-from logging import getLogger
-
-from ckan.plugins import implements, SingletonPlugin
-from ckan.plugins import IRoutes, IConfigurer
-
-log = getLogger(__name__)
-
-class StatsPlugin(SingletonPlugin):
-    '''Stats plugin.'''
-
-    implements(IRoutes, inherit=True)
-    implements(IConfigurer, inherit=True)
-
-    def after_map(self, map):
-        map.connect('stats', '/stats',
-            controller='ckanext.stats.controller:StatsController',
-            action='index')
-        map.connect('stats_action', '/stats/{action}',
-            controller='ckanext.stats.controller:StatsController')
-        return map
-
-    def update_config(self, config):
-        here = os.path.dirname(__file__)
-        rootdir = os.path.dirname(os.path.dirname(here))
-        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	Tue Feb 15 13:05:07 2011 +0000
+++ b/setup.py	Tue May 17 15:27:13 2011 +0100
@@ -26,6 +26,6 @@
 	"""
         [ckan.plugins]
 	# Add plugins here, eg
-	stats=ckanext.stats:StatsPlugin
+	stats=ckanext.stats.plugin:StatsPlugin
 	""",
 )

Repository URL: https://bitbucket.org/okfn/ckanext-stats/

--

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