Browse Source

add a bit documentation

Natenom/support-murmur-13-1446181288462
Michael Ziegler 15 years ago
parent
commit
e8490b511b
  1. 2
      pyweb/mumble/MumbleCtlDbus.py
  2. 15
      pyweb/mumble/MumbleCtlIce.py

2
pyweb/mumble/MumbleCtlDbus.py

@ -27,6 +27,8 @@ from dbus.exceptions import DBusException
def MumbleCtlDbus( connstring ): def MumbleCtlDbus( connstring ):
""" Choose the correct DBus handler (1.1.8 or legacy) to use. """
meta = dbus.Interface( dbus.SystemBus().get_object( connstring, '/' ), 'net.sourceforge.mumble.Meta' ); meta = dbus.Interface( dbus.SystemBus().get_object( connstring, '/' ), 'net.sourceforge.mumble.Meta' );
try: try:

15
pyweb/mumble/MumbleCtlIce.py

@ -27,8 +27,15 @@ from mctl import MumbleCtlBase
import Ice import Ice
def protectDjangoErrPage( func ): def protectDjangoErrPage( func ):
""" Catch and reraise Ice exceptions to prevent the Django page from failing.
Since I need to "import Murmur", Django would try to read a murmur.py file
which doesn't exist, and thereby produce an IndexError exception. This method
erases the exception's traceback, preventing Django from trying to read any
non-existant files and borking.
"""
def protection_wrapper( *args, **kwargs ): def protection_wrapper( *args, **kwargs ):
try: try:
return func( *args, **kwargs ); return func( *args, **kwargs );
@ -37,8 +44,14 @@ def protectDjangoErrPage( func ):
return protection_wrapper; return protection_wrapper;
@protectDjangoErrPage @protectDjangoErrPage
def MumbleCtlIce( connstring ): def MumbleCtlIce( connstring ):
""" Choose the correct Ice handler to use (1.1.8 or 1.2.0), and make sure the
Murmur version matches the slice Version.
"""
version = settings.SLICE_VERSION; version = settings.SLICE_VERSION;
slice = settings.SLICE; slice = settings.SLICE;

Loading…
Cancel
Save