How to use the pywws.logger.setup_handler function in pywws

To help you get started, we’ve selected a few pywws 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 jim-easterbrook / pywws / src / pywws / process.py View on Github external
print(__usage__.strip(), file=sys.stderr)
        return 1
    # process options
    verbose = 0
    for o, a in opts:
        if o in ('-h', '--help'):
            print(__usage__.strip())
            return 0
        elif o in ('-v', '--verbose'):
            verbose += 1
    # check arguments
    if len(args) != 1:
        print('Error: 1 argument required\n', file=sys.stderr)
        print(__usage__.strip(), file=sys.stderr)
        return 2
    pywws.logger.setup_handler(verbose)
    data_dir = args[0]
    with pywws.storage.pywws_context(data_dir) as context:
        return process_data(context)