-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmenu.py
59 lines (40 loc) · 1.43 KB
/
menu.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
57
58
59
import getCommands, settings, csv, subprocess
from time import sleep
def sendCommands():
for i in range(episodeQty):
if episodes[i] != ['case', 'disk', 'title']:
cmd = getCommands.allEpisodes(episodeQty, i + 1)
if cmd != False:
print('\nLog: Running "' + ' '.join(cmd) + '"')
#output = Popen(["mycmd", "myarg"], stdout=PIPE).communicate()[0]
log = subprocess.run(cmd, stdout=subprocess.PIPE)#.communicate()[0]
print('Log:', episodes[i], 'is finished.\n')
else:
print('\nLog:', episodes[i], 'was set to not rip. If you would like to rip it, set "Rip: " to "True" in its associated .yml file.\n')
def main():
print('\n1. Begin automated transcode')
print('2. Enter Settings Manager to show or edit settings')
print('3. Exit')
choice = int(input(' : '))
if choice == 1:
sendCommands()
elif choice == 2:
settings.main()
start()
elif choice == 3:
exit()
else:
print('Unknown option "' + choice + '".')
def start():
print("\n\n *** HandBrake TV Show Transcode Automator *** ")
global rawSettings, prettySettings, episodeQty, episodes
# get current settings
rawSettings, prettySettings = settings.getSettings(False)
with open('/'.join([rawSettings['Episode Output Directory'], rawSettings['Episode List Name']]), 'r') as csvfile1:
episodeList = csv.reader(csvfile1, delimiter=',')
episodes = []
for row in episodeList:
episodes.append(row)
episodeQty = len(episodes) - 1
main()
start()