git @ Cat's Eye Technologies klaus / 67a3c15
Rewrote Git/PyPI version guessing Jonas Haag 12 years ago
3 changed file(s) with 9 addition(s) and 9 deletion(s). Raw diff Collapse all Expand all
0 recursive-include klaus/static *
1 recursive-include klaus/templates *
0 import os
1 import subprocess
20 import jinja2
31 import flask
42 import httpauth
75 from klaus.repo import FancyRepo
86
97
10 KLAUS_ROOT = os.path.dirname(__file__)
11
12 try:
13 KLAUS_VERSION = utils.check_output(['git', 'log', '--format=%h', '-n', '1']).strip()
14 except subprocess.CalledProcessError:
15 KLAUS_VERSION = '0.2'
8 KLAUS_VERSION = utils.guess_git_revision() or '0.2'
169
1710
1811 class Klaus(flask.Flask):
00 # encoding: utf-8
1
1 import os
22 import re
33 import time
44 import datetime
221221 cmd = popenargs[0]
222222 raise CalledProcessError(retcode, cmd, output=output)
223223 return output
224
225
226 def guess_git_revision():
227 if os.path.exists(os.path.join(os.path.dirname(__file__), '..', '.git')):
228 return check_output(['git', 'log', '--format=%h', '-n', '1']).strip()