diff --git a/main.py b/main.py index e3bd3a7..9bb44a7 100644 --- a/main.py +++ b/main.py @@ -9,14 +9,17 @@ mainCategory = "" subCategory = "" -pageNumber = -1 +numberOfPages = -1 +print("") #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("Printer URI is:") print(f.readline()) printerURI = f.readline() @@ -40,6 +43,9 @@ while mainCategory == "": os.system("clear") print("Invalid input, please try again:") +#Keep the terminal clean :) + +print("") while subCategory == "": try: @@ -53,3 +59,19 @@ while 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:") + +print("") + +while numberOfPages <= 0: + try: + numberOfPages = int(input("Number of pages for document: ")) + + except: + + numberOfPages = -1 + + if numberOfPages <= 0: + #Not best way to do this, but it's a small script, so idc :shrug: + os.system("clear") + print("Invalid input, please try again:") +