diff options
| author | Barry Warsaw | 2009-05-03 15:35:29 -0400 |
|---|---|---|
| committer | Barry Warsaw | 2009-05-03 15:35:29 -0400 |
| commit | e920c98c72fc9674316ae32c26a81fe571964ea5 (patch) | |
| tree | 905de48fe2f08c939b77e13f0fcf35ad1b6e8efa /src/mailman/queue/rest.py | |
| parent | 443aba66658347d0b747ff84ec1750cfb8c71924 (diff) | |
| download | mailman-e920c98c72fc9674316ae32c26a81fe571964ea5.tar.gz mailman-e920c98c72fc9674316ae32c26a81fe571964ea5.tar.zst mailman-e920c98c72fc9674316ae32c26a81fe571964ea5.zip | |
Diffstat (limited to 'src/mailman/queue/rest.py')
| -rw-r--r-- | src/mailman/queue/rest.py | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/src/mailman/queue/rest.py b/src/mailman/queue/rest.py new file mode 100644 index 000000000..3d0eb3bae --- /dev/null +++ b/src/mailman/queue/rest.py @@ -0,0 +1,50 @@ +# Copyright (C) 2009 by the Free Software Foundation, Inc. +# +# This file is part of GNU Mailman. +# +# GNU Mailman is free software: you can redistribute it and/or modify it under +# the terms of the GNU General Public License as published by the Free +# Software Foundation, either version 3 of the License, or (at your option) +# any later version. +# +# GNU Mailman is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for +# more details. +# +# You should have received a copy of the GNU General Public License along with +# GNU Mailman. If not, see <http://www.gnu.org/licenses/>. + +"""Start the administrative HTTP server.""" + +from __future__ import absolute_import, unicode_literals + +__metaclass__ = type +__all__ = [ + 'RESTRunner', + ] + + +import sys +import errno +import select +import signal +import logging + +from mailman.queue import Runner +from mailman.rest.webservice import start + + + +class RESTRunner(Runner): + def run(self): + try: + start() + except KeyboardInterrupt: + sys.exit(signal.SIGTERM) + except select.error as (errcode, message): + if errcode == errno.EINTR: + sys.exit(signal.SIGTERM) + raise + except: + raise |
