~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2006-12-18 17:35:33 UTC
  • mfrom: (2190.1.7 bzr_http_fixes)
  • Revision ID: pqm@pqm.ubuntu.com-20061218173533-46a6cb3b1d08b8ab
(John Arbash Meinel) Implement bzr+http:// and update docs to indicate how to set it up.

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
from bzrlib.urlutils import local_path_to_url
27
27
    
28
28
 
29
 
def make_app(root, prefix, path_var):
 
29
def make_app(root, prefix, path_var, readonly=True):
30
30
    """Convenience function to construct a WSGI bzr smart server.
31
31
    
32
32
    :param root: a local path that requests will be relative to.
33
33
    :param prefix: See RelpathSetter.
34
34
    :param path_var: See RelpathSetter.
35
35
    """
36
 
    base_transport = get_transport('readonly+' + local_path_to_url(root))
 
36
    local_url = local_path_to_url(root)
 
37
    if readonly:
 
38
        base_transport = get_transport('readonly+' + local_url)
 
39
    else:
 
40
        base_transport = get_transport(local_url)
37
41
    app = SmartWSGIApp(base_transport)
38
42
    app = RelpathSetter(app, prefix, path_var)
39
43
    return app