# HG changeset patch # User David Barts # Date 1559240606 25200 # Node ID 7261459351fa0b39baef7ce4620f8d76e6d7b97d # Parent 0bd9b9ae99984b3e430087287a9020497b9247a5 More multithread support, remove debug writes. diff -r 0bd9b9ae9998 -r 7261459351fa tincan.py --- a/tincan.py Thu May 30 08:59:35 2019 -0700 +++ b/tincan.py Thu May 30 11:23:26 2019 -0700 @@ -437,7 +437,7 @@ self._encoding = None def launch(self): - print("adding static route:", self._urlpath) # debug + # print("adding static route:", self._urlpath) # debug self._app.route(self._urlpath, 'GET', self) def _parse_date(self, ims): @@ -619,7 +619,7 @@ if not methods: raise TinCanError("{0}: no #methods specified".format(self._urlpath)) # Register this thing with Bottle - print("adding route:", self._origin, '('+','.join(methods)+')') # debug + # print("adding route:", self._origin, '('+','.join(methods)+')') # debug self._app.route(self._origin, methods, self) def _splitpath(self, unsplit): @@ -886,14 +886,15 @@ sys.stderr.write(message) sys.stderr.write('\n') -def launch(fsroot=None, urlroot='/', logger=_logger, debug=False, encoding=ENCODING, static=False): +def launch(fsroot=None, urlroot='/', logger=_logger, debug=False, + encoding=ENCODING, static=False, multithread=True): """ Launch and return a TinCan webapp. Does not run the app; it is the caller's responsibility to call app.run() """ if fsroot is None: fsroot = os.getcwd() - launcher = _Launcher(fsroot, urlroot, logger) + launcher = _Launcher(fsroot, urlroot, logger, multithread=multithread) launcher.debug = debug launcher.encoding = encoding launcher.static = static