Browse Source

only load the slice if the Murmur module cannot be imported (e.g., it has not already been loaded)

Natenom/support-murmur-13-1446181288462
Michael Ziegler 15 years ago
parent
commit
92fd130c43
  1. 35
      pyweb/mumble/MumbleCtlIce.py

35
pyweb/mumble/MumbleCtlIce.py

@ -55,22 +55,27 @@ def MumbleCtlIce( connstring ):
Murmur version matches the slice Version. Murmur version matches the slice Version.
""" """
if not settings.SLICE:
raise EnvironmentError( "You didn't configure a slice file. Please set the SLICE variable in settings.py." )
if not exists( settings.SLICE ):
raise EnvironmentError( "The slice file does not exist: '%s' - please check the settings." % settings.SLICE )
if " " in settings.SLICE:
raise EnvironmentError( "You have a space char in your Slice path. This will confuse Ice, please check." )
if not settings.SLICE.endswith( ".ice" ):
raise EnvironmentError( "The slice file name MUST end with '.ice'." )
Ice.loadSlice( settings.SLICE )
ice = Ice.initialize()
try:
import Murmur
import Murmur
except ImportError:
print "Loading Slice!"
if not settings.SLICE:
raise EnvironmentError( "You didn't configure a slice file. Please set the SLICE variable in settings.py." )
if not exists( settings.SLICE ):
raise EnvironmentError( "The slice file does not exist: '%s' - please check the settings." % settings.SLICE )
if " " in settings.SLICE:
raise EnvironmentError( "You have a space char in your Slice path. This will confuse Ice, please check." )
if not settings.SLICE.endswith( ".ice" ):
raise EnvironmentError( "The slice file name MUST end with '.ice'." )
Ice.loadSlice( settings.SLICE )
ice = Ice.initialize()
import Murmur
prx = ice.stringToProxy( connstring.encode("utf-8") ) prx = ice.stringToProxy( connstring.encode("utf-8") )
meta = Murmur.MetaPrx.checkedCast(prx) meta = Murmur.MetaPrx.checkedCast(prx)

Loading…
Cancel
Save