-
Notifications
You must be signed in to change notification settings - Fork 1
/
function.py
56 lines (42 loc) · 1.25 KB
/
function.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
import output as out
def changelist(listofpdfs):
while True:
out.head("Order (x=exit)")
out.showlist(listofpdfs)
pos1 = input("│ Change > ")
if pos1.upper() == "X":
break
pos2 = input("│ To > ")
if pos2.upper() == "X":
break
try:
pos1 = int(pos1) - 1
pos2 = int(pos2) - 1
except ValueError:
print("│ [INFO] Need a numeric input for change")
try:
tmp = listofpdfs[pos1]
listofpdfs[pos1] = listofpdfs[pos2]
listofpdfs[pos2] = tmp
except IndexError:
print("│ [INFO] Wrong index input")
out.endblock()
out.endblock()
return listofpdfs
def editlist(listofpdfs):
while True:
out.head("Exclude (x=exit)")
out.showlist(listofpdfs)
pos = input("│ Exclude > ")
if pos.upper() == "X":
out.endblock()
return listofpdfs
try:
pos = int(pos) - 1
except ValueError:
print("│ [INFO] Need a numeric input for change")
try:
listofpdfs.pop(pos)
except IndexError:
print("│ [INFO] Wrong index input")
out.endblock()