From 8c69c1338b3a517fac82b86cdaf0df73446c5fcd Mon Sep 17 00:00:00 2001 From: Nelson Elhage Date: Mon, 28 Dec 2009 18:18:14 -0500 Subject: [PATCH] Script to print the results for a given week --- show-week.py | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 show-week.py diff --git a/show-week.py b/show-week.py new file mode 100644 index 0000000..a21f14c --- /dev/null +++ b/show-week.py @@ -0,0 +1,28 @@ +import yaml +from dateutil.parser import parse +import datetime +import dateutil.tz as tz +import sys + +START = datetime.datetime(2009, 12, 21, 6) + +with open('report.yml') as r: + report = yaml.safe_load(r) + +with open('bloggers.yml') as f: + users = yaml.safe_load(f) + +week = (parse(sys.argv[1], default=START) - START).days / 7 +week_start = START + (week * datetime.timedelta(7)) +week_end = START + ((week + 1) * datetime.timedelta(7)) + + +for (name, weeks) in report.items(): + user_start = parse(users[name]['start'], default=START) + if user_start > week_start: + print "SKIP %s" % (name,) + continue + elif len(weeks) <= week or not weeks[week]: + print "LAME %s" % (name,) + else: + print "OK %s" % (name,) -- 2.39.5