print some progress report

This commit is contained in:
Peter Körner 2017-05-24 14:20:45 +02:00
parent fb0a88ee61
commit 15a476fb35

View file

@ -40,11 +40,14 @@ parser.add_argument('--id', dest='ids', nargs='+', action="store", type=int, hel
args = parser.parse_args() args = parser.parse_args()
def error(str): def headline(str):
print("##################################################") print("##################################################")
print(str) print(str)
print("##################################################") print("##################################################")
print() print()
def error(str):
headline(str)
parser.print_help() parser.print_help()
sys.exit(1) sys.exit(1)
@ -66,7 +69,7 @@ if args.debug:
}] }]
else: else:
events = renderlib.events(args.schedule) events = list(renderlib.events(args.schedule))
def run_check(command, **kwargs): def run_check(command, **kwargs):
args = {} args = {}
@ -120,10 +123,16 @@ def render(event):
n = len(events)
i = 0
for event in events: for event in events:
i = i + 1
if args.ids and event['id'] not in args.ids: if args.ids and event['id'] not in args.ids:
continue continue
print("rendering", event) headline("rendering {i}/{n}: #{id}: {title}".format(
i=i, n=n,
id=event['id'],
title=event['title']))
render(event) render(event)