How to use the nvchecker.core.read_verfile 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 / tools.py View on Github external
help='ignore nonexistent names')
  parser.add_argument('names', metavar='NAME', nargs='*',
                      help='software name to be updated')
  args = parser.parse_args()
  if core.process_common_arguments(args):
    return

  s = core.Source(args.file)
  if not s.oldver or not s.newver:
    logger.critical(
      "doesn't have both 'oldver' and 'newver' set.", source=s,
    )
    sys.exit(2)

  oldvers = core.read_verfile(s.oldver)
  newvers = core.read_verfile(s.newver)

  if args.all:
    oldvers.update(newvers)
  else:
    for name in args.names:
      try:
        oldvers[name] = newvers[name]
      except KeyError:
        if args.ignore_nonexistent:
          logger.warning('nonexistent in newver, ignored', name=name)
          continue

        logger.critical(
          "doesn't exist in 'newver' set.", name=name,
        )
        sys.exit(2)
github lilydjwg / nvchecker / nvchecker / tools.py View on Github external
parser.add_argument('--ignore-nonexistent', action='store_true',
                      help='ignore nonexistent names')
  parser.add_argument('names', metavar='NAME', nargs='*',
                      help='software name to be updated')
  args = parser.parse_args()
  if core.process_common_arguments(args):
    return

  s = core.Source(args.file)
  if not s.oldver or not s.newver:
    logger.critical(
      "doesn't have both 'oldver' and 'newver' set.", source=s,
    )
    sys.exit(2)

  oldvers = core.read_verfile(s.oldver)
  newvers = core.read_verfile(s.newver)

  if args.all:
    oldvers.update(newvers)
  else:
    for name in args.names:
      try:
        oldvers[name] = newvers[name]
      except KeyError:
        if args.ignore_nonexistent:
          logger.warning('nonexistent in newver, ignored', name=name)
          continue

        logger.critical(
          "doesn't exist in 'newver' set.", name=name,
        )
github lilydjwg / nvchecker / nvchecker / tools.py View on Github external
def cmp():
  parser = argparse.ArgumentParser(description='compare version records of nvchecker')
  core.add_common_arguments(parser)
  args = parser.parse_args()
  if core.process_common_arguments(args):
    return

  s = core.Source(args.file)
  oldvers = core.read_verfile(s.oldver) if s.oldver else {}
  newvers = core.read_verfile(s.newver)
  for name, newver in sorted(newvers.items()):
    oldver = oldvers.get(name, None)
    if oldver != newver:
      print('%s %s -> %s' % (name, oldver, newver))
github lilydjwg / nvchecker / nvchecker / tools.py View on Github external
def cmp():
  parser = argparse.ArgumentParser(description='compare version records of nvchecker')
  core.add_common_arguments(parser)
  args = parser.parse_args()
  if core.process_common_arguments(args):
    return

  s = core.Source(args.file)
  oldvers = core.read_verfile(s.oldver) if s.oldver else {}
  newvers = core.read_verfile(s.newver)
  for name, newver in sorted(newvers.items()):
    oldver = oldvers.get(name, None)
    if oldver != newver:
      print('%s %s -> %s' % (name, oldver, newver))