How to use the nvchecker.__main__.Source function in nvchecker

To help you get started, we’ve selected a few nvchecker 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 lilydjwg / nvchecker / nvchecker / __main__.py View on Github external
global args

  parser = argparse.ArgumentParser(description='New version checker for software')
  parser.add_argument('-n', '--notify', action='store_true', default=False,
                      help='show desktop notifications when a new version is available')
  parser.add_argument('-t', '--tries', default=1, type=int, metavar='N',
                      help='try N times when errors occur')
  core.add_common_arguments(parser)
  args = parser.parse_args()
  if core.process_common_arguments(args):
    return

  if not args.file:
    return

  s = Source(args.file, args.tries)

  ioloop = asyncio.get_event_loop()
  ioloop.run_until_complete(s.check())