~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Alexander Belchenko
  • Date: 2006-12-19 08:26:36 UTC
  • mfrom: (2198 +trunk)
  • mto: This revision was merged to the branch mainline in revision 2204.
  • Revision ID: bialix@ukr.net-20061219082636-xbb55np3wnamva8t
merge bzr.dev

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