Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Show a small calendar in the acdp report file

This should make it easier to figure out which days are weekends etc.
  • Loading branch information...
commit 41a1e74d8712ae5ee3c669d118976d0cd7ebe3c9 1 parent e7a7617
bhdn authored
Showing with 10 additions and 0 deletions.
  1. +10 −0 acdp.py
10 acdp.py
View
@@ -17,6 +17,7 @@
import os
import difflib
import time
+import subprocess
CONFIGFILE = os.environ.get("ACDP_CONF", os.path.expanduser("~/.acdp"))
@@ -252,8 +253,17 @@ def leave(name_in, name_out, retcode=0):
recent_projects = acdp.list_recent()
hours = acdp.list_hours(year, month)
+ cmdline = ["cal", str(month), str(year)]
+ try:
+ output = subprocess.check_output(cmdline, shell=False)
+ except subprocess.CalledProcessError, e:
+ sys.stderr.write("warning: command %r failed: %s\n" % (cmdline, e))
+ else:
+ fd_in.writelines(("# %s\n" % line) for line in output.splitlines())
+
print >>fd_in, "# acdp data for %s / %s" % (month, year)
print >>fd_in, "# cache of recent projects:"
+
projects = {}
for id, project in recent_projects:
print >>fd_in, "# %s - %s" % (id, project)
Please sign in to comment.
Something went wrong with that request. Please try again.