Exemplo n.º 1
0
def load_settings(options):
    settings_file = os.path.expanduser(options.settings)
    settings = src.settings.Settings(settings_file)
    settings.register('host', str, 'localhost')
    settings.register('port', int, 10248)

    if options.port:
        settings.port = int(options.port)

    if options.host != None:
        settings.host = options.host

    return settings
Exemplo n.º 2
0
def load_settings(options):
  settings_file = os.path.expanduser(options.settings)
  settings = src.settings.Settings(settings_file)
  settings.register('host', str, 'localhost')
  settings.register('port', int, 10248)

  if options.port:
    settings.port = int(options.port)

  if options.host != None:
    settings.host = options.host

  return settings
Exemplo n.º 3
0
    def parse():
        options, args = old_parser_args()
        if options.trace:
            trace_enable("./%s.trace" % "quickopen")
        settings_file = os.path.expanduser(options.settings)
        settings = src.settings.Settings(settings_file)
        settings.register('host', str, 'localhost')
        settings.register('port', int, src.default_port.get())
        options.settings = settings

        if not options.port:
            options.port = settings.port
        else:
            options.port = int(options.port)

        if not options.host:
            options.host = settings.host

        return options, args
Exemplo n.º 4
0
  def parse():
    options, args = old_parser_args()
    if options.trace:
      trace_enable("./%s.trace" % "quickopen")
    settings_file = os.path.expanduser(options.settings)
    settings = src.settings.Settings(settings_file)
    settings.register('host', str, 'localhost')
    settings.register('port', int, src.default_port.get())
    options.settings = settings

    if not options.port:
      options.port = settings.port
    else:
      options.port = int(options.port)

    if not options.host:
      options.host = settings.host

    return options, args
Exemplo n.º 5
0
def load_settings(options):
    settings_file = os.path.expanduser(options.settings)
    settings = src.settings.Settings(settings_file)
    settings.register('host', str, 'localhost')
    settings.register('port', int, -1)
    settings.register('trace', bool, False)

    if settings.port == -1:
        # Open the quickopend settings file to get the default
        # port for the daemon. Then, push that value to the quickopen settings
        daemon_settings_file = os.path.expanduser("~/.quickopend")
        daemon_settings = src.settings.Settings(daemon_settings_file)
        daemon_settings.register('port', int, 10248)
        settings.port = daemon_settings.port

    if not options.host:
        options.host = settings.host
    if not options.port:
        options.port = settings.port
    else:
        options.port = int(options.port)
    return settings
Exemplo n.º 6
0
def load_settings(options):
  settings_file = os.path.expanduser(options.settings)
  settings = src.settings.Settings(settings_file)
  settings.register('host', str, 'localhost')
  settings.register('port', int, -1)
  settings.register('trace', bool, False)

  if settings.port == -1:
    # Open the quickopend settings file to get the default
    # port for the daemon. Then, push that value to the quickopen settings
    daemon_settings_file = os.path.expanduser("~/.quickopend")
    daemon_settings = src.settings.Settings(daemon_settings_file)
    daemon_settings.register('port', int, 10248)
    settings.port = daemon_settings.port

  if not options.host:
    options.host = settings.host
  if not options.port:
    options.port = settings.port
  else:
    options.port = int(options.port)
  return settings