also parse users without "end:"

This commit is contained in:
Thomas Renger 2020-02-29 16:37:31 +01:00
parent 33a6e74aa8
commit 5cb8b8b7e0
1 changed files with 5 additions and 6 deletions

View File

@ -72,16 +72,15 @@ if len(sys.argv) > 1:
parse_feeds(weeks, l[3]) parse_feeds(weeks, l[3])
else: else:
for (username, u) in list(users.items()): for (username, u) in list(users.items()):
print("User: ",u)
if 'end' in u: if 'end' in u:
enddate = datetime.datetime.strptime(u['end'],'%Y/%m/%d') enddate = datetime.datetime.strptime(u['end'],'%Y/%m/%d')
if enddate < datetime.datetime.now(): if enddate < datetime.datetime.now():
print("User inactive") print("User inactive: ", username)
continue continue
blogs = log.setdefault(username, {}) blogs = log.setdefault(username, {})
for l in u['links']: for l in u['links']:
weeks = blogs.setdefault(l[0], []) weeks = blogs.setdefault(l[0], [])
parse_feeds(weeks, l[3]) parse_feeds(weeks, l[3])
with open('out/report.yml', 'w') as f: with open('out/report.yml', 'w') as f:
yaml.safe_dump(log, f) yaml.safe_dump(log, f)