Mercurial > hg
comparison hgwebdir.cgi @ 5566:d74fc8dec2b4
Less indirection in the WSGI web interface. This simplifies some code, and makes it more compliant with WSGI.
author | Dirkjan Ochtman <dirkjan@ochtman.nl> |
---|---|
date | Fri, 30 Nov 2007 18:23:18 +0100 |
parents | 79279b5583c6 |
children | b913d3aacddc |
comparison
equal
deleted
inserted
replaced
5565:feac5b0bf9ba | 5566:d74fc8dec2b4 |
---|---|
20 # | 20 # |
21 #import os | 21 #import os |
22 #os.environ["HGENCODING"] = "UTF-8" | 22 #os.environ["HGENCODING"] = "UTF-8" |
23 | 23 |
24 from mercurial.hgweb.hgwebdir_mod import hgwebdir | 24 from mercurial.hgweb.hgwebdir_mod import hgwebdir |
25 from mercurial.hgweb.request import wsgiapplication | |
26 import mercurial.hgweb.wsgicgi as wsgicgi | 25 import mercurial.hgweb.wsgicgi as wsgicgi |
27 | 26 |
28 # The config file looks like this. You can have paths to individual | 27 # The config file looks like this. You can have paths to individual |
29 # repos, collections of repos in a directory tree, or both. | 28 # repos, collections of repos in a directory tree, or both. |
30 # | 29 # |
42 # Then repos will list as bar and quux/baz. | 41 # Then repos will list as bar and quux/baz. |
43 # | 42 # |
44 # Alternatively you can pass a list of ('virtual/path', '/real/path') tuples | 43 # Alternatively you can pass a list of ('virtual/path', '/real/path') tuples |
45 # or use a dictionary with entries like 'virtual/path': '/real/path' | 44 # or use a dictionary with entries like 'virtual/path': '/real/path' |
46 | 45 |
47 def make_web_app(): | 46 application = hgwebdir('hgweb.config') |
48 return hgwebdir("hgweb.config") | 47 wsgicgi.launch(application) |
49 | |
50 wsgicgi.launch(wsgiapplication(make_web_app)) |