Browse Source

implement asking for the Ice secret to Murmur CLI

Natenom/support-murmur-13-1446181288462
Michael Ziegler 15 years ago
parent
commit
f2b8a877a9
  1. 15
      pyweb/mucli.py

15
pyweb/mucli.py

@ -20,6 +20,7 @@ DEFAULT_SLICEFILE = '/usr/share/slice/Murmur.ice'
import os, sys import os, sys
import inspect import inspect
import getpass
from optparse import OptionParser from optparse import OptionParser
from mumble.mctl import MumbleCtlBase from mumble.mctl import MumbleCtlBase
@ -48,6 +49,16 @@ parser.add_option( "-c", "--connstring",
default=None default=None
) )
parser.add_option( "-i", "--icesecret",
help="Ice secret to use in the connection. Also see --asksecret.",
default=None
)
parser.add_option( "-a", "--asksecret",
help="Ask for the Ice secret on the shell instead of taking it from the command line.",
action="store_true", default=False
)
parser.add_option( "-s", "--slice", parser.add_option( "-s", "--slice",
help="path to the slice file. Default is '%s'." % DEFAULT_SLICEFILE, help="path to the slice file. Default is '%s'." % DEFAULT_SLICEFILE,
default=None default=None
@ -109,8 +120,10 @@ if options.verbose:
print >> sys.stderr, " Slice: %s" % options.slice print >> sys.stderr, " Slice: %s" % options.slice
print >> sys.stderr, "Encoding: %s" % options.encoding print >> sys.stderr, "Encoding: %s" % options.encoding
if options.asksecret or options.icesecret == '':
options.icesecret = getpass.getpass( "Ice secret: " )
ctl = MumbleCtlBase.newInstance( connstring=options.connstring, slicefile=options.slice )
ctl = MumbleCtlBase.newInstance( options.connstring, options.slice, options.icesecret )
if not progargs: if not progargs:

Loading…
Cancel
Save