コード例 #1
0
def main():
    global _plain_logger, _plain_error_logger

    app = FeedlyApp()
    parser, args = parse_args(app, sys.argv[1:])

    loggingutil.setup_logger(_log, debug=args.debug)
    if not args.debug:
        # suppress noisy modules
        _log.getChild("requests").setLevel(logging.WARN)

    _plain_logger = loggingutil.create_plain_logger(
        "PLAIN",
        debug=args.debug,
    )
    _plain_error_logger = loggingutil.create_plain_logger(
        "PLAIN_ERROR",
        debug=args.debug,
        stdout=False,
    )

    app.process_args(parser, args)
    code = args.func(args)
    if code is not None:
        sys.exit(code)
コード例 #2
0
def main():
    global _PLAIN_LOGGER, _PLAIN_ERROR_LOGGER

    args = parse_args(sys.argv[1:])

    loggingutil.setup_logger(_LOG, debug=args.debug)
    _PLAIN_LOGGER = loggingutil.create_plain_logger("PLAIN")
    _PLAIN_ERROR_LOGGER = loggingutil.create_plain_logger(
        "PLAIN_ERROR",
        stdout=False,
    )

    app = App(args.wishlist_id)
    app.run()
コード例 #3
0
ファイル: movefast.py プロジェクト: hermantai/samples
def main():
    global _plain_error_logger
    args = parse_args(sys.argv[1:])

    loggingutil.setup_logger(_log, debug=args.debug)
    if not args.debug:
        # tone down the verbosity of some modules
        verbose_modules = [
            "googleapiclient.discovery",
            "oauth2client.client",
            "requests",
        ]
        for mod in verbose_modules:
            logging.getLogger(mod).setLevel(
                logging.WARNING
            )

    _plain_error_logger = loggingutil.create_plain_logger(
        "PLAIN_ERROR",
        debug=args.debug,
        stdout=False,
    )

    app = MoveFast(args)
    sys.exit(app.run())
コード例 #4
0
def main():
    global _plain_logger, _plain_error_logger

    app = GoogleTasksConsoleApp()
    args = parse_args(app, sys.argv[1:])

    loggingutil.setup_logger(_log, debug=args.debug)
    _plain_logger = loggingutil.create_plain_logger(
        "PLAIN",
        debug=args.debug,
    )
    _plain_error_logger = loggingutil.create_plain_logger(
        "PLAIN_ERROR",
        debug=args.debug,
        stdout=False,
    )
    args.func(args)
コード例 #5
0
ファイル: script_template.py プロジェクト: hermantai/samples
def main():
    global _plain_logger, _plain_error_logger

    args = parse_args(sys.argv[1:])

    loggingutil.setup_logger(_log, debug=args.debug)
    _plain_logger = loggingutil.create_plain_logger(
        "PLAIN",
        debug=args.debug,
    )
    _plain_error_logger = loggingutil.create_plain_logger(
        "PLAIN_ERROR",
        debug=args.debug,
        stdout=False,
    )

    app = App(args)
    sys.exit(app.run())
コード例 #6
0
def main():
    global _PLAIN_LOGGER

    args = parse_args(sys.argv[1:])

    loggingutil.setup_logger(_LOG, debug=args.debug)
    _PLAIN_LOGGER = loggingutil.create_plain_logger("PLAIN")

    app = App()
    app.run()
コード例 #7
0
def main():
    global _PLAIN_LOGGER, _PLAIN_ERROR_LOGGER

    args = parse_args(sys.argv[1:])

    loggingutil.setup_logger(_LOG, debug=args.debug)
    _PLAIN_LOGGER = loggingutil.create_plain_logger("PLAIN")
    _PLAIN_ERROR_LOGGER = loggingutil.create_plain_logger("PLAIN_ERROR", stdout=False)

    for stock_symbol in args.stock_symbol:
        app = StockApp(
            stock_symbol,
            print_history=args.history,
            print_price_quote=not args.no_price_quote,
            print_fundamentals=args.fundamentals,
            num_of_days_for_history=args.num_of_days,
            print_insider_purchases=args.insider_purchases,
        )
        app.run()
コード例 #8
0
def main():
    global _plain_logger, _plain_error_logger

    app = App()
    args = parse_args(app, sys.argv[1:])

    loggingutil.setup_logger(_log, debug=args.debug)
    _plain_logger = loggingutil.create_plain_logger(
        "PLAIN",
        debug=args.debug,
    )
    _plain_error_logger = loggingutil.create_plain_logger(
        "PLAIN_ERROR",
        debug=args.debug,
        stdout=False,
    )
    code = args.func(args)
    if code is not None:
        sys.exit(code)
コード例 #9
0
def main():
    global _plain_logger

    args = parse_args(sys.argv[1:])

    loggingutil.setup_logger(_log, debug=args.debug)
    _plain_logger = loggingutil.create_plain_logger("PLAIN")

    app = App(args.url, stop_at=args.stop_at)
    app.run()
コード例 #10
0
def main():
    global _PLAIN_LOGGER

    args = parse_args(sys.argv[1:])

    loggingutil.setup_logger(_LOG, debug=args.debug)
    _PLAIN_LOGGER = loggingutil.create_plain_logger("PLAIN")

    app = PodcastDownloader(args.feed_url, out_dir=args.out_dir)
    app.run()
コード例 #11
0
def main():
    global _PLAIN_LOGGER

    args = parse_args(sys.argv[1:])

    loggingutil.setup_logger(_LOG, debug=args.debug)
    _PLAIN_LOGGER = loggingutil.create_plain_logger("PLAIN")

    app = DownloadAllApp(
        args.url,
        args.regex,
        args.out_dir,
        dry_run=args.dry_run,
    )
    app.run()
コード例 #12
0
def main():
    global _PLAIN_LOGGER

    app = DropboxApp(
        DROPBOX_APP_KEY or os.getenv('DROPBOX_APP_KEY'),
        DROPBOX_APP_SECRET or os.getenv('DROPBOX_APP_SECRET'),
    )
    args = parse_args(app, sys.argv[1:])

    loggingutil.setup_logger(_LOG, debug=args.debug)
    _PLAIN_LOGGER = loggingutil.create_plain_logger(
        "PLAIN",
        debug=args.debug,
    )
    return args.func(args)