Commits

Alessandro Molina committed d836b78

Add support for tgext.pluggable

Comments (0)

Files changed (2)

tgext/scss/__init__.py

-from middleware import SCSSMiddleware
+from middleware import SCSSMiddleware
+
+def plugme(app_config, options):
+    def mount_scss_middleware(app):
+        return SCSSMiddleware(app)
+    app_config.register_hook('after_config', mount_scss_middleware)
+    return dict(appid='tgext.scss')

tgext/scss/middleware.py

     def __init__(self, app):
         self.app = app
         self.cache = {}
-        self.root_directory = os.path.normcase(os.path.abspath((config['pylons.paths']['static_files'])))
+        try:
+            self.root_directory = os.path.normcase(os.path.abspath((config['paths']['static_files'])))
+        except KeyError:
+            self.root_directory = os.path.normcase(os.path.abspath((config['pylons.paths']['static_files'])))            
 
     def convert(self, text):
         p = parser.Stylesheet(options=dict(compress=True, comments=False))