Rewrote Git/PyPI version guessing
Jonas Haag
12 years ago
|
0 |
recursive-include klaus/static *
|
|
1 |
recursive-include klaus/templates *
|
0 | |
import os
|
1 | |
import subprocess
|
2 | 0 |
import jinja2
|
3 | 1 |
import flask
|
4 | 2 |
import httpauth
|
|
7 | 5 |
from klaus.repo import FancyRepo
|
8 | 6 |
|
9 | 7 |
|
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'
|
16 | 9 |
|
17 | 10 |
|
18 | 11 |
class Klaus(flask.Flask):
|
0 | 0 |
# encoding: utf-8
|
1 | |
|
|
1 |
import os
|
2 | 2 |
import re
|
3 | 3 |
import time
|
4 | 4 |
import datetime
|
|
221 | 221 |
cmd = popenargs[0]
|
222 | 222 |
raise CalledProcessError(retcode, cmd, output=output)
|
223 | 223 |
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()
|