Added page number input.

This commit is contained in:
eworc778 2024-08-19 21:07:32 +01:00
parent cf080cce1d
commit a11d481661

24
main.py
View File

@ -9,14 +9,17 @@ mainCategory = ""
subCategory = "" 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 to get the URI of the printer at the file in ~/.local/share/scan-auto/printer_uri
try: try:
f = open(home+"/.local/share/scan-auto/printer_uri", "r") f = open(home+"/.local/share/scan-auto/printer_uri", "r")
print("Printer URI is:")
print(f.readline()) print(f.readline())
printerURI = f.readline() printerURI = f.readline()
@ -40,6 +43,9 @@ while mainCategory == "":
os.system("clear") os.system("clear")
print("Invalid input, please try again:") print("Invalid input, please try again:")
#Keep the terminal clean :)
print("")
while subCategory == "": while subCategory == "":
try: try:
@ -53,3 +59,19 @@ while subCategory == "":
#Not best way to do this, but it's a small script, so idc :shrug: #Not best way to do this, but it's a small script, so idc :shrug:
os.system("clear") os.system("clear")
print("Invalid input, please try again:") 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:")