Browse Source

add host/port options and a setup script for flaskcvp

Natenom/support-murmur-13-1446181288462
Michael Ziegler 13 years ago
parent
commit
734d55221c
  1. 14
      pyweb/flaskcvp.py
  2. 27
      pyweb/setup_flaskcvp.py

14
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)

27
pyweb/setup_flaskcvp.py

@ -0,0 +1,27 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
* Copyright © 2010, Michael "Svedrin" Ziegler <diese-addy@funzt-halt.net>
*
* 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'],
)
Loading…
Cancel
Save