forked from colinxfleming/simpsons_data
-
Notifications
You must be signed in to change notification settings - Fork 0
/
remaining_report.py
executable file
·31 lines (22 loc) · 977 Bytes
/
remaining_report.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
#!/usr/bin/env python
"""A quick and dirty script to log what episodes still need review."""
import os
import yaml
basedir = os.path.dirname(os.path.realpath(__file__))
all_data = {'episodes': [], 'characters': []}
for datatype in all_data.keys():
data_files = os.listdir(os.path.join(basedir, datatype))
for f in data_files:
content = yaml.load(
open(os.path.join(basedir, datatype, f)))
all_data[datatype] = all_data[datatype] + content[datatype]
all_data['episodes'].sort(key=lambda x: (x['season'], x['episode']))
all_data['characters'].sort(key=lambda x: (x['short_name']))
print('***EPISODE GOODNESS/BADNESS TO REVIEW***\n')
for ep in all_data['episodes']:
if isinstance(ep['good'], str):
print(f"{ep['season']}-{ep['episode']} - {ep['title']}")
print('\nEPISODES TO LOG CHARACTERS')
for ep in all_data['episodes']:
if ep['characters'] is None:
print(f"{ep['season']}-{ep['episode']} - {ep['title']}")