##// END OF EJS Templates
Cleanup hgweb and hgwebdir's run method a bit.
Eric Hopper -
r2538:f4b7d71c default
parent child Browse files
Show More
@@ -651,12 +651,12 b' class hgweb(object):'
651 651 return p
652 652
653 653 def run(self):
654 if os.environ['GATEWAY_INTERFACE'][0:6] != "CGI/1.":
654 if not os.environ.get('GATEWAY_INTERFACE', '').startswith("CGI/1."):
655 655 raise RuntimeError("This function is only intended to be called while running as a CGI script.")
656 656 import mercurial.hgweb.wsgicgi as wsgicgi
657 657 from request import wsgiapplication
658 658 def make_web_app():
659 return self.__class__(self.repo, self.reponame)
659 return self
660 660 wsgicgi.launch(wsgiapplication(make_web_app))
661 661
662 662 def run_wsgi(self, req):
@@ -20,7 +20,6 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
24 23 self.motd = ""
25 24 self.repos_sorted = ('name', False)
26 25 if isinstance(config, (list, tuple)):
@@ -48,12 +47,12 b' class hgwebdir(object):'
48 47 self.repos.sort()
49 48
50 49 def run(self):
51 if os.environ['GATEWAY_INTERFACE'][0:6] != "CGI/1.":
50 if not os.environ.get('GATEWAY_INTERFACE', '').startswith("CGI/1."):
52 51 raise RuntimeError("This function is only intended to be called while running as a CGI script.")
53 52 import mercurial.hgweb.wsgicgi as wsgicgi
54 53 from request import wsgiapplication
55 54 def make_web_app():
56 return self.__class__(self.origconfig)
55 return self
57 56 wsgicgi.launch(wsgiapplication(make_web_app))
58 57
59 58 def run_wsgi(self, req):
General Comments 0
You need to be logged in to leave comments. Login now