diff options
author | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2017-10-02 06:09:15 +0200 |
---|---|---|
committer | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2017-10-02 06:09:15 +0200 |
commit | ef84a92a429b724586031878dfc0b38c64d55a23 (patch) | |
tree | 4fb270e0f1bdd261417fdc06cfb6bf3a58d17023 /mwcfeedserver.py | |
parent | 18449d7dd31123e14f8a0d87047f2f85187a156b (diff) | |
parent | 613720c29e3613baf3eb56511eab13195f4e8790 (diff) |
Merge branch 'release/2.0.4-1'2.0.4-1
Diffstat (limited to 'mwcfeedserver.py')
-rwxr-xr-x | mwcfeedserver.py | 31 |
1 files changed, 17 insertions, 14 deletions
diff --git a/mwcfeedserver.py b/mwcfeedserver.py index 98093b9..0bca4b0 100755 --- a/mwcfeedserver.py +++ b/mwcfeedserver.py @@ -1,35 +1,38 @@ -#!/usr/bin/python3 +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- -# Copyright: (2013-2014) Michael Till Beck <Debianguru@gmx.de> +# Copyright: (2013-2017) Michael Till Beck <Debianguru@gmx.de> # License: GPL-2.0+ + import http.server import socketserver import importlib import sys import getopt + bind = 'localhost' port = 8000 configMod = 'config' try: - opts, args = getopt.getopt(sys.argv[1:], 'hc:b:p:', ['help', 'config=', 'bind=', 'port=']) + opts, args = getopt.getopt(sys.argv[1:], 'hc:b:p:', ['help', 'config=', 'bind=', 'port=']) except getopt.GetoptError: - print('Usage: FeedServer.py --config=config --port=8000') - sys.exit(1) + print('Usage: FeedServer.py --config=config --port=8000 --bind=localhost') + sys.exit(1) for opt, arg in opts: - if opt == '-h': - print('Usage: FeedServer.py --config=config --bind=localhost --port=8000') - exit() - elif opt in ('-c', '--config'): - configMod = arg - elif opt in ('-b', '--bind'): - bind = arg - elif opt in ('-p', '--port'): - port = int(arg) + if opt == '-h': + print('Usage: FeedServer.py --config=config --bind=localhost --port=8000') + exit() + elif opt in ('-c', '--config'): + configMod = arg + elif opt in ('-b', '--bind'): + bind = arg + elif opt in ('-p', '--port'): + port = int(arg) config = importlib.import_module(configMod) |