def appSpecificOptions(self, opts): import os.path from shtoom.Options import OptionGroup, StringOption, ChoiceOption app = OptionGroup('doug', 'doug') app.add(StringOption('logfile', 'log to this file')) app.add( StringOption('dougargs', 'pass these arguments to the voiceapp')) opts.add(app) if self.configFileName is not None: opts.setOptsFile(self.configFileName)
def appSpecificOptions(self, opts): import os.path from shtoom.Options import OptionGroup, StringOption, ChoiceOption app = OptionGroup('doug', 'doug') app.add(StringOption('logfile','log to this file')) app.add(StringOption('dougargs', 'pass these arguments to the voiceapp')) opts.add(app) if self.configFileName is not None: opts.setOptsFile(self.configFileName)
def getMinimalOptions(self): from shtoom.Options import AllOptions, OptionGroup, \ StringOption, NumberOption, BooleanOption o = AllOptions() o.no_config_file = True g = OptionGroup('whatever', 'some settings') g.add(StringOption('ui', 'whatever', 'tk')) g.add(BooleanOption('no_config_file', 'whatever', True)) g.add(StringOption('logfile', 'whatever', '')) g.add(NumberOption('listenport', 'port', 0)) o.add(g) return o
def buildOptions(app): from shtoom.Options import AllOptions, OptionGroup, StringOption, PasswordOption, NumberOption, ChoiceOption, BooleanOption opts = AllOptions() app.appSpecificOptions(opts) network = OptionGroup('network', _('Network Settings')) network.add(StringOption('localip', _('listen on this local ip address'))) network.add( NumberOption('listenport', _('sip listener on this port'), shortopt='p')) network.add( StringOption('outbound_proxy', _('use this outbound proxy to make calls'))) network.add( ChoiceOption('stun_policy', _('When should STUN be used?'), 'rfc1918', choices=['never', 'always', 'rfc1918'])) network.add( ChoiceOption('nat', _('Use this NAT traversal technique'), 'both', choices=['both', 'upnp', 'stun', 'none'])) network.add(NumberOption('force_rtp_port', _('force RTP to use this port'))) opts.add(network) identity = OptionGroup('identity', _('Identity Settings')) identity.add(StringOption('email_address', _('use this email address'))) identity.add(StringOption('username', _('use this user name'))) opts.add(identity) proxy = OptionGroup('proxy', 'SIP Proxy Settings') proxy.add( StringOption('outbound_proxy_url', _('use this proxy for outbound SIP messages'))) opts.add(proxy) register = OptionGroup('register', _('Registration')) register.add( StringOption( 'register_uri', _('URI of registration server (e.g. sip:divmod.com:5060)'))) register.add(StringOption('register_user', _('Username to register'))) register.add( StringOption('register_authuser', _('Username to use for auth'))) register.add( PasswordOption('register_authpasswd', _('Passwd to use for auth'))) opts.add(register) debug = OptionGroup('debug', _('Debugging'), gui=False) debug.add(BooleanOption('stdout', _('Log to stdout'), False)) debug.add( BooleanOption('no_config_file', _("Don't read from or write to config file"), False, shortopt='N')) opts.add(debug) return opts
def appSpecificOptions(self, opts): app = OptionGroup('shtoom', 'Shtoom') app.add( ChoiceOption('ui', _('use UI for interface'), choices=['qt', 'gnome', 'wx', 'tk', 'text'])) app.add( ChoiceOption( 'audio', _('use AUDIO for interface'), choices=['oss', 'fast', 'port', 'alsa', 'echo', 'file'])) app.add(StringOption('audio_device', _('use this audio device'))) # XXX TOFIX: This next option Must Die. app.add(StringOption('shtoomdir', _('root dir of shtoom installation'))) app.add( StringOption('incoming_ring_file', _('play this wav file when a call comes in'), 'ring.wav')) app.add( StringOption('ring_back_file', _('play this wav file when remote phone is ringing'), 'ringback.wav')) app.add( ChoiceOption('ipc', _('use IPC for ipc commands'), default='none', choices=['none', 'dbus', 'pb'])) app.add(StringOption('logfile', _('log to this file'))) opts.add(app) creds = OptionDict('credentials', _('cached credentials'), gui=False) opts.add(creds) opts.setOptsFile('.shtoomrc')
def appSpecificOptions(self, opts): app = OptionGroup('shtoom', 'Shtoom') app.add(ChoiceOption('ui',_('use UI for interface'), choices=['qt','gnome','wx', 'tk', 'text'])) app.add(ChoiceOption('audio',_('use AUDIO for interface'), choices=['oss', 'fast', 'port', 'alsa', 'echo', 'file'])) app.add(StringOption('audio_device',_('use this audio device'))) # XXX TOFIX: This next option Must Die. app.add(StringOption('shtoomdir',_('root dir of shtoom installation'))) app.add(StringOption('incoming_ring_file', _('play this wav file when a call comes in'), 'ring.wav')) app.add(StringOption('ring_back_file', _('play this wav file when remote phone is ringing'), 'ringback.wav')) app.add(ChoiceOption('ipc',_('use IPC for ipc commands'), default='none', choices=['none', 'dbus', 'pb'])) app.add(StringOption('logfile',_('log to this file'))) opts.add(app) creds = OptionDict('credentials', _('cached credentials'), gui=False) opts.add(creds) opts.setOptsFile('.shtoomrc')
def buildOptions(app): from shtoom.Options import ( AllOptions, OptionGroup, StringOption, PasswordOption, NumberOption, ChoiceOption, BooleanOption, ) opts = AllOptions() app.appSpecificOptions(opts) network = OptionGroup("network", _("Network Settings")) network.add(StringOption("localip", _("listen on this local ip address"))) network.add(NumberOption("listenport", _("sip listener on this port"), shortopt="p")) network.add(StringOption("outbound_proxy", _("use this outbound proxy to make calls"))) network.add( ChoiceOption("stun_policy", _("When should STUN be used?"), "rfc1918", choices=["never", "always", "rfc1918"]) ) network.add( ChoiceOption("nat", _("Use this NAT traversal technique"), "both", choices=["both", "upnp", "stun", "none"]) ) network.add(NumberOption("force_rtp_port", _("force RTP to use this port"))) opts.add(network) identity = OptionGroup("identity", _("Identity Settings")) identity.add(StringOption("email_address", _("use this email address"))) identity.add(StringOption("username", _("use this user name"))) opts.add(identity) proxy = OptionGroup("proxy", "SIP Proxy Settings") proxy.add(StringOption("outbound_proxy_url", _("use this proxy for outbound SIP messages"))) opts.add(proxy) register = OptionGroup("register", _("Registration")) register.add(StringOption("register_uri", _("URI of registration server (e.g. sip:divmod.com:5060)"))) register.add(StringOption("register_user", _("Username to register"))) register.add(StringOption("register_authuser", _("Username to use for auth"))) register.add(PasswordOption("register_authpasswd", _("Passwd to use for auth"))) opts.add(register) debug = OptionGroup("debug", _("Debugging"), gui=False) debug.add(BooleanOption("stdout", _("Log to stdout"), False)) debug.add(BooleanOption("no_config_file", _("Don't read from or write to config file"), False, shortopt="N")) opts.add(debug) return opts