Skip to content

Commit

Permalink
applied fixes from mako hill: fix bug that always placed today's date…
Browse files Browse the repository at this point in the history
… into the punt git commit log
  • Loading branch information
chaosblog committed Jul 9, 2012
1 parent 3b86b9a commit 0509329
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions weekly-update.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
args = args[1:]

date = args[0]
today = str(datetime.date.today())

with open('ledger', 'a') as f:
f.write("\n")
Expand All @@ -44,10 +43,10 @@
if debt < 30: continue
punt.append(user)
f.write("""\
%(today)s Punt
%(date)s Punt
Pool:Owed:%(user)s $-%(debt)s
User:%(user)s
""" % {'user': user, 'debt': debt, 'today': today})
""" % {'user': user, 'debt': debt, 'date': date})


if not dry_run:
Expand Down Expand Up @@ -83,12 +82,12 @@
bloggers = yaml.safe_load(b)
for p in punt:
if 'end' not in bloggers[p]:
bloggers[p]['end'] = today
bloggers[p]['end'] = date
with open('bloggers.yml','w') as b:
yaml.safe_dump(bloggers, b)

subprocess.check_call(["git", "commit", "ledger", "bloggers.yml",
"-m", "Punts for %s" % (today,)])
"-m", "Punts for %s" % (date,)])

# if it's a dry run, lets set the ledger back to the beginning state
if dry_run:
Expand Down

0 comments on commit 0509329

Please sign in to comment.