diff --git a/etc/project.vars b/etc/project.vars index b8c3ff77..ef187c61 100644 --- a/etc/project.vars +++ b/etc/project.vars @@ -1,7 +1,7 @@ export venv_dir="env" export spec="" -export venv="`which virtualenv-2.7`" -if [ x"$venv" = x ]; then - export venv="`which virtualenv`" - export spec="-p 2.7" -fi +export venv="/usr/bin/virtualenv" +#if [ x"$venv" = x ]; then +# export venv="`which virtualenv`" +# export spec="-p 2.7" +#fi diff --git a/etc/reqs.txt b/etc/reqs.txt index 1a8f01ca..6d3c2b87 100644 --- a/etc/reqs.txt +++ b/etc/reqs.txt @@ -1,11 +1,13 @@ pytz>=2012 -Flask==1.0.2 -Babel==1.3 -Flask-Babel==0.9 -Flask-Caching==1.4.0 -Jinja2==2.10 -Pygments==1.6 -python-ctags -docutils==0.11 +Flask==3.0.0 +Babel==2.13.1 +Flask-Babel==4.0.0 +Flask-Caching==2.1.0 +Jinja2==3.1.2 +Pygments>=1.6 +python-ctags3 +docutils==0.20.1 gunicorn==0.17.2 -werkzeug==0.16.1 +werkzeug>=0.16.1 +markupsafe>=2.0.1 +six \ No newline at end of file diff --git a/i2p2www/__init__.py b/i2p2www/__init__.py index e85c27f1..20d22817 100644 --- a/i2p2www/__init__.py +++ b/i2p2www/__init__.py @@ -1,6 +1,7 @@ # -*- coding: utf-8 -*- from __future__ import absolute_import -from flask import Flask, request, g, redirect, url_for, abort, render_template, send_from_directory, safe_join +from flask import Flask, request, g, redirect, url_for, abort, render_template, send_from_directory +from werkzeug.utils import safe_join try: from flaskext.babel import Babel except ImportError: @@ -141,7 +142,7 @@ cache = Cache(app, config=CACHE_CONFIG) ################# # Babel selectors -@babel.localeselector +#@babel.localeselector def get_locale(): # If viewing specs, require English if request.path.startswith('/spec'): @@ -153,7 +154,7 @@ def get_locale(): # header the browser transmits. The best match wins. return request.accept_languages.best_match(SUPPORTED_LANGS) -@babel.domainselector +#@babel.domainselector def get_domains(): domains = [] frags = request.path.split('/', 2) @@ -168,6 +169,7 @@ def get_domains(): domains.append(DEFAULT_GETTEXT_DOMAIN) return domains +babel.init_app(app, locale_selector=get_locale, default_domain=get_domains) ########################## # Hooks - helper functions diff --git a/i2p2www/formatters.py b/i2p2www/formatters.py index e07defaa..8351f60b 100644 --- a/i2p2www/formatters.py +++ b/i2p2www/formatters.py @@ -14,11 +14,14 @@ from __future__ import print_function import os import sys import os.path -import StringIO +try: + from StringIO import StringIO +except ImportError: + from io import StringIO from pygments.formatter import Formatter from pygments.token import Token, Text, STANDARD_TYPES -from pygments.util import get_bool_opt, get_int_opt, get_list_opt, bytes +from pygments.util import get_bool_opt, get_int_opt, get_list_opt#, bytes import six from six.moves import range diff --git a/i2p2www/helpers.py b/i2p2www/helpers.py index 54e9d8e1..f338e229 100644 --- a/i2p2www/helpers.py +++ b/i2p2www/helpers.py @@ -1,6 +1,6 @@ from __future__ import absolute_import from math import ceil -from werkzeug import import_string, cached_property +from werkzeug.utils import cached_property, import_string from six.moves import range ######################## diff --git a/i2p2www/templatevars.py b/i2p2www/templatevars.py index e5e53289..fdf7ad3c 100644 --- a/i2p2www/templatevars.py +++ b/i2p2www/templatevars.py @@ -1,6 +1,7 @@ from __future__ import absolute_import import ctags -from flask import g, request, safe_join, url_for +from flask import g, request, url_for +from werkzeug.utils import safe_join import os.path from six.moves.urllib.parse import urlsplit, urlunsplit