How to use the ipwb.util function in ipwb

To help you get started, we’ve selected a few ipwb examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github oduwsdl / ipwb / ipwb / __main__.py View on Github external
'index',
        help='path, URI, or multihash of file to use for replay',
        nargs='?')
    replayParser.add_argument(
        '-P', '--proxy',
        help='Proxy URL',
        metavar='',
        nargs='?')
    replayParser.set_defaults(func=checkArgs_replay,
                              onError=replayParser.print_help)

    parser.add_argument(
        '-d', '--daemon',
        help=("Multi-address of IPFS daemon "
              "(default /dns/localhost/tcp/5001/http)"),
        default=ipwbUtil.IPFSAPI_MUTLIADDRESS,
        dest='daemon_address')
    parser.add_argument(
        '-v', '--version', help='Report the version of ipwb', action='version',
        version='InterPlanetary Wayback ' + ipwbVersion)

    argCount = len(argsIn)
    cmdList = ['index', 'replay']
    baseParserFlagList = ['-d', '--daemon', '-v', '--version']

    # Various invocation error, used to show appropriate help
    cmdError_index = argCount == 2 and argsIn[1] == 'index'
    cmdError_noCommand = argCount == 1
    cmdError_invalidCommand = argCount > 1 \
        and argsIn[1] not in cmdList + baseParserFlagList

    if cmdError_noCommand or cmdError_invalidCommand: