diff --git a/kallithea/__init__.py b/kallithea/__init__.py --- a/kallithea/__init__.py +++ b/kallithea/__init__.py @@ -30,6 +30,10 @@ Original author and date, and relevant c import sys import platform +# temporary aliasing to allow early introduction of imports like 'from tg import request' +import pylons +sys.modules['tg'] = pylons + VERSION = (0, 3, 99) BACKENDS = { 'hg': 'Mercurial repository', diff --git a/kallithea/config/routing.py b/kallithea/config/routing.py --- a/kallithea/config/routing.py +++ b/kallithea/config/routing.py @@ -19,7 +19,7 @@ may take precedent over the more generic refer to the routes manual at http://routes.groovie.org/docs/ """ -from pylons import request +from tg import request from routes import Mapper # prefix for non repository related links needs to be prefixed with `/` diff --git a/kallithea/controllers/admin/admin.py b/kallithea/controllers/admin/admin.py --- a/kallithea/controllers/admin/admin.py +++ b/kallithea/controllers/admin/admin.py @@ -28,7 +28,7 @@ Original author and date, and relevant c import logging -from pylons import request, tmpl_context as c +from tg import request, tmpl_context as c from sqlalchemy.orm import joinedload from whoosh.qparser.default import QueryParser from whoosh.qparser.dateparse import DateParserPlugin diff --git a/kallithea/controllers/admin/auth_settings.py b/kallithea/controllers/admin/auth_settings.py --- a/kallithea/controllers/admin/auth_settings.py +++ b/kallithea/controllers/admin/auth_settings.py @@ -27,8 +27,8 @@ import logging import formencode.htmlfill import traceback -from pylons import request, tmpl_context as c -from pylons.i18n.translation import _ +from tg import request, tmpl_context as c +from tg.i18n import ugettext as _ from webob.exc import HTTPFound from kallithea.config.routing import url diff --git a/kallithea/controllers/admin/defaults.py b/kallithea/controllers/admin/defaults.py --- a/kallithea/controllers/admin/defaults.py +++ b/kallithea/controllers/admin/defaults.py @@ -30,8 +30,8 @@ import traceback import formencode from formencode import htmlfill -from pylons import request, tmpl_context as c -from pylons.i18n.translation import _ +from tg import request, tmpl_context as c +from tg.i18n import ugettext as _ from webob.exc import HTTPFound from kallithea.config.routing import url diff --git a/kallithea/controllers/admin/gists.py b/kallithea/controllers/admin/gists.py --- a/kallithea/controllers/admin/gists.py +++ b/kallithea/controllers/admin/gists.py @@ -30,8 +30,8 @@ import logging import traceback import formencode.htmlfill -from pylons import request, response, tmpl_context as c -from pylons.i18n.translation import _ +from tg import request, response, tmpl_context as c +from tg.i18n import ugettext as _ from webob.exc import HTTPFound, HTTPNotFound, HTTPForbidden from kallithea.config.routing import url diff --git a/kallithea/controllers/admin/my_account.py b/kallithea/controllers/admin/my_account.py --- a/kallithea/controllers/admin/my_account.py +++ b/kallithea/controllers/admin/my_account.py @@ -31,8 +31,8 @@ import formencode from sqlalchemy import func from formencode import htmlfill -from pylons import request, tmpl_context as c -from pylons.i18n.translation import _ +from tg import request, tmpl_context as c +from tg.i18n import ugettext as _ from webob.exc import HTTPFound from kallithea.config.routing import url diff --git a/kallithea/controllers/admin/notifications.py b/kallithea/controllers/admin/notifications.py --- a/kallithea/controllers/admin/notifications.py +++ b/kallithea/controllers/admin/notifications.py @@ -28,8 +28,8 @@ Original author and date, and relevant c import logging import traceback -from pylons import request -from pylons import tmpl_context as c +from tg import request +from tg import tmpl_context as c from webob.exc import HTTPBadRequest, HTTPForbidden from kallithea.model.db import Notification diff --git a/kallithea/controllers/admin/permissions.py b/kallithea/controllers/admin/permissions.py --- a/kallithea/controllers/admin/permissions.py +++ b/kallithea/controllers/admin/permissions.py @@ -31,8 +31,8 @@ import traceback import formencode from formencode import htmlfill -from pylons import request, tmpl_context as c -from pylons.i18n.translation import _ +from tg import request, tmpl_context as c +from tg.i18n import ugettext as _ from webob.exc import HTTPFound from kallithea.config.routing import url diff --git a/kallithea/controllers/admin/repo_groups.py b/kallithea/controllers/admin/repo_groups.py --- a/kallithea/controllers/admin/repo_groups.py +++ b/kallithea/controllers/admin/repo_groups.py @@ -32,8 +32,8 @@ import itertools from formencode import htmlfill -from pylons import request, tmpl_context as c -from pylons.i18n.translation import _, ungettext +from tg import request, tmpl_context as c +from tg.i18n import ugettext as _, ungettext from webob.exc import HTTPFound, HTTPForbidden, HTTPNotFound, HTTPInternalServerError import kallithea diff --git a/kallithea/controllers/admin/repos.py b/kallithea/controllers/admin/repos.py --- a/kallithea/controllers/admin/repos.py +++ b/kallithea/controllers/admin/repos.py @@ -29,8 +29,8 @@ import logging import traceback import formencode from formencode import htmlfill -from pylons import request, tmpl_context as c -from pylons.i18n.translation import _ +from tg import request, tmpl_context as c +from tg.i18n import ugettext as _ from sqlalchemy.sql.expression import func from webob.exc import HTTPFound, HTTPInternalServerError, HTTPForbidden, HTTPNotFound diff --git a/kallithea/controllers/admin/settings.py b/kallithea/controllers/admin/settings.py --- a/kallithea/controllers/admin/settings.py +++ b/kallithea/controllers/admin/settings.py @@ -30,8 +30,8 @@ import traceback import formencode from formencode import htmlfill -from pylons import request, tmpl_context as c, config -from pylons.i18n.translation import _ +from tg import request, tmpl_context as c, config +from tg.i18n import ugettext as _ from webob.exc import HTTPFound from kallithea.config.routing import url diff --git a/kallithea/controllers/admin/user_groups.py b/kallithea/controllers/admin/user_groups.py --- a/kallithea/controllers/admin/user_groups.py +++ b/kallithea/controllers/admin/user_groups.py @@ -30,8 +30,8 @@ import traceback import formencode from formencode import htmlfill -from pylons import request, tmpl_context as c, config -from pylons.i18n.translation import _ +from tg import request, tmpl_context as c, config +from tg.i18n import ugettext as _ from webob.exc import HTTPFound from sqlalchemy.orm import joinedload diff --git a/kallithea/controllers/admin/users.py b/kallithea/controllers/admin/users.py --- a/kallithea/controllers/admin/users.py +++ b/kallithea/controllers/admin/users.py @@ -30,8 +30,8 @@ import traceback import formencode from formencode import htmlfill -from pylons import request, tmpl_context as c, config -from pylons.i18n.translation import _ +from tg import request, tmpl_context as c, config +from tg.i18n import ugettext as _ from sqlalchemy.sql.expression import func from webob.exc import HTTPFound, HTTPNotFound diff --git a/kallithea/controllers/api/__init__.py b/kallithea/controllers/api/__init__.py --- a/kallithea/controllers/api/__init__.py +++ b/kallithea/controllers/api/__init__.py @@ -35,7 +35,7 @@ import itertools from paste.response import replace_header from pylons.controllers import WSGIController from pylons.controllers.util import Response -from pylons import request +from tg import request from webob.exc import HTTPError diff --git a/kallithea/controllers/api/api.py b/kallithea/controllers/api/api.py --- a/kallithea/controllers/api/api.py +++ b/kallithea/controllers/api/api.py @@ -30,7 +30,7 @@ import traceback import logging from sqlalchemy import or_ -from pylons import request +from tg import request from kallithea.controllers.api import JSONRPCController, JSONRPCError from kallithea.lib.auth import ( diff --git a/kallithea/controllers/changelog.py b/kallithea/controllers/changelog.py --- a/kallithea/controllers/changelog.py +++ b/kallithea/controllers/changelog.py @@ -28,8 +28,8 @@ Original author and date, and relevant c import logging import traceback -from pylons import request, session, tmpl_context as c -from pylons.i18n.translation import _ +from tg import request, session, tmpl_context as c +from tg.i18n import ugettext as _ from webob.exc import HTTPFound, HTTPNotFound, HTTPBadRequest import kallithea.lib.helpers as h diff --git a/kallithea/controllers/changeset.py b/kallithea/controllers/changeset.py --- a/kallithea/controllers/changeset.py +++ b/kallithea/controllers/changeset.py @@ -29,8 +29,8 @@ import logging import traceback from collections import defaultdict -from pylons import tmpl_context as c, request, response -from pylons.i18n.translation import _ +from tg import tmpl_context as c, request, response +from tg.i18n import ugettext as _ from webob.exc import HTTPFound, HTTPForbidden, HTTPBadRequest, HTTPNotFound from kallithea.lib.vcs.exceptions import RepositoryError, \ diff --git a/kallithea/controllers/compare.py b/kallithea/controllers/compare.py --- a/kallithea/controllers/compare.py +++ b/kallithea/controllers/compare.py @@ -30,8 +30,8 @@ Original author and date, and relevant c import logging import re -from pylons import request, tmpl_context as c -from pylons.i18n.translation import _ +from tg import request, tmpl_context as c +from tg.i18n import ugettext as _ from webob.exc import HTTPFound, HTTPBadRequest, HTTPNotFound from kallithea.config.routing import url diff --git a/kallithea/controllers/error.py b/kallithea/controllers/error.py --- a/kallithea/controllers/error.py +++ b/kallithea/controllers/error.py @@ -29,8 +29,8 @@ import os import cgi import logging -from pylons import tmpl_context as c, request, config -from pylons.i18n.translation import _ +from tg import tmpl_context as c, request, config +from tg.i18n import ugettext as _ from pylons.middleware import media_path from kallithea.lib.base import BaseController, render diff --git a/kallithea/controllers/feed.py b/kallithea/controllers/feed.py --- a/kallithea/controllers/feed.py +++ b/kallithea/controllers/feed.py @@ -28,8 +28,8 @@ Original author and date, and relevant c import logging -from pylons import response, tmpl_context as c -from pylons.i18n.translation import _ +from tg import response, tmpl_context as c +from tg.i18n import ugettext as _ from beaker.cache import cache_region, region_invalidate from webhelpers.feedgenerator import Atom1Feed, Rss201rev2Feed diff --git a/kallithea/controllers/files.py b/kallithea/controllers/files.py --- a/kallithea/controllers/files.py +++ b/kallithea/controllers/files.py @@ -32,8 +32,8 @@ import traceback import tempfile import shutil -from pylons import request, response, tmpl_context as c -from pylons.i18n.translation import _ +from tg import request, response, tmpl_context as c +from tg.i18n import ugettext as _ from webob.exc import HTTPFound from kallithea.config.routing import url diff --git a/kallithea/controllers/followers.py b/kallithea/controllers/followers.py --- a/kallithea/controllers/followers.py +++ b/kallithea/controllers/followers.py @@ -27,7 +27,7 @@ Original author and date, and relevant c import logging -from pylons import tmpl_context as c, request +from tg import tmpl_context as c, request from kallithea.lib.auth import LoginRequired, HasRepoPermissionLevelDecorator from kallithea.lib.base import BaseRepoController, render diff --git a/kallithea/controllers/forks.py b/kallithea/controllers/forks.py --- a/kallithea/controllers/forks.py +++ b/kallithea/controllers/forks.py @@ -30,8 +30,8 @@ import formencode import traceback from formencode import htmlfill -from pylons import tmpl_context as c, request -from pylons.i18n.translation import _ +from tg import tmpl_context as c, request +from tg.i18n import ugettext as _ from webob.exc import HTTPFound import kallithea.lib.helpers as h diff --git a/kallithea/controllers/home.py b/kallithea/controllers/home.py --- a/kallithea/controllers/home.py +++ b/kallithea/controllers/home.py @@ -28,8 +28,8 @@ Original author and date, and relevant c import logging -from pylons import tmpl_context as c, request -from pylons.i18n.translation import _ +from tg import tmpl_context as c, request +from tg.i18n import ugettext as _ from webob.exc import HTTPBadRequest from sqlalchemy.sql.expression import func diff --git a/kallithea/controllers/journal.py b/kallithea/controllers/journal.py --- a/kallithea/controllers/journal.py +++ b/kallithea/controllers/journal.py @@ -37,8 +37,8 @@ from sqlalchemy.sql.expression import fu from webhelpers.feedgenerator import Atom1Feed, Rss201rev2Feed from webob.exc import HTTPBadRequest -from pylons import request, tmpl_context as c, response -from pylons.i18n.translation import _ +from tg import request, tmpl_context as c, response +from tg.i18n import ugettext as _ from kallithea.config.routing import url from kallithea.controllers.admin.admin import _journal_filter diff --git a/kallithea/controllers/login.py b/kallithea/controllers/login.py --- a/kallithea/controllers/login.py +++ b/kallithea/controllers/login.py @@ -31,8 +31,8 @@ import re import formencode from formencode import htmlfill -from pylons.i18n.translation import _ -from pylons import request, session, tmpl_context as c +from tg.i18n import ugettext as _ +from tg import request, session, tmpl_context as c from webob.exc import HTTPFound, HTTPBadRequest import kallithea.lib.helpers as h diff --git a/kallithea/controllers/pullrequests.py b/kallithea/controllers/pullrequests.py --- a/kallithea/controllers/pullrequests.py +++ b/kallithea/controllers/pullrequests.py @@ -29,8 +29,8 @@ import logging import traceback import formencode -from pylons import request, tmpl_context as c -from pylons.i18n.translation import _ +from tg import request, tmpl_context as c +from tg.i18n import ugettext as _ from webob.exc import HTTPFound, HTTPNotFound, HTTPForbidden, HTTPBadRequest from kallithea.config.routing import url diff --git a/kallithea/controllers/search.py b/kallithea/controllers/search.py --- a/kallithea/controllers/search.py +++ b/kallithea/controllers/search.py @@ -28,8 +28,8 @@ Original author and date, and relevant c import logging import traceback import urllib -from pylons.i18n.translation import _ -from pylons import request, config, tmpl_context as c +from tg.i18n import ugettext as _ +from tg import request, config, tmpl_context as c from whoosh.index import open_dir, EmptyIndexError from whoosh.qparser import QueryParser, QueryParserError diff --git a/kallithea/controllers/summary.py b/kallithea/controllers/summary.py --- a/kallithea/controllers/summary.py +++ b/kallithea/controllers/summary.py @@ -32,8 +32,8 @@ import itertools from time import mktime from datetime import timedelta, date -from pylons import tmpl_context as c, request -from pylons.i18n.translation import _ +from tg import tmpl_context as c, request +from tg.i18n import ugettext as _ from webob.exc import HTTPBadRequest from beaker.cache import cache_region, region_invalidate diff --git a/kallithea/lib/auth.py b/kallithea/lib/auth.py --- a/kallithea/lib/auth.py +++ b/kallithea/lib/auth.py @@ -33,8 +33,8 @@ import collections from decorator import decorator -from pylons import request, session -from pylons.i18n.translation import _ +from tg import request, session +from tg.i18n import ugettext as _ from webhelpers.pylonslib import secure_form from sqlalchemy.orm.exc import ObjectDeletedError from sqlalchemy.orm import joinedload diff --git a/kallithea/lib/base.py b/kallithea/lib/base.py --- a/kallithea/lib/base.py +++ b/kallithea/lib/base.py @@ -41,10 +41,10 @@ import paste.auth.basic import paste.httpheaders from webhelpers.pylonslib import secure_form -from pylons import config, tmpl_context as c, request, response, session +from tg import config, tmpl_context as c, request, response, session from pylons.controllers import WSGIController from pylons.templating import render_mako as render # don't remove this import -from pylons.i18n.translation import _ +from tg.i18n import ugettext as _ from kallithea import __version__, BACKENDS diff --git a/kallithea/lib/celerylib/__init__.py b/kallithea/lib/celerylib/__init__.py --- a/kallithea/lib/celerylib/__init__.py +++ b/kallithea/lib/celerylib/__init__.py @@ -29,7 +29,7 @@ Original author and date, and relevant c import os import logging -from pylons import config +from tg import config from hashlib import md5 from decorator import decorator diff --git a/kallithea/lib/celerylib/tasks.py b/kallithea/lib/celerylib/tasks.py --- a/kallithea/lib/celerylib/tasks.py +++ b/kallithea/lib/celerylib/tasks.py @@ -35,7 +35,7 @@ from time import mktime from operator import itemgetter from string import lower -from pylons import config +from tg import config from kallithea import CELERY_ON from kallithea.lib import celerylib diff --git a/kallithea/lib/celerypylons/__init__.py b/kallithea/lib/celerypylons/__init__.py --- a/kallithea/lib/celerypylons/__init__.py +++ b/kallithea/lib/celerypylons/__init__.py @@ -20,7 +20,7 @@ import os import warnings # Verify Pylons configuration has been loaded -from pylons import config +from tg import config assert config['celery.imports'] == 'kallithea.lib.celerylib.tasks', 'Kallithea Celery configuration has not been loaded' # Prepare environment to point at Kallithea Pylons loader diff --git a/kallithea/lib/celerypylons/loader.py b/kallithea/lib/celerypylons/loader.py --- a/kallithea/lib/celerypylons/loader.py +++ b/kallithea/lib/celerypylons/loader.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- from celery.loaders.base import BaseLoader -from pylons import config +from tg import config # TODO: drop this mangling and just use a separate celery config section to_pylons = lambda x: x.replace('_', '.').lower() diff --git a/kallithea/lib/diffs.py b/kallithea/lib/diffs.py --- a/kallithea/lib/diffs.py +++ b/kallithea/lib/diffs.py @@ -31,7 +31,7 @@ import logging from itertools import tee, imap -from pylons.i18n.translation import _ +from tg.i18n import ugettext as _ from kallithea.lib.vcs.exceptions import VCSError from kallithea.lib.vcs.nodes import FileNode, SubModuleNode diff --git a/kallithea/lib/helpers.py b/kallithea/lib/helpers.py --- a/kallithea/lib/helpers.py +++ b/kallithea/lib/helpers.py @@ -28,7 +28,7 @@ import textwrap from beaker.cache import cache_region from pygments.formatters.html import HtmlFormatter from pygments import highlight as code_highlight -from pylons.i18n.translation import _ +from tg.i18n import ugettext as _ from webhelpers.html import literal, HTML, escape from webhelpers.html.tags import checkbox, end_form, hidden, link_to, \ @@ -425,7 +425,7 @@ class Flash(_Flash): The return value is a list of ``Message`` objects. """ - from pylons import session + from tg import session messages = session.pop(self.session_key, []) session.save() return [_Message(*m) for m in messages] @@ -835,7 +835,7 @@ def gravatar_div(email_address, cls='', and '_' changed to '-' and be used as attributes on the div. The default class is 'gravatar'. """ - from pylons import tmpl_context as c + from tg import tmpl_context as c if not c.visual.use_gravatar: return '' if 'div_class' not in div_attributes: @@ -856,7 +856,7 @@ def gravatar(email_address, cls='', size empty then we fallback to using an icon. """ - from pylons import tmpl_context as c + from tg import tmpl_context as c if not c.visual.use_gravatar: return '' @@ -879,7 +879,7 @@ def gravatar_url(email_address, size=30, # doh, we need to re-import those to mock it later from kallithea.config.routing import url from kallithea.model.db import User - from pylons import tmpl_context as c + from tg import tmpl_context as c if not c.visual.use_gravatar: return "" diff --git a/kallithea/lib/paster_commands/celeryd.py b/kallithea/lib/paster_commands/celeryd.py --- a/kallithea/lib/paster_commands/celeryd.py +++ b/kallithea/lib/paster_commands/celeryd.py @@ -30,7 +30,7 @@ class Command(BasePasterCommand): def command(self): from kallithea.lib import celerypylons - from pylons import config + from tg import config try: CELERY_ON = str2bool(config['app_conf'].get('use_celery')) except KeyError: diff --git a/kallithea/lib/paster_commands/common.py b/kallithea/lib/paster_commands/common.py --- a/kallithea/lib/paster_commands/common.py +++ b/kallithea/lib/paster_commands/common.py @@ -87,7 +87,7 @@ class BasePasterCommand(Command): """ Loads the app configuration. """ - from pylons import config as pylonsconfig + from tg import config as pylonsconfig self.path_to_ini_file = os.path.realpath(conf) conf = paste.deploy.appconfig('config:' + self.path_to_ini_file) @@ -99,7 +99,7 @@ class BasePasterCommand(Command): """ logging.config.fileConfig(self.path_to_ini_file) - from pylons import config + from tg import config from kallithea.model.base import init_model from kallithea.lib.utils2 import engine_from_config setup_cache_regions(config) diff --git a/kallithea/lib/paster_commands/make_index.py b/kallithea/lib/paster_commands/make_index.py --- a/kallithea/lib/paster_commands/make_index.py +++ b/kallithea/lib/paster_commands/make_index.py @@ -50,7 +50,7 @@ class Command(BasePasterCommand): def command(self): #get SqlAlchemy session self._init_session() - from pylons import config + from tg import config index_location = config['index_dir'] load_rcextensions(config['here']) diff --git a/kallithea/lib/paster_commands/make_rcextensions.py b/kallithea/lib/paster_commands/make_rcextensions.py --- a/kallithea/lib/paster_commands/make_rcextensions.py +++ b/kallithea/lib/paster_commands/make_rcextensions.py @@ -50,7 +50,7 @@ class Command(BasePasterCommand): ''' def command(self): - from pylons import config + from tg import config here = config['here'] content = pkg_resources.resource_string( diff --git a/kallithea/lib/utils2.py b/kallithea/lib/utils2.py --- a/kallithea/lib/utils2.py +++ b/kallithea/lib/utils2.py @@ -38,7 +38,7 @@ import binascii import webob import urlobject -from pylons.i18n.translation import _, ungettext +from tg.i18n import ugettext as _, ungettext from kallithea.lib.vcs.utils.lazy import LazyProperty from kallithea.lib.compat import json @@ -623,7 +623,7 @@ def get_current_authuser(): Gets kallithea user from threadlocal tmpl_context variable if it's defined, else returns None. """ - from pylons import tmpl_context + from tg import tmpl_context if hasattr(tmpl_context, 'authuser'): return tmpl_context.authuser diff --git a/kallithea/model/comment.py b/kallithea/model/comment.py --- a/kallithea/model/comment.py +++ b/kallithea/model/comment.py @@ -27,7 +27,7 @@ Original author and date, and relevant c import logging -from pylons.i18n.translation import _ +from tg.i18n import ugettext as _ from collections import defaultdict from kallithea.lib.utils2 import extract_mentioned_users, safe_unicode diff --git a/kallithea/model/db.py b/kallithea/model/db.py --- a/kallithea/model/db.py +++ b/kallithea/model/db.py @@ -41,7 +41,7 @@ from sqlalchemy.orm import relationship, from beaker.cache import cache_region, region_invalidate from webob.exc import HTTPNotFound -from pylons.i18n.translation import lazy_ugettext as _ +from tg.i18n import lazy_ugettext as _ from kallithea.lib.exceptions import DefaultUserException from kallithea.lib.vcs import get_backend @@ -1327,7 +1327,7 @@ class Repository(Base, BaseDbModel): if not uri_tmpl: uri_tmpl = self.DEFAULT_CLONE_URI try: - from pylons import tmpl_context as c + from tg import tmpl_context as c uri_tmpl = c.clone_uri_tmpl except AttributeError: # in any case if we call this outside of request context, diff --git a/kallithea/model/forms.py b/kallithea/model/forms.py --- a/kallithea/model/forms.py +++ b/kallithea/model/forms.py @@ -38,7 +38,7 @@ import logging import formencode from formencode import All -from pylons.i18n.translation import _ +from tg.i18n import ugettext as _ from kallithea import BACKENDS from kallithea.model import validators as v diff --git a/kallithea/model/notification.py b/kallithea/model/notification.py --- a/kallithea/model/notification.py +++ b/kallithea/model/notification.py @@ -29,8 +29,8 @@ Original author and date, and relevant c import logging import traceback -from pylons import tmpl_context as c -from pylons.i18n.translation import _ +from tg import tmpl_context as c +from tg.i18n import ugettext as _ from sqlalchemy.orm import joinedload, subqueryload import kallithea diff --git a/kallithea/model/pull_request.py b/kallithea/model/pull_request.py --- a/kallithea/model/pull_request.py +++ b/kallithea/model/pull_request.py @@ -29,8 +29,8 @@ import logging import datetime import re -from pylons import request -from pylons.i18n.translation import _ +from tg import request +from tg.i18n import ugettext as _ from sqlalchemy.orm import joinedload diff --git a/kallithea/model/repo.py b/kallithea/model/repo.py --- a/kallithea/model/repo.py +++ b/kallithea/model/repo.py @@ -153,8 +153,8 @@ class RepoModel(object): @classmethod def _render_datatable(cls, tmpl, *args, **kwargs): import kallithea - from pylons import tmpl_context as c, request - from pylons.i18n.translation import _ + from tg import tmpl_context as c, request + from tg.i18n import ugettext as _ _tmpl_lookup = kallithea.CONFIG['pylons.app_globals'].mako_lookup template = _tmpl_lookup.get_template('data_table/_dt_elements.html') @@ -166,7 +166,7 @@ class RepoModel(object): def get_repos_as_dict(self, repos_list=None, admin=False, perm_check=True, super_user_actions=False, short_name=False): _render = self._render_datatable - from pylons import tmpl_context as c + from tg import tmpl_context as c def repo_lnk(name, rtype, rstate, private, fork_of): return _render('repo_name', name, rtype, rstate, private, fork_of, diff --git a/kallithea/model/scm.py b/kallithea/model/scm.py --- a/kallithea/model/scm.py +++ b/kallithea/model/scm.py @@ -36,7 +36,7 @@ import cStringIO import pkg_resources from sqlalchemy import func -from pylons.i18n.translation import _ +from tg.i18n import ugettext as _ import kallithea from kallithea.lib.vcs import get_backend @@ -333,7 +333,7 @@ class ScmModel(object): from kallithea import CONFIG from kallithea.lib.base import _get_ip_addr try: - from pylons import request + from tg import request environ = request.environ except TypeError: # we might use this outside of request context, let's fake the diff --git a/kallithea/model/user.py b/kallithea/model/user.py --- a/kallithea/model/user.py +++ b/kallithea/model/user.py @@ -32,8 +32,8 @@ import logging import time import traceback -from pylons import config -from pylons.i18n.translation import _ +from tg import config +from tg.i18n import ugettext as _ from sqlalchemy.exc import DatabaseError diff --git a/kallithea/model/validators.py b/kallithea/model/validators.py --- a/kallithea/model/validators.py +++ b/kallithea/model/validators.py @@ -20,7 +20,7 @@ import re import formencode import logging from collections import defaultdict -from pylons.i18n.translation import _ +from tg.i18n import ugettext as _ from webhelpers.pylonslib.secure_form import authentication_token import sqlalchemy diff --git a/kallithea/tests/base.py b/kallithea/tests/base.py --- a/kallithea/tests/base.py +++ b/kallithea/tests/base.py @@ -20,8 +20,9 @@ import re import tempfile import time +from tg import config import pylons -from pylons import config, url +from pylons import url from pylons.i18n.translation import _get_translator from pylons.util import ContextObj from routes.util import URLGenerator