sketch out how we might do this
| | |
| | | import threading |
| | | import time |
| | | import traceback |
| | | import warnings |
| | | |
| | | from paste.deploy import loadapp, loadserver |
| | | |
| | |
| | | action='store_true', |
| | | help=('Stop a daemonized server (given a PID file, or default ' |
| | | 'pyramid.pid file)')) |
| | | parser.add_option( |
| | | '-W', '--warnfilter', |
| | | dest='warnfilter', |
| | | metavar="ACTION", |
| | | default='default', |
| | | choices=('ignore', 'error', 'always', 'default', 'module', 'once'), |
| | | help=('Set a Python warnings filter action (default: ``default``). ' |
| | | 'See the Python warnings module docs for definitions of the ' |
| | | 'available choices. Ex: -Wignore. This option ' |
| | | 'will have no effect if the any PYTHONWARNINGS envvar ' |
| | | 'is set in your environment, or one or more -W options ' |
| | | 'to *Python* are provided. Python warnoptions settings override ' |
| | | 'this option.') |
| | | ) |
| | | |
| | | _scheme_re = re.compile(r'^[a-z][a-z]+:', re.I) |
| | | |
| | |
| | | print(msg) |
| | | |
| | | def run(self): # pragma: no cover |
| | | if not sys.warnoptions: |
| | | warnings.simplefilter(self.options.warnfilter) |
| | | if self.options.stop_daemon: |
| | | return self.stop_daemon() |
| | | |