Show More
@@ -30,6 +30,10 b' Original author and date, and relevant c' | |||||
30 | import sys |
|
30 | import sys | |
31 | import platform |
|
31 | import platform | |
32 |
|
32 | |||
|
33 | # temporary aliasing to allow early introduction of imports like 'from tg import request' | |||
|
34 | import pylons | |||
|
35 | sys.modules['tg'] = pylons | |||
|
36 | ||||
33 | VERSION = (0, 3, 99) |
|
37 | VERSION = (0, 3, 99) | |
34 | BACKENDS = { |
|
38 | BACKENDS = { | |
35 | 'hg': 'Mercurial repository', |
|
39 | 'hg': 'Mercurial repository', |
@@ -19,7 +19,7 b' may take precedent over the more generic' | |||||
19 | refer to the routes manual at http://routes.groovie.org/docs/ |
|
19 | refer to the routes manual at http://routes.groovie.org/docs/ | |
20 | """ |
|
20 | """ | |
21 |
|
21 | |||
22 |
from |
|
22 | from tg import request | |
23 | from routes import Mapper |
|
23 | from routes import Mapper | |
24 |
|
24 | |||
25 | # prefix for non repository related links needs to be prefixed with `/` |
|
25 | # prefix for non repository related links needs to be prefixed with `/` |
@@ -28,7 +28,7 b' Original author and date, and relevant c' | |||||
28 |
|
28 | |||
29 | import logging |
|
29 | import logging | |
30 |
|
30 | |||
31 |
from |
|
31 | from tg import request, tmpl_context as c | |
32 | from sqlalchemy.orm import joinedload |
|
32 | from sqlalchemy.orm import joinedload | |
33 | from whoosh.qparser.default import QueryParser |
|
33 | from whoosh.qparser.default import QueryParser | |
34 | from whoosh.qparser.dateparse import DateParserPlugin |
|
34 | from whoosh.qparser.dateparse import DateParserPlugin |
@@ -27,8 +27,8 b' import logging' | |||||
27 | import formencode.htmlfill |
|
27 | import formencode.htmlfill | |
28 | import traceback |
|
28 | import traceback | |
29 |
|
29 | |||
30 |
from |
|
30 | from tg import request, tmpl_context as c | |
31 | from pylons.i18n.translation import _ |
|
31 | from tg.i18n import ugettext as _ | |
32 | from webob.exc import HTTPFound |
|
32 | from webob.exc import HTTPFound | |
33 |
|
33 | |||
34 | from kallithea.config.routing import url |
|
34 | from kallithea.config.routing import url |
@@ -30,8 +30,8 b' import traceback' | |||||
30 | import formencode |
|
30 | import formencode | |
31 | from formencode import htmlfill |
|
31 | from formencode import htmlfill | |
32 |
|
32 | |||
33 |
from |
|
33 | from tg import request, tmpl_context as c | |
34 | from pylons.i18n.translation import _ |
|
34 | from tg.i18n import ugettext as _ | |
35 | from webob.exc import HTTPFound |
|
35 | from webob.exc import HTTPFound | |
36 |
|
36 | |||
37 | from kallithea.config.routing import url |
|
37 | from kallithea.config.routing import url |
@@ -30,8 +30,8 b' import logging' | |||||
30 | import traceback |
|
30 | import traceback | |
31 | import formencode.htmlfill |
|
31 | import formencode.htmlfill | |
32 |
|
32 | |||
33 |
from |
|
33 | from tg import request, response, tmpl_context as c | |
34 | from pylons.i18n.translation import _ |
|
34 | from tg.i18n import ugettext as _ | |
35 | from webob.exc import HTTPFound, HTTPNotFound, HTTPForbidden |
|
35 | from webob.exc import HTTPFound, HTTPNotFound, HTTPForbidden | |
36 |
|
36 | |||
37 | from kallithea.config.routing import url |
|
37 | from kallithea.config.routing import url |
@@ -31,8 +31,8 b' import formencode' | |||||
31 |
|
31 | |||
32 | from sqlalchemy import func |
|
32 | from sqlalchemy import func | |
33 | from formencode import htmlfill |
|
33 | from formencode import htmlfill | |
34 |
from |
|
34 | from tg import request, tmpl_context as c | |
35 | from pylons.i18n.translation import _ |
|
35 | from tg.i18n import ugettext as _ | |
36 | from webob.exc import HTTPFound |
|
36 | from webob.exc import HTTPFound | |
37 |
|
37 | |||
38 | from kallithea.config.routing import url |
|
38 | from kallithea.config.routing import url |
@@ -28,8 +28,8 b' Original author and date, and relevant c' | |||||
28 | import logging |
|
28 | import logging | |
29 | import traceback |
|
29 | import traceback | |
30 |
|
30 | |||
31 |
from |
|
31 | from tg import request | |
32 |
from |
|
32 | from tg import tmpl_context as c | |
33 | from webob.exc import HTTPBadRequest, HTTPForbidden |
|
33 | from webob.exc import HTTPBadRequest, HTTPForbidden | |
34 |
|
34 | |||
35 | from kallithea.model.db import Notification |
|
35 | from kallithea.model.db import Notification |
@@ -31,8 +31,8 b' import traceback' | |||||
31 | import formencode |
|
31 | import formencode | |
32 | from formencode import htmlfill |
|
32 | from formencode import htmlfill | |
33 |
|
33 | |||
34 |
from |
|
34 | from tg import request, tmpl_context as c | |
35 | from pylons.i18n.translation import _ |
|
35 | from tg.i18n import ugettext as _ | |
36 | from webob.exc import HTTPFound |
|
36 | from webob.exc import HTTPFound | |
37 |
|
37 | |||
38 | from kallithea.config.routing import url |
|
38 | from kallithea.config.routing import url |
@@ -32,8 +32,8 b' import itertools' | |||||
32 |
|
32 | |||
33 | from formencode import htmlfill |
|
33 | from formencode import htmlfill | |
34 |
|
34 | |||
35 |
from |
|
35 | from tg import request, tmpl_context as c | |
36 |
from |
|
36 | from tg.i18n import ugettext as _, ungettext | |
37 | from webob.exc import HTTPFound, HTTPForbidden, HTTPNotFound, HTTPInternalServerError |
|
37 | from webob.exc import HTTPFound, HTTPForbidden, HTTPNotFound, HTTPInternalServerError | |
38 |
|
38 | |||
39 | import kallithea |
|
39 | import kallithea |
@@ -29,8 +29,8 b' import logging' | |||||
29 | import traceback |
|
29 | import traceback | |
30 | import formencode |
|
30 | import formencode | |
31 | from formencode import htmlfill |
|
31 | from formencode import htmlfill | |
32 |
from |
|
32 | from tg import request, tmpl_context as c | |
33 | from pylons.i18n.translation import _ |
|
33 | from tg.i18n import ugettext as _ | |
34 | from sqlalchemy.sql.expression import func |
|
34 | from sqlalchemy.sql.expression import func | |
35 | from webob.exc import HTTPFound, HTTPInternalServerError, HTTPForbidden, HTTPNotFound |
|
35 | from webob.exc import HTTPFound, HTTPInternalServerError, HTTPForbidden, HTTPNotFound | |
36 |
|
36 |
@@ -30,8 +30,8 b' import traceback' | |||||
30 | import formencode |
|
30 | import formencode | |
31 |
|
31 | |||
32 | from formencode import htmlfill |
|
32 | from formencode import htmlfill | |
33 |
from |
|
33 | from tg import request, tmpl_context as c, config | |
34 | from pylons.i18n.translation import _ |
|
34 | from tg.i18n import ugettext as _ | |
35 | from webob.exc import HTTPFound |
|
35 | from webob.exc import HTTPFound | |
36 |
|
36 | |||
37 | from kallithea.config.routing import url |
|
37 | from kallithea.config.routing import url |
@@ -30,8 +30,8 b' import traceback' | |||||
30 | import formencode |
|
30 | import formencode | |
31 |
|
31 | |||
32 | from formencode import htmlfill |
|
32 | from formencode import htmlfill | |
33 |
from |
|
33 | from tg import request, tmpl_context as c, config | |
34 | from pylons.i18n.translation import _ |
|
34 | from tg.i18n import ugettext as _ | |
35 | from webob.exc import HTTPFound |
|
35 | from webob.exc import HTTPFound | |
36 |
|
36 | |||
37 | from sqlalchemy.orm import joinedload |
|
37 | from sqlalchemy.orm import joinedload |
@@ -30,8 +30,8 b' import traceback' | |||||
30 | import formencode |
|
30 | import formencode | |
31 |
|
31 | |||
32 | from formencode import htmlfill |
|
32 | from formencode import htmlfill | |
33 |
from |
|
33 | from tg import request, tmpl_context as c, config | |
34 | from pylons.i18n.translation import _ |
|
34 | from tg.i18n import ugettext as _ | |
35 | from sqlalchemy.sql.expression import func |
|
35 | from sqlalchemy.sql.expression import func | |
36 | from webob.exc import HTTPFound, HTTPNotFound |
|
36 | from webob.exc import HTTPFound, HTTPNotFound | |
37 |
|
37 |
@@ -35,7 +35,7 b' import itertools' | |||||
35 | from paste.response import replace_header |
|
35 | from paste.response import replace_header | |
36 | from pylons.controllers import WSGIController |
|
36 | from pylons.controllers import WSGIController | |
37 | from pylons.controllers.util import Response |
|
37 | from pylons.controllers.util import Response | |
38 |
from |
|
38 | from tg import request | |
39 |
|
39 | |||
40 | from webob.exc import HTTPError |
|
40 | from webob.exc import HTTPError | |
41 |
|
41 |
@@ -30,7 +30,7 b' import traceback' | |||||
30 | import logging |
|
30 | import logging | |
31 | from sqlalchemy import or_ |
|
31 | from sqlalchemy import or_ | |
32 |
|
32 | |||
33 |
from |
|
33 | from tg import request | |
34 |
|
34 | |||
35 | from kallithea.controllers.api import JSONRPCController, JSONRPCError |
|
35 | from kallithea.controllers.api import JSONRPCController, JSONRPCError | |
36 | from kallithea.lib.auth import ( |
|
36 | from kallithea.lib.auth import ( |
@@ -28,8 +28,8 b' Original author and date, and relevant c' | |||||
28 | import logging |
|
28 | import logging | |
29 | import traceback |
|
29 | import traceback | |
30 |
|
30 | |||
31 |
from |
|
31 | from tg import request, session, tmpl_context as c | |
32 | from pylons.i18n.translation import _ |
|
32 | from tg.i18n import ugettext as _ | |
33 | from webob.exc import HTTPFound, HTTPNotFound, HTTPBadRequest |
|
33 | from webob.exc import HTTPFound, HTTPNotFound, HTTPBadRequest | |
34 |
|
34 | |||
35 | import kallithea.lib.helpers as h |
|
35 | import kallithea.lib.helpers as h |
@@ -29,8 +29,8 b' import logging' | |||||
29 | import traceback |
|
29 | import traceback | |
30 | from collections import defaultdict |
|
30 | from collections import defaultdict | |
31 |
|
31 | |||
32 |
from |
|
32 | from tg import tmpl_context as c, request, response | |
33 | from pylons.i18n.translation import _ |
|
33 | from tg.i18n import ugettext as _ | |
34 | from webob.exc import HTTPFound, HTTPForbidden, HTTPBadRequest, HTTPNotFound |
|
34 | from webob.exc import HTTPFound, HTTPForbidden, HTTPBadRequest, HTTPNotFound | |
35 |
|
35 | |||
36 | from kallithea.lib.vcs.exceptions import RepositoryError, \ |
|
36 | from kallithea.lib.vcs.exceptions import RepositoryError, \ |
@@ -30,8 +30,8 b' Original author and date, and relevant c' | |||||
30 | import logging |
|
30 | import logging | |
31 | import re |
|
31 | import re | |
32 |
|
32 | |||
33 |
from |
|
33 | from tg import request, tmpl_context as c | |
34 | from pylons.i18n.translation import _ |
|
34 | from tg.i18n import ugettext as _ | |
35 | from webob.exc import HTTPFound, HTTPBadRequest, HTTPNotFound |
|
35 | from webob.exc import HTTPFound, HTTPBadRequest, HTTPNotFound | |
36 |
|
36 | |||
37 | from kallithea.config.routing import url |
|
37 | from kallithea.config.routing import url |
@@ -29,8 +29,8 b' import os' | |||||
29 | import cgi |
|
29 | import cgi | |
30 | import logging |
|
30 | import logging | |
31 |
|
31 | |||
32 |
from |
|
32 | from tg import tmpl_context as c, request, config | |
33 | from pylons.i18n.translation import _ |
|
33 | from tg.i18n import ugettext as _ | |
34 | from pylons.middleware import media_path |
|
34 | from pylons.middleware import media_path | |
35 |
|
35 | |||
36 | from kallithea.lib.base import BaseController, render |
|
36 | from kallithea.lib.base import BaseController, render |
@@ -28,8 +28,8 b' Original author and date, and relevant c' | |||||
28 |
|
28 | |||
29 | import logging |
|
29 | import logging | |
30 |
|
30 | |||
31 |
from |
|
31 | from tg import response, tmpl_context as c | |
32 | from pylons.i18n.translation import _ |
|
32 | from tg.i18n import ugettext as _ | |
33 |
|
33 | |||
34 | from beaker.cache import cache_region, region_invalidate |
|
34 | from beaker.cache import cache_region, region_invalidate | |
35 | from webhelpers.feedgenerator import Atom1Feed, Rss201rev2Feed |
|
35 | from webhelpers.feedgenerator import Atom1Feed, Rss201rev2Feed |
@@ -32,8 +32,8 b' import traceback' | |||||
32 | import tempfile |
|
32 | import tempfile | |
33 | import shutil |
|
33 | import shutil | |
34 |
|
34 | |||
35 |
from |
|
35 | from tg import request, response, tmpl_context as c | |
36 | from pylons.i18n.translation import _ |
|
36 | from tg.i18n import ugettext as _ | |
37 | from webob.exc import HTTPFound |
|
37 | from webob.exc import HTTPFound | |
38 |
|
38 | |||
39 | from kallithea.config.routing import url |
|
39 | from kallithea.config.routing import url |
@@ -27,7 +27,7 b' Original author and date, and relevant c' | |||||
27 |
|
27 | |||
28 | import logging |
|
28 | import logging | |
29 |
|
29 | |||
30 |
from |
|
30 | from tg import tmpl_context as c, request | |
31 |
|
31 | |||
32 | from kallithea.lib.auth import LoginRequired, HasRepoPermissionLevelDecorator |
|
32 | from kallithea.lib.auth import LoginRequired, HasRepoPermissionLevelDecorator | |
33 | from kallithea.lib.base import BaseRepoController, render |
|
33 | from kallithea.lib.base import BaseRepoController, render |
@@ -30,8 +30,8 b' import formencode' | |||||
30 | import traceback |
|
30 | import traceback | |
31 | from formencode import htmlfill |
|
31 | from formencode import htmlfill | |
32 |
|
32 | |||
33 |
from |
|
33 | from tg import tmpl_context as c, request | |
34 | from pylons.i18n.translation import _ |
|
34 | from tg.i18n import ugettext as _ | |
35 | from webob.exc import HTTPFound |
|
35 | from webob.exc import HTTPFound | |
36 |
|
36 | |||
37 | import kallithea.lib.helpers as h |
|
37 | import kallithea.lib.helpers as h |
@@ -28,8 +28,8 b' Original author and date, and relevant c' | |||||
28 |
|
28 | |||
29 | import logging |
|
29 | import logging | |
30 |
|
30 | |||
31 |
from |
|
31 | from tg import tmpl_context as c, request | |
32 | from pylons.i18n.translation import _ |
|
32 | from tg.i18n import ugettext as _ | |
33 | from webob.exc import HTTPBadRequest |
|
33 | from webob.exc import HTTPBadRequest | |
34 | from sqlalchemy.sql.expression import func |
|
34 | from sqlalchemy.sql.expression import func | |
35 |
|
35 |
@@ -37,8 +37,8 b' from sqlalchemy.sql.expression import fu' | |||||
37 | from webhelpers.feedgenerator import Atom1Feed, Rss201rev2Feed |
|
37 | from webhelpers.feedgenerator import Atom1Feed, Rss201rev2Feed | |
38 |
|
38 | |||
39 | from webob.exc import HTTPBadRequest |
|
39 | from webob.exc import HTTPBadRequest | |
40 |
from |
|
40 | from tg import request, tmpl_context as c, response | |
41 | from pylons.i18n.translation import _ |
|
41 | from tg.i18n import ugettext as _ | |
42 |
|
42 | |||
43 | from kallithea.config.routing import url |
|
43 | from kallithea.config.routing import url | |
44 | from kallithea.controllers.admin.admin import _journal_filter |
|
44 | from kallithea.controllers.admin.admin import _journal_filter |
@@ -31,8 +31,8 b' import re' | |||||
31 | import formencode |
|
31 | import formencode | |
32 |
|
32 | |||
33 | from formencode import htmlfill |
|
33 | from formencode import htmlfill | |
34 | from pylons.i18n.translation import _ |
|
34 | from tg.i18n import ugettext as _ | |
35 |
from |
|
35 | from tg import request, session, tmpl_context as c | |
36 | from webob.exc import HTTPFound, HTTPBadRequest |
|
36 | from webob.exc import HTTPFound, HTTPBadRequest | |
37 |
|
37 | |||
38 | import kallithea.lib.helpers as h |
|
38 | import kallithea.lib.helpers as h |
@@ -29,8 +29,8 b' import logging' | |||||
29 | import traceback |
|
29 | import traceback | |
30 | import formencode |
|
30 | import formencode | |
31 |
|
31 | |||
32 |
from |
|
32 | from tg import request, tmpl_context as c | |
33 | from pylons.i18n.translation import _ |
|
33 | from tg.i18n import ugettext as _ | |
34 | from webob.exc import HTTPFound, HTTPNotFound, HTTPForbidden, HTTPBadRequest |
|
34 | from webob.exc import HTTPFound, HTTPNotFound, HTTPForbidden, HTTPBadRequest | |
35 |
|
35 | |||
36 | from kallithea.config.routing import url |
|
36 | from kallithea.config.routing import url |
@@ -28,8 +28,8 b' Original author and date, and relevant c' | |||||
28 | import logging |
|
28 | import logging | |
29 | import traceback |
|
29 | import traceback | |
30 | import urllib |
|
30 | import urllib | |
31 | from pylons.i18n.translation import _ |
|
31 | from tg.i18n import ugettext as _ | |
32 |
from |
|
32 | from tg import request, config, tmpl_context as c | |
33 |
|
33 | |||
34 | from whoosh.index import open_dir, EmptyIndexError |
|
34 | from whoosh.index import open_dir, EmptyIndexError | |
35 | from whoosh.qparser import QueryParser, QueryParserError |
|
35 | from whoosh.qparser import QueryParser, QueryParserError |
@@ -32,8 +32,8 b' import itertools' | |||||
32 | from time import mktime |
|
32 | from time import mktime | |
33 | from datetime import timedelta, date |
|
33 | from datetime import timedelta, date | |
34 |
|
34 | |||
35 |
from |
|
35 | from tg import tmpl_context as c, request | |
36 | from pylons.i18n.translation import _ |
|
36 | from tg.i18n import ugettext as _ | |
37 | from webob.exc import HTTPBadRequest |
|
37 | from webob.exc import HTTPBadRequest | |
38 |
|
38 | |||
39 | from beaker.cache import cache_region, region_invalidate |
|
39 | from beaker.cache import cache_region, region_invalidate |
@@ -33,8 +33,8 b' import collections' | |||||
33 |
|
33 | |||
34 | from decorator import decorator |
|
34 | from decorator import decorator | |
35 |
|
35 | |||
36 |
from |
|
36 | from tg import request, session | |
37 | from pylons.i18n.translation import _ |
|
37 | from tg.i18n import ugettext as _ | |
38 | from webhelpers.pylonslib import secure_form |
|
38 | from webhelpers.pylonslib import secure_form | |
39 | from sqlalchemy.orm.exc import ObjectDeletedError |
|
39 | from sqlalchemy.orm.exc import ObjectDeletedError | |
40 | from sqlalchemy.orm import joinedload |
|
40 | from sqlalchemy.orm import joinedload |
@@ -41,10 +41,10 b' import paste.auth.basic' | |||||
41 | import paste.httpheaders |
|
41 | import paste.httpheaders | |
42 | from webhelpers.pylonslib import secure_form |
|
42 | from webhelpers.pylonslib import secure_form | |
43 |
|
43 | |||
44 |
from |
|
44 | from tg import config, tmpl_context as c, request, response, session | |
45 | from pylons.controllers import WSGIController |
|
45 | from pylons.controllers import WSGIController | |
46 | from pylons.templating import render_mako as render # don't remove this import |
|
46 | from pylons.templating import render_mako as render # don't remove this import | |
47 | from pylons.i18n.translation import _ |
|
47 | from tg.i18n import ugettext as _ | |
48 |
|
48 | |||
49 | from kallithea import __version__, BACKENDS |
|
49 | from kallithea import __version__, BACKENDS | |
50 |
|
50 |
@@ -29,7 +29,7 b' Original author and date, and relevant c' | |||||
29 | import os |
|
29 | import os | |
30 | import logging |
|
30 | import logging | |
31 |
|
31 | |||
32 |
from |
|
32 | from tg import config | |
33 |
|
33 | |||
34 | from hashlib import md5 |
|
34 | from hashlib import md5 | |
35 | from decorator import decorator |
|
35 | from decorator import decorator |
@@ -35,7 +35,7 b' from time import mktime' | |||||
35 | from operator import itemgetter |
|
35 | from operator import itemgetter | |
36 | from string import lower |
|
36 | from string import lower | |
37 |
|
37 | |||
38 |
from |
|
38 | from tg import config | |
39 |
|
39 | |||
40 | from kallithea import CELERY_ON |
|
40 | from kallithea import CELERY_ON | |
41 | from kallithea.lib import celerylib |
|
41 | from kallithea.lib import celerylib |
@@ -20,7 +20,7 b' import os' | |||||
20 | import warnings |
|
20 | import warnings | |
21 |
|
21 | |||
22 | # Verify Pylons configuration has been loaded |
|
22 | # Verify Pylons configuration has been loaded | |
23 |
from |
|
23 | from tg import config | |
24 | assert config['celery.imports'] == 'kallithea.lib.celerylib.tasks', 'Kallithea Celery configuration has not been loaded' |
|
24 | assert config['celery.imports'] == 'kallithea.lib.celerylib.tasks', 'Kallithea Celery configuration has not been loaded' | |
25 |
|
25 | |||
26 | # Prepare environment to point at Kallithea Pylons loader |
|
26 | # Prepare environment to point at Kallithea Pylons loader |
@@ -1,7 +1,7 b'' | |||||
1 | # -*- coding: utf-8 -*- |
|
1 | # -*- coding: utf-8 -*- | |
2 |
|
2 | |||
3 | from celery.loaders.base import BaseLoader |
|
3 | from celery.loaders.base import BaseLoader | |
4 |
from |
|
4 | from tg import config | |
5 |
|
5 | |||
6 | # TODO: drop this mangling and just use a separate celery config section |
|
6 | # TODO: drop this mangling and just use a separate celery config section | |
7 | to_pylons = lambda x: x.replace('_', '.').lower() |
|
7 | to_pylons = lambda x: x.replace('_', '.').lower() |
@@ -31,7 +31,7 b' import logging' | |||||
31 |
|
31 | |||
32 | from itertools import tee, imap |
|
32 | from itertools import tee, imap | |
33 |
|
33 | |||
34 | from pylons.i18n.translation import _ |
|
34 | from tg.i18n import ugettext as _ | |
35 |
|
35 | |||
36 | from kallithea.lib.vcs.exceptions import VCSError |
|
36 | from kallithea.lib.vcs.exceptions import VCSError | |
37 | from kallithea.lib.vcs.nodes import FileNode, SubModuleNode |
|
37 | from kallithea.lib.vcs.nodes import FileNode, SubModuleNode |
@@ -28,7 +28,7 b' import textwrap' | |||||
28 | from beaker.cache import cache_region |
|
28 | from beaker.cache import cache_region | |
29 | from pygments.formatters.html import HtmlFormatter |
|
29 | from pygments.formatters.html import HtmlFormatter | |
30 | from pygments import highlight as code_highlight |
|
30 | from pygments import highlight as code_highlight | |
31 | from pylons.i18n.translation import _ |
|
31 | from tg.i18n import ugettext as _ | |
32 |
|
32 | |||
33 | from webhelpers.html import literal, HTML, escape |
|
33 | from webhelpers.html import literal, HTML, escape | |
34 | from webhelpers.html.tags import checkbox, end_form, hidden, link_to, \ |
|
34 | from webhelpers.html.tags import checkbox, end_form, hidden, link_to, \ | |
@@ -425,7 +425,7 b' class Flash(_Flash):' | |||||
425 |
|
425 | |||
426 | The return value is a list of ``Message`` objects. |
|
426 | The return value is a list of ``Message`` objects. | |
427 | """ |
|
427 | """ | |
428 |
from |
|
428 | from tg import session | |
429 | messages = session.pop(self.session_key, []) |
|
429 | messages = session.pop(self.session_key, []) | |
430 | session.save() |
|
430 | session.save() | |
431 | return [_Message(*m) for m in messages] |
|
431 | return [_Message(*m) for m in messages] | |
@@ -835,7 +835,7 b" def gravatar_div(email_address, cls='', " | |||||
835 | and '_' changed to '-' and be used as attributes on the div. The default |
|
835 | and '_' changed to '-' and be used as attributes on the div. The default | |
836 | class is 'gravatar'. |
|
836 | class is 'gravatar'. | |
837 | """ |
|
837 | """ | |
838 |
from |
|
838 | from tg import tmpl_context as c | |
839 | if not c.visual.use_gravatar: |
|
839 | if not c.visual.use_gravatar: | |
840 | return '' |
|
840 | return '' | |
841 | if 'div_class' not in div_attributes: |
|
841 | if 'div_class' not in div_attributes: | |
@@ -856,7 +856,7 b" def gravatar(email_address, cls='', size" | |||||
856 | empty then we fallback to using an icon. |
|
856 | empty then we fallback to using an icon. | |
857 |
|
857 | |||
858 | """ |
|
858 | """ | |
859 |
from |
|
859 | from tg import tmpl_context as c | |
860 | if not c.visual.use_gravatar: |
|
860 | if not c.visual.use_gravatar: | |
861 | return '' |
|
861 | return '' | |
862 |
|
862 | |||
@@ -879,7 +879,7 b' def gravatar_url(email_address, size=30,' | |||||
879 | # doh, we need to re-import those to mock it later |
|
879 | # doh, we need to re-import those to mock it later | |
880 | from kallithea.config.routing import url |
|
880 | from kallithea.config.routing import url | |
881 | from kallithea.model.db import User |
|
881 | from kallithea.model.db import User | |
882 |
from |
|
882 | from tg import tmpl_context as c | |
883 | if not c.visual.use_gravatar: |
|
883 | if not c.visual.use_gravatar: | |
884 | return "" |
|
884 | return "" | |
885 |
|
885 |
@@ -30,7 +30,7 b' class Command(BasePasterCommand):' | |||||
30 |
|
30 | |||
31 | def command(self): |
|
31 | def command(self): | |
32 | from kallithea.lib import celerypylons |
|
32 | from kallithea.lib import celerypylons | |
33 |
from |
|
33 | from tg import config | |
34 | try: |
|
34 | try: | |
35 | CELERY_ON = str2bool(config['app_conf'].get('use_celery')) |
|
35 | CELERY_ON = str2bool(config['app_conf'].get('use_celery')) | |
36 | except KeyError: |
|
36 | except KeyError: |
@@ -87,7 +87,7 b' class BasePasterCommand(Command):' | |||||
87 | """ |
|
87 | """ | |
88 | Loads the app configuration. |
|
88 | Loads the app configuration. | |
89 | """ |
|
89 | """ | |
90 |
from |
|
90 | from tg import config as pylonsconfig | |
91 |
|
91 | |||
92 | self.path_to_ini_file = os.path.realpath(conf) |
|
92 | self.path_to_ini_file = os.path.realpath(conf) | |
93 | conf = paste.deploy.appconfig('config:' + self.path_to_ini_file) |
|
93 | conf = paste.deploy.appconfig('config:' + self.path_to_ini_file) | |
@@ -99,7 +99,7 b' class BasePasterCommand(Command):' | |||||
99 | """ |
|
99 | """ | |
100 | logging.config.fileConfig(self.path_to_ini_file) |
|
100 | logging.config.fileConfig(self.path_to_ini_file) | |
101 |
|
101 | |||
102 |
from |
|
102 | from tg import config | |
103 | from kallithea.model.base import init_model |
|
103 | from kallithea.model.base import init_model | |
104 | from kallithea.lib.utils2 import engine_from_config |
|
104 | from kallithea.lib.utils2 import engine_from_config | |
105 | setup_cache_regions(config) |
|
105 | setup_cache_regions(config) |
@@ -50,7 +50,7 b' class Command(BasePasterCommand):' | |||||
50 | def command(self): |
|
50 | def command(self): | |
51 | #get SqlAlchemy session |
|
51 | #get SqlAlchemy session | |
52 | self._init_session() |
|
52 | self._init_session() | |
53 |
from |
|
53 | from tg import config | |
54 | index_location = config['index_dir'] |
|
54 | index_location = config['index_dir'] | |
55 | load_rcextensions(config['here']) |
|
55 | load_rcextensions(config['here']) | |
56 |
|
56 |
@@ -50,7 +50,7 b' class Command(BasePasterCommand):' | |||||
50 | ''' |
|
50 | ''' | |
51 |
|
51 | |||
52 | def command(self): |
|
52 | def command(self): | |
53 |
from |
|
53 | from tg import config | |
54 |
|
54 | |||
55 | here = config['here'] |
|
55 | here = config['here'] | |
56 | content = pkg_resources.resource_string( |
|
56 | content = pkg_resources.resource_string( |
@@ -38,7 +38,7 b' import binascii' | |||||
38 | import webob |
|
38 | import webob | |
39 | import urlobject |
|
39 | import urlobject | |
40 |
|
40 | |||
41 |
from |
|
41 | from tg.i18n import ugettext as _, ungettext | |
42 | from kallithea.lib.vcs.utils.lazy import LazyProperty |
|
42 | from kallithea.lib.vcs.utils.lazy import LazyProperty | |
43 | from kallithea.lib.compat import json |
|
43 | from kallithea.lib.compat import json | |
44 |
|
44 | |||
@@ -623,7 +623,7 b' def get_current_authuser():' | |||||
623 | Gets kallithea user from threadlocal tmpl_context variable if it's |
|
623 | Gets kallithea user from threadlocal tmpl_context variable if it's | |
624 | defined, else returns None. |
|
624 | defined, else returns None. | |
625 | """ |
|
625 | """ | |
626 |
from |
|
626 | from tg import tmpl_context | |
627 | if hasattr(tmpl_context, 'authuser'): |
|
627 | if hasattr(tmpl_context, 'authuser'): | |
628 | return tmpl_context.authuser |
|
628 | return tmpl_context.authuser | |
629 |
|
629 |
@@ -27,7 +27,7 b' Original author and date, and relevant c' | |||||
27 |
|
27 | |||
28 | import logging |
|
28 | import logging | |
29 |
|
29 | |||
30 | from pylons.i18n.translation import _ |
|
30 | from tg.i18n import ugettext as _ | |
31 | from collections import defaultdict |
|
31 | from collections import defaultdict | |
32 |
|
32 | |||
33 | from kallithea.lib.utils2 import extract_mentioned_users, safe_unicode |
|
33 | from kallithea.lib.utils2 import extract_mentioned_users, safe_unicode |
@@ -41,7 +41,7 b' from sqlalchemy.orm import relationship,' | |||||
41 | from beaker.cache import cache_region, region_invalidate |
|
41 | from beaker.cache import cache_region, region_invalidate | |
42 | from webob.exc import HTTPNotFound |
|
42 | from webob.exc import HTTPNotFound | |
43 |
|
43 | |||
44 |
from |
|
44 | from tg.i18n import lazy_ugettext as _ | |
45 |
|
45 | |||
46 | from kallithea.lib.exceptions import DefaultUserException |
|
46 | from kallithea.lib.exceptions import DefaultUserException | |
47 | from kallithea.lib.vcs import get_backend |
|
47 | from kallithea.lib.vcs import get_backend | |
@@ -1327,7 +1327,7 b' class Repository(Base, BaseDbModel):' | |||||
1327 | if not uri_tmpl: |
|
1327 | if not uri_tmpl: | |
1328 | uri_tmpl = self.DEFAULT_CLONE_URI |
|
1328 | uri_tmpl = self.DEFAULT_CLONE_URI | |
1329 | try: |
|
1329 | try: | |
1330 |
from |
|
1330 | from tg import tmpl_context as c | |
1331 | uri_tmpl = c.clone_uri_tmpl |
|
1331 | uri_tmpl = c.clone_uri_tmpl | |
1332 | except AttributeError: |
|
1332 | except AttributeError: | |
1333 | # in any case if we call this outside of request context, |
|
1333 | # in any case if we call this outside of request context, |
@@ -38,7 +38,7 b' import logging' | |||||
38 | import formencode |
|
38 | import formencode | |
39 | from formencode import All |
|
39 | from formencode import All | |
40 |
|
40 | |||
41 | from pylons.i18n.translation import _ |
|
41 | from tg.i18n import ugettext as _ | |
42 |
|
42 | |||
43 | from kallithea import BACKENDS |
|
43 | from kallithea import BACKENDS | |
44 | from kallithea.model import validators as v |
|
44 | from kallithea.model import validators as v |
@@ -29,8 +29,8 b' Original author and date, and relevant c' | |||||
29 | import logging |
|
29 | import logging | |
30 | import traceback |
|
30 | import traceback | |
31 |
|
31 | |||
32 |
from |
|
32 | from tg import tmpl_context as c | |
33 | from pylons.i18n.translation import _ |
|
33 | from tg.i18n import ugettext as _ | |
34 | from sqlalchemy.orm import joinedload, subqueryload |
|
34 | from sqlalchemy.orm import joinedload, subqueryload | |
35 |
|
35 | |||
36 | import kallithea |
|
36 | import kallithea |
@@ -29,8 +29,8 b' import logging' | |||||
29 | import datetime |
|
29 | import datetime | |
30 | import re |
|
30 | import re | |
31 |
|
31 | |||
32 |
from |
|
32 | from tg import request | |
33 | from pylons.i18n.translation import _ |
|
33 | from tg.i18n import ugettext as _ | |
34 |
|
34 | |||
35 | from sqlalchemy.orm import joinedload |
|
35 | from sqlalchemy.orm import joinedload | |
36 |
|
36 |
@@ -153,8 +153,8 b' class RepoModel(object):' | |||||
153 | @classmethod |
|
153 | @classmethod | |
154 | def _render_datatable(cls, tmpl, *args, **kwargs): |
|
154 | def _render_datatable(cls, tmpl, *args, **kwargs): | |
155 | import kallithea |
|
155 | import kallithea | |
156 |
from |
|
156 | from tg import tmpl_context as c, request | |
157 |
from |
|
157 | from tg.i18n import ugettext as _ | |
158 |
|
158 | |||
159 | _tmpl_lookup = kallithea.CONFIG['pylons.app_globals'].mako_lookup |
|
159 | _tmpl_lookup = kallithea.CONFIG['pylons.app_globals'].mako_lookup | |
160 | template = _tmpl_lookup.get_template('data_table/_dt_elements.html') |
|
160 | template = _tmpl_lookup.get_template('data_table/_dt_elements.html') | |
@@ -166,7 +166,7 b' class RepoModel(object):' | |||||
166 | def get_repos_as_dict(self, repos_list=None, admin=False, perm_check=True, |
|
166 | def get_repos_as_dict(self, repos_list=None, admin=False, perm_check=True, | |
167 | super_user_actions=False, short_name=False): |
|
167 | super_user_actions=False, short_name=False): | |
168 | _render = self._render_datatable |
|
168 | _render = self._render_datatable | |
169 |
from |
|
169 | from tg import tmpl_context as c | |
170 |
|
170 | |||
171 | def repo_lnk(name, rtype, rstate, private, fork_of): |
|
171 | def repo_lnk(name, rtype, rstate, private, fork_of): | |
172 | return _render('repo_name', name, rtype, rstate, private, fork_of, |
|
172 | return _render('repo_name', name, rtype, rstate, private, fork_of, |
@@ -36,7 +36,7 b' import cStringIO' | |||||
36 | import pkg_resources |
|
36 | import pkg_resources | |
37 |
|
37 | |||
38 | from sqlalchemy import func |
|
38 | from sqlalchemy import func | |
39 | from pylons.i18n.translation import _ |
|
39 | from tg.i18n import ugettext as _ | |
40 |
|
40 | |||
41 | import kallithea |
|
41 | import kallithea | |
42 | from kallithea.lib.vcs import get_backend |
|
42 | from kallithea.lib.vcs import get_backend | |
@@ -333,7 +333,7 b' class ScmModel(object):' | |||||
333 | from kallithea import CONFIG |
|
333 | from kallithea import CONFIG | |
334 | from kallithea.lib.base import _get_ip_addr |
|
334 | from kallithea.lib.base import _get_ip_addr | |
335 | try: |
|
335 | try: | |
336 |
from |
|
336 | from tg import request | |
337 | environ = request.environ |
|
337 | environ = request.environ | |
338 | except TypeError: |
|
338 | except TypeError: | |
339 | # we might use this outside of request context, let's fake the |
|
339 | # we might use this outside of request context, let's fake the |
@@ -32,8 +32,8 b' import logging' | |||||
32 | import time |
|
32 | import time | |
33 | import traceback |
|
33 | import traceback | |
34 |
|
34 | |||
35 |
from |
|
35 | from tg import config | |
36 | from pylons.i18n.translation import _ |
|
36 | from tg.i18n import ugettext as _ | |
37 |
|
37 | |||
38 | from sqlalchemy.exc import DatabaseError |
|
38 | from sqlalchemy.exc import DatabaseError | |
39 |
|
39 |
@@ -20,7 +20,7 b' import re' | |||||
20 | import formencode |
|
20 | import formencode | |
21 | import logging |
|
21 | import logging | |
22 | from collections import defaultdict |
|
22 | from collections import defaultdict | |
23 | from pylons.i18n.translation import _ |
|
23 | from tg.i18n import ugettext as _ | |
24 | from webhelpers.pylonslib.secure_form import authentication_token |
|
24 | from webhelpers.pylonslib.secure_form import authentication_token | |
25 | import sqlalchemy |
|
25 | import sqlalchemy | |
26 |
|
26 |
@@ -20,8 +20,9 b' import re' | |||||
20 | import tempfile |
|
20 | import tempfile | |
21 | import time |
|
21 | import time | |
22 |
|
22 | |||
|
23 | from tg import config | |||
23 | import pylons |
|
24 | import pylons | |
24 |
from pylons import |
|
25 | from pylons import url | |
25 | from pylons.i18n.translation import _get_translator |
|
26 | from pylons.i18n.translation import _get_translator | |
26 | from pylons.util import ContextObj |
|
27 | from pylons.util import ContextObj | |
27 | from routes.util import URLGenerator |
|
28 | from routes.util import URLGenerator |
General Comments 0
You need to be logged in to leave comments.
Login now