[z3-checkins] r36877 - in z3/deliverance/DeliveranceVHoster/trunk: . dvhoster dvhoster/controllers dvhoster/public dvhoster/templates dvhoster/tests

ianb at codespeak.net ianb at codespeak.net
Wed Jan 17 16:14:23 CET 2007


Author: ianb
Date: Wed Jan 17 16:14:20 2007
New Revision: 36877

Removed:
   z3/deliverance/DeliveranceVHoster/trunk/dvhoster/controllers/
   z3/deliverance/DeliveranceVHoster/trunk/dvhoster/helpers.py
   z3/deliverance/DeliveranceVHoster/trunk/dvhoster/public/
   z3/deliverance/DeliveranceVHoster/trunk/dvhoster/routing.py
   z3/deliverance/DeliveranceVHoster/trunk/dvhoster/templates/
   z3/deliverance/DeliveranceVHoster/trunk/dvhoster/tests/
Modified:
   z3/deliverance/DeliveranceVHoster/trunk/dvhoster/dispatcher.py
   z3/deliverance/DeliveranceVHoster/trunk/dvhoster/wsgiapp.py
   z3/deliverance/DeliveranceVHoster/trunk/setup.cfg
   z3/deliverance/DeliveranceVHoster/trunk/supervisor.conf
Log:
Got rid of all the Pylons stuff

Modified: z3/deliverance/DeliveranceVHoster/trunk/dvhoster/dispatcher.py
==============================================================================
--- z3/deliverance/DeliveranceVHoster/trunk/dvhoster/dispatcher.py	(original)
+++ z3/deliverance/DeliveranceVHoster/trunk/dvhoster/dispatcher.py	Wed Jan 17 16:14:20 2007
@@ -21,8 +21,7 @@
 
 class DeliveranceDispatcher(object):
 
-    def __init__(self, pylons_app, app_conf):
-        self.pylons_app = pylons_app
+    def __init__(self, app_conf):
         data_dir = app_conf['data_dir']
         self.provider = DataProvider(data_dir)
         self.rewrite_links = asbool(app_conf.get('rewrite_links', True))
@@ -39,9 +38,6 @@
             environ, with_query_string=False,
             path_info='')
         path_info = norm_path(environ.get('PATH_INFO', ''))
-        if path_info.startswith('/_deliverance'):
-            path_info_pop(environ)
-            return self.pylons_app(environ, start_response)
         if (not domain_info.initialized
             or not domain_info.remote
             or not domain_info.theme_uri):

Deleted: /z3/deliverance/DeliveranceVHoster/trunk/dvhoster/helpers.py
==============================================================================
--- /z3/deliverance/DeliveranceVHoster/trunk/dvhoster/helpers.py	Wed Jan 17 16:14:20 2007
+++ (empty file)
@@ -1,9 +0,0 @@
-"""
-Helper functions
-
-All names available in this module will be available under the Pylons h object.
-"""
-from webhelpers import *
-from webhelpers.util import *
-from pylons.helpers import *
-

Deleted: /z3/deliverance/DeliveranceVHoster/trunk/dvhoster/routing.py
==============================================================================
--- /z3/deliverance/DeliveranceVHoster/trunk/dvhoster/routing.py	Wed Jan 17 16:14:20 2007
+++ (empty file)
@@ -1,10 +0,0 @@
-"""Setup your Routes options here"""
-import os
-from routes import Mapper
-
-def make_map(global_conf={}, app_conf={}):
-    root_path = os.path.dirname(os.path.abspath(__file__))
-    map = Mapper(directory=os.path.join(root_path, 'controllers'))
-    map.connect(':controller/:action/:id')
-    map.connect('', controller='index')
-    return map

Modified: z3/deliverance/DeliveranceVHoster/trunk/dvhoster/wsgiapp.py
==============================================================================
--- z3/deliverance/DeliveranceVHoster/trunk/dvhoster/wsgiapp.py	(original)
+++ z3/deliverance/DeliveranceVHoster/trunk/dvhoster/wsgiapp.py	Wed Jan 17 16:14:20 2007
@@ -1,68 +1,26 @@
-import os
-
-from paste import httpexceptions
 from paste.cascade import Cascade
 from paste.urlparser import StaticURLParser
-from paste.registry import RegistryManager
-from paste.deploy.config import ConfigMiddleware
+#from paste.deploy.config import ConfigMiddleware
 from paste.deploy.converters import asbool
 from paste.recursive import RecursiveMiddleware
 from wsgifilter import proxyapp
-
-import pylons.wsgiapp
-import pylons.config
-from pylons.error import error_template
-from pylons.middleware import ErrorHandler, ErrorDocuments, StaticJavascripts, error_mapper
-
-import dvhoster.helpers
-from dvhoster.routing import make_map
+from paste.exceptions.errormiddleware import ErrorMiddleware
 
 from dvhoster.dispatcher import DeliveranceDispatcher
 
-def load_environment(global_conf={}, app_conf={}):
-    map = make_map(global_conf, app_conf)
-    root_path = os.path.dirname(os.path.abspath(__file__))
-    paths = {'root_path': root_path,
-             'controllers': os.path.join(root_path, 'controllers'),
-             'templates': [os.path.join(root_path, 'templates')],
-             'static_files': os.path.join(root_path, 'public')
-             }
-    myghty = dict(log_errors=True)
-    return pylons.config.Config(myghty, map, paths)
-
-class Globals(object):
-    def __init__(self, global_conf, app_conf, **extra):
-        pass
-
-def make_app(global_conf, full_stack=True, **app_conf):
+def make_app(global_conf, **app_conf):
     """Create a WSGI application and return it"""
-    # Load our Pylons configuration defaults
-    config = load_environment(global_conf, app_conf)
-    config.init_app(global_conf, app_conf, package='dvhoster')
-        
-    # Load our default Pylons WSGI app and make g available
-    app = pylons.wsgiapp.PylonsApp(config, helpers=dvhoster.helpers, g=Globals)
-    g = app.globals
-    app = ConfigMiddleware(app, {'app_conf':app_conf,
-        'global_conf':global_conf})
-    
-    # <-- YOUR MIDDLEWARE HERE
-        
-    # Build the rest of the stack, see a full template for more details
-    if asbool(full_stack):
-        app = httpexceptions.make_middleware(app, global_conf)
-        app = ErrorHandler(app, global_conf, error_template=error_template, **config.errorware)
-    
-    static_app = StaticURLParser(config.paths['static_files'])
-    javascripts_app = StaticJavascripts()
-    app = Cascade([static_app, javascripts_app, app])
-    app = DeliveranceDispatcher(app, app_conf)
+    app = DeliveranceDispatcher(app_conf)
     app = RecursiveMiddleware(app)
+    debug = app_conf['debug'] = asbool(app_conf.get('debug', global_conf.get('debug')))
     if asbool(app_conf.get('debug_headers')):
         app = proxyapp.DebugHeaders(app, show_body=asbool(app_conf.get('debug_bodies')))
-    app = RegistryManager(app)
-    if (asbool(full_stack)
-        and asbool(app_conf.get('debug', global_conf.get('debug')))):
+    if debug:
         from paste.evalexception import EvalException
         app = EvalException(app)
+    else:
+        folded_conf = global_conf.copy()
+        folded_conf.update(app_conf)
+        app = ErrorMiddleware(
+            app, global_conf=folded_conf)
     return app

Modified: z3/deliverance/DeliveranceVHoster/trunk/setup.cfg
==============================================================================
--- z3/deliverance/DeliveranceVHoster/trunk/setup.cfg	(original)
+++ z3/deliverance/DeliveranceVHoster/trunk/setup.cfg	Wed Jan 17 16:14:20 2007
@@ -16,8 +16,8 @@
 dest = docs/html
 
 # Add extra modules here separated with commas
-modules = ddemo
-title = Ddemo
+modules = dvhoster
+title = DeliveranceVHoster
 organization = Pylons
 
 settings = no_about=true

Modified: z3/deliverance/DeliveranceVHoster/trunk/supervisor.conf
==============================================================================
--- z3/deliverance/DeliveranceVHoster/trunk/supervisor.conf	(original)
+++ z3/deliverance/DeliveranceVHoster/trunk/supervisor.conf	Wed Jan 17 16:14:20 2007
@@ -31,12 +31,12 @@
 ;password=123                ; should be same as http_password if set
 ;prompt=mysupervisor         ; cmd line prompt (default "supervisor")
 
-[program:ddemo]
+[program:dvhoster]
 ;command=sh -c "exec paster serve development.ini"
 command=paster serve development.ini
 autostart=true
 autorestart=true
-logfile=./tmp/ddemo.log
+logfile=./tmp/dvhoster.log
 ;logfile_maxbytes=1MB        ; max # logfile bytes b4 rotation (default 50MB)
 ;logfile_backups=10          ; # of logfile backups (default 10)
 


More information about the z3-checkins mailing list