コード例 #1
0
def main(argv):
    conf = {
        "debug": None,
        "logging": None,
    }
    conf.update(DataStore.CONFIG_DEFAULTS)

    args, argv = readconf.parse_argv(argv, conf, strict=False)
    if argv and argv[0] in ('-h', '--help'):
        print(
            """Usage: python -m Abe.reconfigure [-h] [--config=FILE] [--CONFIGVAR=VALUE]...

Apply configuration changes to an existing Abe database, if possible.

  --help                    Show this help message and exit.
  --config FILE             Read options from FILE.
  --use-firstbits {true|false}
                            Turn Firstbits support on or off.
  --keep-scriptsig false    Remove input validation scripts from the database.

All configuration variables may be given as command arguments.""")
        return 0

    logging.basicConfig(stream=sys.stdout,
                        level=logging.DEBUG,
                        format="%(message)s")
    if args.logging is not None:
        import logging.config as logging_config
        logging_config.dictConfig(args.logging)

    store = DataStore.new(args)
    firstbits.reconfigure(store, args)
    keep_scriptsig_reconfigure(store, args)
    return 0
コード例 #2
0
ファイル: reconfigure.py プロジェクト: kalgecin/yacoin-abe
def main(argv):
    conf = {"debug": None, "logging": None}
    conf.update(DataStore.CONFIG_DEFAULTS)

    args, argv = readconf.parse_argv(argv, conf, strict=False)
    if argv and argv[0] in ("-h", "--help"):
        print(
            """Usage: python -m Abe.reconfigure [-h] [--config=FILE] [--CONFIGVAR=VALUE]...

Apply configuration changes to an existing Abe database, if possible.

  --help                    Show this help message and exit.
  --config FILE             Read options from FILE.
  --use-firstbits {true|false}
                            Turn Firstbits support on or off.
  --keep-scriptsig false    Remove input validation scripts from the database.

All configuration variables may be given as command arguments."""
        )
        return 0

    logging.basicConfig(stream=sys.stdout, level=logging.DEBUG, format="%(message)s")
    if args.logging is not None:
        import logging.config as logging_config

        logging_config.dictConfig(args.logging)

    store = DataStore.new(args)
    firstbits.reconfigure(store, args)
    keep_scriptsig_reconfigure(store, args)
    return 0
コード例 #3
0
def main(argv):
    cmdline = util.CmdLine(argv)
    cmdline.usage = lambda: \
        """Usage: python -m Abe.reconfigure [-h] [--config=FILE] [--CONFIGVAR=VALUE]...

Apply configuration changes to an existing Abe database, if possible.

  --help                    Show this help message and exit.
  --config FILE             Read options from FILE.
  --use-firstbits {true|false}
                            Turn Firstbits support on or off.
  --keep-scriptsig false    Remove input validation scripts from the database.

All configuration variables may be given as command arguments."""

    store, argv = cmdline.init()
    if store is None:
        return 0

    firstbits.reconfigure(store, args)
    keep_scriptsig_reconfigure(store, args)
    return 0
コード例 #4
0
ファイル: reconfigure.py プロジェクト: 3manuek/bitcoin-abe
def main(argv):
    cmdline = util.CmdLine(argv)
    cmdline.usage = lambda: \
        """Usage: python -m Abe.reconfigure [-h] [--config=FILE] [--CONFIGVAR=VALUE]...

Apply configuration changes to an existing Abe database, if possible.

  --help                    Show this help message and exit.
  --config FILE             Read options from FILE.
  --use-firstbits {true|false}
                            Turn Firstbits support on or off.
  --keep-scriptsig false    Remove input validation scripts from the database.

All configuration variables may be given as command arguments."""

    store, argv = cmdline.init()
    if store is None:
        return 0

    firstbits.reconfigure(store, args)
    keep_scriptsig_reconfigure(store, args)
    return 0