add counts to reload

This commit is contained in:
Daniel 2024-10-01 02:52:27 -05:00
parent 0c206d5f4d
commit 0a730ae7f7

View File

@ -2,11 +2,23 @@ import extract
import search import search
import insert import insert
def start():
extract.parse()
print("Existing:", extract.existing)
print("Inserted:", extract.inserted)
print("To big:", extract.big)
print("Dupes:", extract.duplicates)
menu()
def prompt(): def prompt():
return input("Search Value: ") return input("Search Value: ")
def menu(): def menu():
value = prompt() value = prompt()
if value == "reload":
extract.parse()
value = prompt()
while value != "quit" or value != "reload": while value != "quit" or value != "reload":
results = search.query(value) results = search.query(value)
if type(results) == dict: if type(results) == dict:
@ -15,19 +27,10 @@ def menu():
for doc in results: for doc in results:
print(doc["index"], " : ", doc["title"]) print(doc["index"], " : ", doc["title"])
value = prompt() value = prompt()
if value == "reload":
extract.parse()
value = prompt()
def main(): def main():
start()
extract.parse()
print("Existing:", extract.existing)
print("Inserted:", extract.inserted)
print("To big:", extract.big)
print("Dupes:", extract.duplicates)
menu()
if __name__ == '__main__': if __name__ == '__main__':
main() main()