Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
2fd7910194
|
|||
|
c2e53072f7
|
|||
|
c2986f3b14
|
|||
|
57854169f4
|
@@ -1,21 +1,5 @@
|
||||
blinker==1.7.0
|
||||
Brotli==1.1.0
|
||||
cachetools==5.3.3
|
||||
click==8.1.7
|
||||
defusedxml==0.7.1
|
||||
Flask==3.0.2
|
||||
gevent==24.2.1
|
||||
greenlet==3.0.3
|
||||
iniconfig==2.0.0
|
||||
itsdangerous==2.1.2
|
||||
Jinja2==3.1.4
|
||||
MarkupSafe==2.1.5
|
||||
packaging==24.0
|
||||
pluggy==1.4.0
|
||||
PySocks==1.7.1
|
||||
pytest==8.1.1
|
||||
stem==1.8.2
|
||||
urllib3==2.2.2
|
||||
Werkzeug==3.0.3
|
||||
zope.event==5.0
|
||||
zope.interface==6.2
|
||||
# Include all production requirements
|
||||
-r requirements.txt
|
||||
|
||||
# Development requirements
|
||||
pytest>=6.2.1
|
||||
|
||||
@@ -1,17 +1,8 @@
|
||||
blinker==1.7.0
|
||||
Brotli==1.1.0
|
||||
cachetools==5.3.3
|
||||
click==8.1.7
|
||||
defusedxml==0.7.1
|
||||
Flask==3.0.2
|
||||
gevent==24.2.1
|
||||
greenlet==3.0.3
|
||||
itsdangerous==2.1.2
|
||||
Jinja2==3.1.4
|
||||
MarkupSafe==2.1.5
|
||||
PySocks==1.7.1
|
||||
stem==1.8.2
|
||||
urllib3==2.2.2
|
||||
Werkzeug==3.0.3
|
||||
zope.event==5.0
|
||||
zope.interface==6.2
|
||||
Flask>=1.0.3
|
||||
gevent>=1.2.2
|
||||
Brotli>=1.0.7
|
||||
PySocks>=1.6.8
|
||||
urllib3>=1.24.1
|
||||
defusedxml>=0.5.0
|
||||
cachetools>=4.0.0
|
||||
stem>=1.8.0
|
||||
|
||||
@@ -121,7 +121,7 @@ def error_page(e):
|
||||
elif (exc_info()[0] == util.FetchError
|
||||
and exc_info()[1].code == '404'
|
||||
):
|
||||
error_message = ('Error: The page you are looking for isn\'t here. ¯\_(ツ)_/¯')
|
||||
error_message = ('Error: The page you are looking for isn\'t here.')
|
||||
return flask.render_template('error.html',
|
||||
error_code=exc_info()[1].code,
|
||||
error_message=error_message,
|
||||
|
||||
@@ -11,17 +11,10 @@ import subprocess
|
||||
def app_version():
|
||||
def minimal_env_cmd(cmd):
|
||||
# make minimal environment
|
||||
env = {}
|
||||
for k in ['SYSTEMROOT', 'PATH']:
|
||||
v = os.environ.get(k)
|
||||
if v is not None:
|
||||
env[k] = v
|
||||
env = {k: os.environ[k] for k in ['SYSTEMROOT', 'PATH'] if k in os.environ}
|
||||
env.update({'LANGUAGE': 'C', 'LANG': 'C', 'LC_ALL': 'C'})
|
||||
|
||||
env['LANGUAGE'] = 'C'
|
||||
env['LANG'] = 'C'
|
||||
env['LC_ALL'] = 'C'
|
||||
out = subprocess.Popen(
|
||||
cmd, stdout=subprocess.PIPE, env=env).communicate()[0]
|
||||
out = subprocess.Popen(cmd, stdout=subprocess.PIPE, env=env).communicate()[0]
|
||||
return out
|
||||
|
||||
subst_list = {
|
||||
@@ -31,24 +24,21 @@ def app_version():
|
||||
}
|
||||
|
||||
if os.system("command -v git > /dev/null 2>&1") != 0:
|
||||
subst_list
|
||||
else:
|
||||
if call(["git", "branch"], stderr=STDOUT,
|
||||
stdout=open(os.devnull, 'w')) != 0:
|
||||
subst_list
|
||||
else:
|
||||
# version
|
||||
describe = minimal_env_cmd(["git", "describe", "--always"])
|
||||
git_revision = describe.strip().decode('ascii')
|
||||
# branch
|
||||
branch = minimal_env_cmd(["git", "branch"])
|
||||
git_branch = branch.strip().decode('ascii').replace('* ', '')
|
||||
return subst_list
|
||||
|
||||
subst_list = {
|
||||
"version": __version__,
|
||||
"branch": git_branch,
|
||||
"commit": git_revision
|
||||
}
|
||||
if call(["git", "branch"], stderr=STDOUT, stdout=open(os.devnull, 'w')) != 0:
|
||||
return subst_list
|
||||
|
||||
describe = minimal_env_cmd(["git", "describe", "--tags", "--always"])
|
||||
git_revision = describe.strip().decode('ascii')
|
||||
|
||||
branch = minimal_env_cmd(["git", "branch"])
|
||||
git_branch = branch.strip().decode('ascii').replace('* ', '')
|
||||
|
||||
subst_list.update({
|
||||
"branch": git_branch,
|
||||
"commit": git_revision
|
||||
})
|
||||
|
||||
return subst_list
|
||||
|
||||
|
||||
@@ -318,7 +318,7 @@ def fetch_url(url, headers=(), timeout=15, report_text=None, data=None,
|
||||
cleanup_func(response) # release_connection for urllib3
|
||||
content = decode_content(
|
||||
content,
|
||||
response.getheader('Content-Encoding', default='identity'))
|
||||
response.headers.get('Content-Encoding', default='identity'))
|
||||
|
||||
if (settings.debugging_save_responses
|
||||
and debug_name is not None
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
from __future__ import unicode_literals
|
||||
|
||||
__version__ = '0.2.20'
|
||||
__version__ = '0.2.21'
|
||||
|
||||
Reference in New Issue
Block a user