def main(args, extra): enc = Encyclopedia(config_file=args.config_file) # Case 1: empty list indicates listing all if not args.uid: bot.error("Please provide a unique resource identifier to search for.") else: if enc.exists(args.uid): print(f"{args.uid} exists.") else: print(f"{args.uid} does not exist.")
def create(self, database=None, config_file=None): """After a scrape (whether we obtain latest or a search query) we run create to create software repositories based on results. """ from rse.main import Encyclopedia client = Encyclopedia(config_file=config_file, database=database) for repo_id in self.results: repo = get_parser(repo_id) # Add results that don't exist if not client.exists(repo.uid): client.add(repo.uid)
def create(self, database=None, config_file=None): """After a scrape (whether we obtain latest or a search query) we run create to create software repositories based on results. """ from rse.main import Encyclopedia client = Encyclopedia(config_file=config_file, database=database) for result in self.results: uid = result["url"].split("//")[-1] repo = get_parser(uid) # Add results that don't exist if not client.exists(repo.uid): client.add(repo.uid) if result.get("doi"): client.label(repo.uid, key="doi", value=result.get("doi"))
def create(self, database=None, config_file=None): """After a scrape (whether we obtain latest or a search query) we run create to create software repositories based on results. """ from rse.main import Encyclopedia client = Encyclopedia(config_file=config_file, database=database) for result in self.results: uid = result["url"].split("//")[-1] # If a repository is added that isn't represented try: repo = get_parser(uid) except NotImplementedError as exc: bot.warning(exc) continue # Add results that don't exist if not client.exists(repo.uid): client.add(repo.uid) client.label(repo.uid, key="doi", value=result.get("doi"))