1 2 3 4 5 6 7 8 | import subprocess
_proc = subprocess.Popen('git log --no-color -n 1 --date=iso',
shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
try:
GIT_REVISION_DATE = [x.split('Date:')[1].split('+')[0].strip() for x in
_proc.communicate()[0].splitlines() if x.startswith('Date:')][0]
except IndexError:
GIT_REVISION_DATE = 'unknown'
|
More like this
- Digg-like pagination by SmileyChris 3 years, 12 months ago
- Git Revision Template Tag by sbaechler 6 months, 1 week ago
- "Zoom in" on rendered HTML that the test client returns by peterbe 4 years, 1 month ago
- really spaceless (trim spaces at line start) by wolfram 5 years, 4 months ago
- Generic CSV Export by zbyte64 4 years, 11 months ago
Comments
Is it only for Linux machines? Thanks...
#
Nice and simple idea. Since I prefer mercurial a slight modification will be needed though.
Thanks.
#