diff --git a/main.py b/main.py index c61ff3b..e3bd3a7 100644 --- a/main.py +++ b/main.py @@ -12,14 +12,44 @@ subCategory = "" pageNumber = -1 +#Try to get the URI of the printer at the file in ~/.local/share/scan-auto/printer_uri + +try: + + f = open(home+"/.local/share/scan-auto/printer_uri", "r") + print(f.readline()) + + printerURI = f.readline() +except: + print("Please create a file at " + home + "/.local/share/scan-auto/printer_uri") + + print("And populate it with the hp-probe URI of your printer, e.g: escl:https://192.168.X.XX:443") + + exit() + while mainCategory == "": try: - mainCategory = str(input("Main Category Of Document: ")) + mainCategory = str(input("Main category of document: ")) except: mainCategory = "" if mainCategory == "": + #Not best way to do this, but it's a small script, so idc :shrug: + os.system("clear") + print("Invalid input, please try again:") +while subCategory == "": + try: + subCategory = str(input("Subcategory of document: ")) + + except: + + subCategory = "" + + if subCategory == "": + #Not best way to do this, but it's a small script, so idc :shrug: + os.system("clear") + print("Invalid input, please try again:")