Ejemplo n.º 1
0
 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
Ejemplo n.º 2
0
class DummyApp:
    def __init__(self):
        self.all = AllOptions()
        self.creds = OptionDict('credentials', 'credentials')
        self.all.addGroup(self.creds)
        self.ini = None

    def getPref(self, name):
        if name == "credentials":
            return self.creds
        else:
            raise NameError(name)

    def updateOptions(self, dict, forceSave=False):
        if forceSave:
            self.ini = self.all.emitConfigParser()
Ejemplo n.º 3
0
class DummyApp:
    def __init__(self):
        self.all = AllOptions()
        self.creds = OptionDict('credentials', 'credentials')
        self.all.addGroup(self.creds)
        self.ini = None

    def getPref(self, name):
        if name == "credentials":
            return self.creds
        else:
            raise NameError(name)

    def updateOptions(self, dict, forceSave=False):
        if forceSave:
            self.ini = self.all.emitConfigParser()
Ejemplo n.º 4
0
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
Ejemplo n.º 5
0
 def __init__(self):
     self.all = AllOptions()
     self.creds = OptionDict('credentials', 'credentials')
     self.all.addGroup(self.creds)
     self.ini = None
Ejemplo n.º 6
0
 def __init__(self):
     self.all = AllOptions()
     self.creds = OptionDict('credentials', 'credentials')
     self.all.addGroup(self.creds)
     self.ini = None
Ejemplo n.º 7
0
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