Mercurial > hg > hgpaste
annotate hgpaste/factory.py @ 8:49e931b5c8e2 default tip
encode to bytes for mercurial
| author | Jeff Hammel <k0scist@gmail.com> |
|---|---|
| date | Tue, 24 Nov 2020 08:53:32 -0800 |
| parents | 0dc878f8a15f |
| children |
| rev | line source |
|---|---|
| 5 | 1 __all__ = ['wsgi_app', 'make_app'] |
| 2 | |
| 7 | 3 |
| 5 | 4 def wsgi_app(config_file): |
| 5 """wsgi application""" | |
|
8
49e931b5c8e2
encode to bytes for mercurial
Jeff Hammel <k0scist@gmail.com>
parents:
7
diff
changeset
|
6 |
|
49e931b5c8e2
encode to bytes for mercurial
Jeff Hammel <k0scist@gmail.com>
parents:
7
diff
changeset
|
7 if isinstance(config_file, str): |
|
49e931b5c8e2
encode to bytes for mercurial
Jeff Hammel <k0scist@gmail.com>
parents:
7
diff
changeset
|
8 # Encode to bytes for mercurial API |
|
49e931b5c8e2
encode to bytes for mercurial
Jeff Hammel <k0scist@gmail.com>
parents:
7
diff
changeset
|
9 config_file = config_file.encode() |
|
0
047850e4bb4c
initial version of hgpaste, http://www.coactivate.org/projects/topp-engineering/lists/topp-engineering-discussion/archive/2009/09/1252293278946
k0s <k0scist@gmail.com>
parents:
diff
changeset
|
10 from mercurial import demandimport; demandimport.enable() |
|
047850e4bb4c
initial version of hgpaste, http://www.coactivate.org/projects/topp-engineering/lists/topp-engineering-discussion/archive/2009/09/1252293278946
k0s <k0scist@gmail.com>
parents:
diff
changeset
|
11 from mercurial.hgweb.hgwebdir_mod import hgwebdir |
|
047850e4bb4c
initial version of hgpaste, http://www.coactivate.org/projects/topp-engineering/lists/topp-engineering-discussion/archive/2009/09/1252293278946
k0s <k0scist@gmail.com>
parents:
diff
changeset
|
12 application = hgwebdir(config_file) |
| 7 | 13 return application |
| 14 | |
| 5 | 15 |
| 16 def make_app(global_conf, config_file): | |
| 17 """make an app for paster""" | |
| 18 return wsgi_app(config_file) |
