remove Jinja2 dependency
This commit is contained in:
parent
c96913f221
commit
2794734258
@ -54,8 +54,6 @@ from werkzeug.wsgi import SharedDataMiddleware
|
|||||||
from werkzeug.serving import run_simple
|
from werkzeug.serving import run_simple
|
||||||
from werkzeug.contrib.fixers import ProxyFix
|
from werkzeug.contrib.fixers import ProxyFix
|
||||||
|
|
||||||
from jinja2 import Environment, FileSystemLoader
|
|
||||||
|
|
||||||
from isso import db, migrate, views, wsgi
|
from isso import db, migrate, views, wsgi
|
||||||
from isso.core import ThreadedMixin, uWSGIMixin, Config
|
from isso.core import ThreadedMixin, uWSGIMixin, Config
|
||||||
from isso.utils import parse, http
|
from isso.utils import parse, http
|
||||||
@ -94,7 +92,6 @@ class Isso(object):
|
|||||||
self.conf = conf
|
self.conf = conf
|
||||||
self.db = db.SQLite3(conf.get('general', 'dbpath'), conf)
|
self.db = db.SQLite3(conf.get('general', 'dbpath'), conf)
|
||||||
self.signer = URLSafeTimedSerializer(conf.get('general', 'session-key'))
|
self.signer = URLSafeTimedSerializer(conf.get('general', 'session-key'))
|
||||||
self.j2env = Environment(loader=FileSystemLoader(join(dirname(__file__), 'templates/')))
|
|
||||||
|
|
||||||
super(Isso, self).__init__(conf)
|
super(Isso, self).__init__(conf)
|
||||||
|
|
||||||
@ -109,10 +106,6 @@ class Isso(object):
|
|||||||
| misaka.EXT_SUPERSCRIPT | misaka.EXT_AUTOLINK \
|
| misaka.EXT_SUPERSCRIPT | misaka.EXT_AUTOLINK \
|
||||||
| misaka.HTML_SKIP_HTML | misaka.HTML_SKIP_IMAGES | misaka.HTML_SAFELINK)
|
| misaka.HTML_SKIP_HTML | misaka.HTML_SKIP_IMAGES | misaka.HTML_SAFELINK)
|
||||||
|
|
||||||
def render(self, tt, **ctx):
|
|
||||||
tt = self.j2env.get_template(tt)
|
|
||||||
return tt.render(**ctx)
|
|
||||||
|
|
||||||
def dispatch(self, request, start_response):
|
def dispatch(self, request, start_response):
|
||||||
adapter = rules.bind_to_environ(request.environ)
|
adapter = rules.bind_to_environ(request.environ)
|
||||||
try:
|
try:
|
||||||
|
2
setup.py
2
setup.py
@ -5,7 +5,7 @@ import sys
|
|||||||
|
|
||||||
from setuptools import setup, find_packages
|
from setuptools import setup, find_packages
|
||||||
|
|
||||||
requires = ['Jinja2>=2.7', 'werkzeug>=0.9', 'itsdangerous', 'misaka', 'html5lib']
|
requires = ['werkzeug>=0.9', 'itsdangerous', 'misaka', 'html5lib']
|
||||||
|
|
||||||
if (3, 0) <= sys.version_info < (3, 3):
|
if (3, 0) <= sys.version_info < (3, 3):
|
||||||
raise SystemExit("Python 3.0, 3.1 and 3.2 are not supported")
|
raise SystemExit("Python 3.0, 3.1 and 3.2 are not supported")
|
||||||
|
Loading…
Reference in New Issue
Block a user