How to use the nvchecker.get_version.get_version 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 / tests / helper.py View on Github external
def sync_get_version(self, name, config):
        def get_version_callback(name, version):
            self.stop(version)

        if isinstance(config, dict):
            _config = configparser.ConfigParser(dict_type=dict, allow_no_value=True)
            _config.read_dict({name: config})
            config = _config[name]

        get_version(name, config, get_version_callback)
        return self.wait()
github lilydjwg / nvchecker / nvchecker / core.py View on Github external
async def worker(name, conf):
      await token_q.get()
      try:
        for i in range(tries):
          try:
            ret = await get_version(
              name, conf, keyman=self.keymanager)
            return name, ret
          except Exception as e:
            if i + 1 < tries:
              logger.warning('failed, retrying',
                             name=name, exc_info=e)
              await asyncio.sleep(i)
            else:
              return name, e
      finally:
        await token_q.put(True)