I2P Address: [http://git.idk.i2p]

Skip to content
Snippets Groups Projects
Commit deb775d2 authored by eyedeekay's avatar eyedeekay
Browse files

Port it to python3

parent 8ebc4de1
No related branches found
No related tags found
1 merge request!25WIP: Upgrade it to Python 3
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
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
# -*- 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
......
......@@ -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
......
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
########################
......
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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment