added cli interface for metadata download. Now just need to... really download the metadata

This commit is contained in:
Lars Noack 2022-10-14 16:55:23 +02:00
parent 713949d35f
commit 7e07d798b3
3 changed files with 32 additions and 0 deletions

31
src/main.py Normal file
View File

@ -0,0 +1,31 @@
import metadata
def search_for_metadata(query: str):
search = metadata.Search(query=query)
print(search.options)
while True:
input_ = input("q to quit, ok to download, .. for previous options, . for current options, int for this element: ").lower()
input_.strip()
if input_ == "q":
exit(0)
if input_ == "ok":
return search
if input_ == ".":
print(search.options)
continue
if input_ == "..":
print(search.get_previous_options())
continue
if input_.isdigit():
print(search.choose(int(input_)))
continue
def cli():
search = search_for_metadata(query=input("initial query: "))
if __name__ == "__main__":
cli()

View File

@ -180,6 +180,7 @@ def automated_demo():
print(search.get_previous_options()) print(search.get_previous_options())
print(search.choose(6)) print(search.choose(6))
def interactive_demo(): def interactive_demo():
search = Search(query=input("initial query: ")) search = Search(query=input("initial query: "))
print(search.options) print(search.options)