Updated CLI to follow APIs specified by the 0.12.0 engine
This commit is contained in:
@@ -31,15 +31,17 @@ async def run(args: Namespace):
|
||||
async with BIGSdbIndex() as bigsdb_index:
|
||||
if args.list_dbs:
|
||||
known_seqdef_dbs = await bigsdb_index.get_known_seqdef_dbs(force=False)
|
||||
print("The following are all known BIGS database names (sorted alphabetically):")
|
||||
print("\n".join(sorted(known_seqdef_dbs.keys())))
|
||||
|
||||
for bigsdb_schema_name in args.list_bigsdb_schemas:
|
||||
schemas = await bigsdb_index.get_schemas_for_seqdefdb(bigsdb_schema_name)
|
||||
print("The following are the known schemas for \"{0}\", and their associated IDs:".format(bigsdb_schema_name))
|
||||
for schema_desc, schema_id in schemas.items():
|
||||
print(f"{schema_desc}: {schema_id}")
|
||||
|
||||
if not (args.list_dbs or len(args.list_bigsdb_schemas) > 0):
|
||||
print("Nothing to do. Try specifying \"-l\".")
|
||||
print("Nothing to do. Try specifying \"-l\" for a list of known databases, or \"-h\" for more information.")
|
||||
|
||||
def run_asynchronously(args: Namespace):
|
||||
asyncio.run(run(args))
|
||||
|
||||
Reference in New Issue
Block a user