From 734d55221c2a7a9a453b11440ba138b24ff78ff4 Mon Sep 17 00:00:00 2001 From: Michael Ziegler Date: Sat, 5 Nov 2011 09:13:14 +0100 Subject: [PATCH] add host/port options and a setup script for flaskcvp --- pyweb/flaskcvp.py | 14 +++++++++++--- pyweb/setup_flaskcvp.py | 27 +++++++++++++++++++++++++++ 2 files changed, 38 insertions(+), 3 deletions(-) create mode 100644 pyweb/setup_flaskcvp.py diff --git a/pyweb/flaskcvp.py b/pyweb/flaskcvp.py index f66f935..237c20b 100644 --- a/pyweb/flaskcvp.py +++ b/pyweb/flaskcvp.py @@ -56,6 +56,16 @@ parser.add_option( "-d", "--debug", help="Enable error debugging", default=False, action="store_true" ) +parser.add_option( "-H", "--host", + help="The IP to bind to. Default is '127.0.0.1'.", + default="127.0.0.1" + ) + +parser.add_option( "-p", "--port", type="int", + help="The port number to bind to. Default is 5000.", + default=5000 + ) + options, progargs = parser.parse_args() if options.connstring is None: @@ -72,8 +82,6 @@ ctl = MumbleCtlBase.newInstance( options.connstring, options.slice, options.ices app = Flask(__name__) -app.debug = options.debug - def getUser(user): fields = ["channel", "deaf", "mute", "name", "selfDeaf", "selfMute", @@ -106,4 +114,4 @@ def getServers(): return jsonify(servers=ctl.getBootedServers()) if __name__ == '__main__': - app.run() + app.run(host=options.host, port=options.port, debug=options.debug) diff --git a/pyweb/setup_flaskcvp.py b/pyweb/setup_flaskcvp.py new file mode 100644 index 0000000..17746e2 --- /dev/null +++ b/pyweb/setup_flaskcvp.py @@ -0,0 +1,27 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +""" + * Copyright © 2010, Michael "Svedrin" Ziegler + * + * Mumble-Django 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 2 of the License, or + * (at your option) any later version. + * + * This package 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. +""" + +from distutils.core import setup + +setup(name='flaskcvp', + version="2.5", + description="Minimalistic CVP Provider using Flask and Mumble-Django's connectors", + author="Michael Ziegler", + author_email='diese-addy@funzt-halt.net', + url='http://www.mumble-django.org', + py_modules=['flaskcvp', 'mumble.mctl', 'mumble.MumbleCtlDbus', 'mumble.MumbleCtlIce', 'mumble.utils'], + )