Eric Larson avatar Eric Larson committed 5db5f38

Initial commit

Comments (0)

Files changed (2)

+import cherrypy
+from cherrypy import Tool
+from cherrypy._cprequest import hookpoints
+
+
+class SimpleTool(Tool):
+
+    def __init__(self, point=None, callable=None):
+        self._point = point
+        self._name = None
+        self._priority = 50
+        self._setargs()
+
+    def _setup(self):
+        conf = self._merged_args()
+        hooks = cherrypy.request.hooks
+        for hookpoint in hookpoints:
+            if hasattr(self, hookpoint):
+                func = getattr(self, hookpoint)
+                p = getattr(func, 'priority', self._priority)
+                hooks.attach(hookpoint, func, priority=p, **conf)
+
+
+class BaseHandler(object):
+
+    exposed = True
+
+    def _cp_dispatch(self, vpath):
+        try:
+            dispatcher = self.dispatch
+        except AttributeError:
+            return
+        try:
+            return dispatcher(vpath)
+        except cherrypy.HTTPRedirect:
+            # pass redirections as usual
+            raise
+from setuptools import setup
+
+
+setup_params = dict(
+    name='Alamode',
+    author='Eric Larson',
+    author_email='eric@ionrock.org',
+    url='http://bitbucket.org/elarson/alamode',
+    version='0.8',
+    py_modules=['alamode'],
+    install_requires=[
+        'cherrypy',
+    ]
+)
+
+if __name__ == '__main__':
+    setup(**setup_params)
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.