def handle(self, *args, **options): set_verbosity_level(logger, options.get("verbosity", 1)) if options['all']: packages = None elif len(args): packages = [pkg for pkg in args] else: packages = [pkg[:-1] for pkg in sys.stdin.readlines()] scan_upstream( packages=packages, purge_versions=options["purge-versions"], logger=logger, )
def scan_upstream(packages=[], purge_versions=False): """ Scans upstream for the given set of packages """ logger = scan_upstream.get_logger() if packages: logger.info("Starting upstream scan subtask for %d packages...", len(packages)) else: logger.info("Starting upstream scan...") scan.scan_upstream( packages=packages, purge_versions=purge_versions, logger=logger, ) return True