r227 - in trunk: . sources sources/trac sources/trac/0.11 sources/trac/0.11/userprefshook

roh at daksha.openmoko.org roh at daksha.openmoko.org
Fri May 2 23:29:15 CEST 2008


Author: roh
Date: 2008-05-02 21:29:15 +0000 (Fri, 02 May 2008)
New Revision: 227

Added:
   trunk/sources/
   trunk/sources/trac/
   trunk/sources/trac/0.11/
   trunk/sources/trac/0.11/setup.py
   trunk/sources/trac/0.11/userprefshook/
   trunk/sources/trac/0.11/userprefshook/__init__.py
   trunk/sources/trac/0.11/userprefshook/filter.py
   trunk/sources/trac/user_prefs_hook_plugin/
Log:
- add user_prefs_hook_plugin to call our sync scripts in case of changes


Added: trunk/sources/trac/0.11/setup.py
===================================================================
--- trunk/sources/trac/0.11/setup.py	                        (rev 0)
+++ trunk/sources/trac/0.11/setup.py	2008-05-02 21:29:15 UTC (rev 227)
@@ -0,0 +1,28 @@
+#!/usr/bin/env python
+# -*- coding: iso-8859-1 -*-
+
+from setuptools import setup
+
+setup(
+    name = 'TracUserPrefsHook',
+    version = '0.1',
+    packages = ['userprefshook'],
+    #package_data={ 'delegatedwiki' : [ 'templates/*.cs' ] },
+    author = "Joachim Steiger",
+    author_email = "roh at openmoko.org",
+    description = "Make the Trac user preferences call a external script on change.",
+    long_description = "",
+    license = "BSD",
+    keywords = "trac plugin prefs",
+    url = "http://",
+    classifiers = [
+        'Framework :: Trac',
+    ],
+
+    entry_points = {
+        'trac.plugins': [
+            'userprefshook.filter = userprefshook.filter',
+        ],
+    },
+)
+

Added: trunk/sources/trac/0.11/userprefshook/__init__.py
===================================================================
--- trunk/sources/trac/0.11/userprefshook/__init__.py	                        (rev 0)
+++ trunk/sources/trac/0.11/userprefshook/__init__.py	2008-05-02 21:29:15 UTC (rev 227)
@@ -0,0 +1 @@
+

Added: trunk/sources/trac/0.11/userprefshook/filter.py
===================================================================
--- trunk/sources/trac/0.11/userprefshook/filter.py	                        (rev 0)
+++ trunk/sources/trac/0.11/userprefshook/filter.py	2008-05-02 21:29:15 UTC (rev 227)
@@ -0,0 +1,17 @@
+import os
+from trac.core import *
+from trac.web.api import IRequestFilter
+
+class UserPrefsHookModule(Component):
+
+    implements(IRequestFilter)
+
+    def pre_process_request(self, req, handler):
+        if req.path_info == '/prefs' and req.method == 'POST':
+#            self.log.info('invoking PRE /bin/touch req.path_info = %s req.method = %s req.args = %s' % (req.path_info, req.method, req.args))
+            self.log.info('saving user prefs -> calling hook /var/www/bin/mail_fullname_sync/run.sh');
+            os.system("/var/www/bin/mail_fullname_sync/run.sh ")
+        return handler
+
+    def post_process_request(self, req, template, data, content_type):
+        return (template, data, content_type)





More information about the webdesign-commitlog mailing list