From 04b13e003d6af0de21e6c59e411ffee5b97b6134 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Sun, 1 Oct 2017 18:50:17 +0200 Subject: New upstream version 2.0.4 --- mwcfeedserver.py | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) (limited to 'mwcfeedserver.py') 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 +# Copyright: (2013-2017) Michael Till Beck # 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) -- cgit v1.2.3