~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/transport/http/wsgi.py

(Marius Kruger) Update the wsgi bindings to load plugins and enable
        logging (optional)

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
from bzrlib.urlutils import local_path_to_url
28
28
    
29
29
 
30
 
def make_app(root, prefix, path_var='REQUEST_URI', readonly=True):
 
30
def make_app(root, prefix, path_var='REQUEST_URI', readonly=True,
 
31
    load_plugins=True, enable_logging=True):
31
32
    """Convenience function to construct a WSGI bzr smart server.
32
33
    
33
34
    :param root: a local path that requests will be relative to.
39
40
        base_transport = get_transport('readonly+' + local_url)
40
41
    else:
41
42
        base_transport = get_transport(local_url)
 
43
    if load_plugins:
 
44
        from bzrlib.plugin import load_plugins
 
45
        load_plugins()
 
46
    if enable_logging:
 
47
        import bzrlib.trace
 
48
        bzrlib.trace.enable_default_logging()
42
49
    app = SmartWSGIApp(base_transport, prefix)
43
50
    app = RelpathSetter(app, '', path_var)
44
51
    return app