Show More
@@ -650,7 +650,16 b' class hgweb(object):' | |||
|
650 | 650 | raise Exception("suspicious path") |
|
651 | 651 | return p |
|
652 | 652 | |
|
653 |
def run(self |
|
|
653 | def run(self): | |
|
654 | if os.environ['GATEWAY_INTERFACE'][0:6] != "CGI/1.": | |
|
655 | raise RuntimeError("This function is only intended to be called while running as a CGI script.") | |
|
656 | import mercurial.hgweb.wsgicgi as wsgicgi | |
|
657 | from request import wsgiapplication | |
|
658 | def make_web_app(): | |
|
659 | return self.__class__(self.repo, self.reponame) | |
|
660 | wsgicgi.launch(wsgiapplication(make_web_app)) | |
|
661 | ||
|
662 | def run_wsgi(self, req): | |
|
654 | 663 | def header(**map): |
|
655 | 664 | header_file = cStringIO.StringIO(''.join(self.t("header", **map))) |
|
656 | 665 | msg = mimetools.Message(header_file, 0) |
@@ -20,6 +20,7 b' class hgwebdir(object):' | |||
|
20 | 20 | def cleannames(items): |
|
21 | 21 | return [(name.strip(os.sep), path) for name, path in items] |
|
22 | 22 | |
|
23 | self.origconfig = config | |
|
23 | 24 | self.motd = "" |
|
24 | 25 | self.repos_sorted = ('name', False) |
|
25 | 26 | if isinstance(config, (list, tuple)): |
@@ -46,7 +47,16 b' class hgwebdir(object):' | |||
|
46 | 47 | self.repos.append((name.lstrip(os.sep), repo)) |
|
47 | 48 | self.repos.sort() |
|
48 | 49 | |
|
49 |
def run(self |
|
|
50 | def run(self): | |
|
51 | if os.environ['GATEWAY_INTERFACE'][0:6] != "CGI/1.": | |
|
52 | raise RuntimeError("This function is only intended to be called while running as a CGI script.") | |
|
53 | import mercurial.hgweb.wsgicgi as wsgicgi | |
|
54 | from request import wsgiapplication | |
|
55 | def make_web_app(): | |
|
56 | return self.__class__(self.origconfig) | |
|
57 | wsgicgi.launch(wsgiapplication(make_web_app)) | |
|
58 | ||
|
59 | def run_wsgi(self, req): | |
|
50 | 60 | def header(**map): |
|
51 | 61 | header_file = cStringIO.StringIO(''.join(tmpl("header", **map))) |
|
52 | 62 | msg = mimetools.Message(header_file, 0) |
General Comments 0
You need to be logged in to leave comments.
Login now