1. Thomas Lotze
  2. ophelia

Commits

Thomas Lotze  committed ef25df8

made the paste app factory an Application class method for reusability

  • Participants
  • Parent commits 24a0225
  • Branches default

Comments (0)

Files changed (2)

File ophelia/wsgi.py

View file
  • Ignore whitespace
     def __init__(self, options=None):
         self.options = options or {}
 
+    @classmethod
+    def paste_app_factory(cls, global_conf, **local_conf):
+        options = global_conf.copy()
+        options.update(local_conf)
+        options = dict((key.replace('-', '_'), value)
+                       for key, value in options.items())
+        return cls(options)
+
     def __call__(self, env, start_response):
         env = ophelia.util.Namespace(self.options, **env)
         path = env["PATH_INFO"].lstrip('/')

File setup.py

View file
  • Ignore whitespace
     ophelia-wsgiref = ophelia.wsgi:wsgiref_server
 
     [paste.app_factory]
-    main = ophelia.wsgi:paste_app_factory
+    main = ophelia.wsgi:Application.paste_app_factory
 """
 
 install_requires = [