##// END OF EJS Templates
cleanup: remove unused Python imports, found with pyflakes
Mads Kiilerich -
r4422:d51a6f5e default
parent child Browse files
Show More
@@ -13,7 +13,6 b''
13
13
14 import sys
14 import sys
15 import os
15 import os
16 import datetime
17
16
18 # If extensions (or modules to document with autodoc) are in another directory,
17 # If extensions (or modules to document with autodoc) are in another directory,
19 # add these directories to sys.path here. If the directory is relative to the
18 # add these directories to sys.path here. If the directory is relative to the
@@ -18,7 +18,6 b' Script for rebranding of database to and'
18 Works on databases from v1.7.2 to v2.2.5
18 Works on databases from v1.7.2 to v2.2.5
19 """
19 """
20
20
21 import os
22 import sys
21 import sys
23 from sqlalchemy import *
22 from sqlalchemy import *
24 import sqlalchemy.orm
23 import sqlalchemy.orm
@@ -24,7 +24,6 b' Original author and date, and relevant c'
24 :copyright: (c) 2013 RhodeCode GmbH, and others.
24 :copyright: (c) 2013 RhodeCode GmbH, and others.
25 :license: GPLv3, see LICENSE.md for more details.
25 :license: GPLv3, see LICENSE.md for more details.
26 """
26 """
27 from kallithea import EXTENSIONS
28
27
29 from kallithea.lib.utils2 import __get_lem
28 from kallithea.lib.utils2 import __get_lem
30
29
@@ -35,7 +35,7 b' from whoosh.qparser.dateparse import Dat'
35 from whoosh import query
35 from whoosh import query
36 from sqlalchemy.sql.expression import or_, and_, func
36 from sqlalchemy.sql.expression import or_, and_, func
37
37
38 from kallithea.model.db import UserLog, User
38 from kallithea.model.db import UserLog
39 from kallithea.lib.auth import LoginRequired, HasPermissionAllDecorator
39 from kallithea.lib.auth import LoginRequired, HasPermissionAllDecorator
40 from kallithea.lib.base import BaseController, render
40 from kallithea.lib.base import BaseController, render
41 from kallithea.lib.utils2 import safe_int, remove_prefix, remove_suffix
41 from kallithea.lib.utils2 import safe_int, remove_prefix, remove_suffix
@@ -28,14 +28,12 b' import logging'
28 import formencode.htmlfill
28 import formencode.htmlfill
29 import traceback
29 import traceback
30
30
31 from pylons import request, response, session, tmpl_context as c, url
31 from pylons import request, tmpl_context as c, url
32 from pylons.controllers.util import abort, redirect
32 from pylons.controllers.util import redirect
33 from pylons.i18n.translation import _
33 from pylons.i18n.translation import _
34
34
35 from sqlalchemy.exc import DatabaseError
36
37 from kallithea.lib import helpers as h
35 from kallithea.lib import helpers as h
38 from kallithea.lib.compat import json, formatted_json
36 from kallithea.lib.compat import formatted_json
39 from kallithea.lib.base import BaseController, render
37 from kallithea.lib.base import BaseController, render
40 from kallithea.lib.auth import LoginRequired, HasPermissionAllDecorator
38 from kallithea.lib.auth import LoginRequired, HasPermissionAllDecorator
41 from kallithea.lib import auth_modules
39 from kallithea.lib import auth_modules
@@ -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 pylons import request, session, tmpl_context as c, url
33 from pylons import request, tmpl_context as c, url
34 from pylons.controllers.util import abort, redirect
34 from pylons.controllers.util import redirect
35 from pylons.i18n.translation import _
35 from pylons.i18n.translation import _
36
36
37 from kallithea.lib import helpers as h
37 from kallithea.lib import helpers as h
@@ -29,10 +29,9 b' import time'
29 import logging
29 import logging
30 import traceback
30 import traceback
31 import formencode
31 import formencode
32 from formencode import htmlfill
33
32
34 from pylons import request, response, tmpl_context as c, url
33 from pylons import request, response, tmpl_context as c, url
35 from pylons.controllers.util import abort, redirect
34 from pylons.controllers.util import redirect
36 from pylons.i18n.translation import _
35 from pylons.i18n.translation import _
37
36
38 from kallithea.model.forms import GistForm
37 from kallithea.model.forms import GistForm
@@ -43,7 +42,7 b' from kallithea.lib import helpers as h'
43 from kallithea.lib.base import BaseController, render
42 from kallithea.lib.base import BaseController, render
44 from kallithea.lib.auth import LoginRequired, NotAnonymous
43 from kallithea.lib.auth import LoginRequired, NotAnonymous
45 from kallithea.lib.utils import jsonify
44 from kallithea.lib.utils import jsonify
46 from kallithea.lib.utils2 import safe_str, safe_int, time_to_datetime
45 from kallithea.lib.utils2 import safe_int, time_to_datetime
47 from kallithea.lib.helpers import Page
46 from kallithea.lib.helpers import Page
48 from webob.exc import HTTPNotFound, HTTPForbidden
47 from webob.exc import HTTPNotFound, HTTPForbidden
49 from sqlalchemy.sql.expression import or_
48 from sqlalchemy.sql.expression import or_
@@ -25,12 +25,11 b' Original author and date, and relevant c'
25 :license: GPLv3, see LICENSE.md for more details.
25 :license: GPLv3, see LICENSE.md for more details.
26 """
26 """
27
27
28 import time
29 import logging
28 import logging
30 import traceback
29 import traceback
31 import formencode
30 import formencode
32
31
33 from sqlalchemy import func, or_
32 from sqlalchemy import func
34 from formencode import htmlfill
33 from formencode import htmlfill
35 from pylons import request, tmpl_context as c, url
34 from pylons import request, tmpl_context as c, url
36 from pylons.controllers.util import redirect
35 from pylons.controllers.util import redirect
@@ -42,7 +41,7 b' from kallithea.lib.auth import LoginRequ'
42 from kallithea.lib.base import BaseController, render
41 from kallithea.lib.base import BaseController, render
43 from kallithea.lib.utils2 import generate_api_key, safe_int
42 from kallithea.lib.utils2 import generate_api_key, safe_int
44 from kallithea.lib.compat import json
43 from kallithea.lib.compat import json
45 from kallithea.model.db import Repository, PullRequest, PullRequestReviewers, \
44 from kallithea.model.db import Repository, \
46 UserEmailMap, UserApiKeys, User, UserFollowing
45 UserEmailMap, UserApiKeys, User, UserFollowing
47 from kallithea.model.forms import UserForm, PasswordChangeForm
46 from kallithea.model.forms import UserForm, PasswordChangeForm
48 from kallithea.model.user import UserModel
47 from kallithea.model.user import UserModel
@@ -29,8 +29,8 b' import logging'
29 import traceback
29 import traceback
30
30
31 from pylons import request
31 from pylons import request
32 from pylons import tmpl_context as c, url
32 from pylons import tmpl_context as c
33 from pylons.controllers.util import redirect, abort
33 from pylons.controllers.util import abort
34 from webob.exc import HTTPBadRequest
34 from webob.exc import HTTPBadRequest
35
35
36 from kallithea.model.db import Notification
36 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 pylons import request, session, tmpl_context as c, url
34 from pylons import request, tmpl_context as c, url
35 from pylons.controllers.util import abort, redirect
35 from pylons.controllers.util import redirect
36 from pylons.i18n.translation import _
36 from pylons.i18n.translation import _
37
37
38 from kallithea.lib import helpers as h
38 from kallithea.lib import helpers as h
@@ -41,7 +41,7 b' from kallithea.lib.auth import LoginRequ'
41 from kallithea.lib.base import BaseController, render
41 from kallithea.lib.base import BaseController, render
42 from kallithea.model.forms import DefaultPermissionsForm
42 from kallithea.model.forms import DefaultPermissionsForm
43 from kallithea.model.permission import PermissionModel
43 from kallithea.model.permission import PermissionModel
44 from kallithea.model.db import User, UserIpMap, Permission
44 from kallithea.model.db import User, UserIpMap
45 from kallithea.model.meta import Session
45 from kallithea.model.meta import Session
46
46
47 log = logging.getLogger(__name__)
47 log = logging.getLogger(__name__)
@@ -36,8 +36,6 b' from pylons import request, tmpl_context'
36 from pylons.controllers.util import abort, redirect
36 from pylons.controllers.util import abort, redirect
37 from pylons.i18n.translation import _, ungettext
37 from pylons.i18n.translation import _, ungettext
38
38
39 from sqlalchemy.exc import IntegrityError
40
41 import kallithea
39 import kallithea
42 from kallithea.lib import helpers as h
40 from kallithea.lib import helpers as h
43 from kallithea.lib.compat import json
41 from kallithea.lib.compat import json
@@ -52,7 +50,7 b' from kallithea.model.forms import RepoGr'
52 from kallithea.model.meta import Session
50 from kallithea.model.meta import Session
53 from kallithea.model.repo import RepoModel
51 from kallithea.model.repo import RepoModel
54 from webob.exc import HTTPInternalServerError, HTTPNotFound
52 from webob.exc import HTTPInternalServerError, HTTPNotFound
55 from kallithea.lib.utils2 import str2bool, safe_int
53 from kallithea.lib.utils2 import safe_int
56 from sqlalchemy.sql.expression import func
54 from sqlalchemy.sql.expression import func
57
55
58
56
@@ -25,7 +25,6 b' Original author and date, and relevant c'
25 :license: GPLv3, see LICENSE.md for more details.
25 :license: GPLv3, see LICENSE.md for more details.
26 """
26 """
27
27
28 import time
29 import logging
28 import logging
30 import traceback
29 import traceback
31 import formencode
30 import formencode
@@ -47,8 +46,7 b' from kallithea.model.forms import Applic'
47 from kallithea.model.scm import ScmModel
46 from kallithea.model.scm import ScmModel
48 from kallithea.model.notification import EmailNotificationModel
47 from kallithea.model.notification import EmailNotificationModel
49 from kallithea.model.meta import Session
48 from kallithea.model.meta import Session
50 from kallithea.lib.utils2 import str2bool, safe_unicode, safe_str
49 from kallithea.lib.utils2 import str2bool, safe_unicode
51 from kallithea.lib.compat import json
52 log = logging.getLogger(__name__)
50 log = logging.getLogger(__name__)
53
51
54
52
@@ -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 pylons import request, session, tmpl_context as c, url, config
33 from pylons import request, tmpl_context as c, url, config
34 from pylons.controllers.util import abort, redirect
34 from pylons.controllers.util import redirect
35 from pylons.i18n.translation import _
35 from pylons.i18n.translation import _
36
36
37 from sqlalchemy.orm import joinedload
37 from sqlalchemy.orm import joinedload
@@ -42,7 +42,7 b' import kallithea'
42 from kallithea.lib import helpers as h
42 from kallithea.lib import helpers as h
43 from kallithea.lib.exceptions import UserGroupsAssignedException,\
43 from kallithea.lib.exceptions import UserGroupsAssignedException,\
44 RepoGroupAssignmentError
44 RepoGroupAssignmentError
45 from kallithea.lib.utils2 import safe_unicode, str2bool, safe_int
45 from kallithea.lib.utils2 import safe_unicode, safe_int
46 from kallithea.lib.auth import LoginRequired, HasPermissionAllDecorator,\
46 from kallithea.lib.auth import LoginRequired, HasPermissionAllDecorator,\
47 HasUserGroupPermissionAnyDecorator, HasPermissionAnyDecorator
47 HasUserGroupPermissionAnyDecorator, HasPermissionAnyDecorator
48 from kallithea.lib.base import BaseController, render
48 from kallithea.lib.base import BaseController, render
@@ -28,10 +28,9 b' Original author and date, and relevant c'
28 import logging
28 import logging
29 import traceback
29 import traceback
30 import formencode
30 import formencode
31 from pylons import response
32
31
33 from formencode import htmlfill
32 from formencode import htmlfill
34 from pylons import request, session, tmpl_context as c, url, config
33 from pylons import request, tmpl_context as c, url, config
35 from pylons.controllers.util import redirect
34 from pylons.controllers.util import redirect
36 from pylons.i18n.translation import _
35 from pylons.i18n.translation import _
37 from sqlalchemy.sql.expression import func
36 from sqlalchemy.sql.expression import func
@@ -53,7 +52,7 b' from kallithea.model.user import UserMod'
53 from kallithea.model.meta import Session
52 from kallithea.model.meta import Session
54 from kallithea.lib.utils import action_logger
53 from kallithea.lib.utils import action_logger
55 from kallithea.lib.compat import json
54 from kallithea.lib.compat import json
56 from kallithea.lib.utils2 import datetime_to_time, str2bool, safe_int
55 from kallithea.lib.utils2 import datetime_to_time, safe_int
57
56
58 log = logging.getLogger(__name__)
57 log = logging.getLogger(__name__)
59
58
@@ -28,7 +28,6 b' Original author and date, and relevant c'
28 import inspect
28 import inspect
29 import logging
29 import logging
30 import types
30 import types
31 import urllib
32 import traceback
31 import traceback
33 import time
32 import time
34
33
@@ -31,7 +31,7 b' import traceback'
31 from collections import defaultdict
31 from collections import defaultdict
32 from webob.exc import HTTPForbidden, HTTPBadRequest, HTTPNotFound
32 from webob.exc import HTTPForbidden, HTTPBadRequest, HTTPNotFound
33
33
34 from pylons import tmpl_context as c, url, request, response
34 from pylons import tmpl_context as c, request, response
35 from pylons.i18n.translation import _
35 from pylons.i18n.translation import _
36 from pylons.controllers.util import redirect
36 from pylons.controllers.util import redirect
37 from kallithea.lib.utils import jsonify
37 from kallithea.lib.utils import jsonify
@@ -55,7 +55,7 b' from kallithea.model.repo import RepoMod'
55 from kallithea.lib.diffs import LimitedDiffContainer
55 from kallithea.lib.diffs import LimitedDiffContainer
56 from kallithea.lib.exceptions import StatusChangeOnClosedPullRequestError
56 from kallithea.lib.exceptions import StatusChangeOnClosedPullRequestError
57 from kallithea.lib.vcs.backends.base import EmptyChangeset
57 from kallithea.lib.vcs.backends.base import EmptyChangeset
58 from kallithea.lib.utils2 import safe_unicode, safe_str
58 from kallithea.lib.utils2 import safe_unicode
59 from kallithea.lib.graphmod import graph_data
59 from kallithea.lib.graphmod import graph_data
60
60
61 log = logging.getLogger(__name__)
61 log = logging.getLogger(__name__)
@@ -28,15 +28,13 b' Original author and date, and relevant c'
28
28
29
29
30 import logging
30 import logging
31 import traceback
32 import re
31 import re
33
32
34 from webob.exc import HTTPNotFound, HTTPBadRequest
33 from webob.exc import HTTPBadRequest
35 from pylons import request, response, session, tmpl_context as c, url
34 from pylons import request, tmpl_context as c, url
36 from pylons.controllers.util import abort, redirect
35 from pylons.controllers.util import redirect
37 from pylons.i18n.translation import _
36 from pylons.i18n.translation import _
38
37
39 from kallithea.lib.vcs.utils import safe_str
40 from kallithea.lib.vcs.utils.hgcompat import unionrepo
38 from kallithea.lib.vcs.utils.hgcompat import unionrepo
41 from kallithea.lib import helpers as h
39 from kallithea.lib import helpers as h
42 from kallithea.lib.base import BaseRepoController, render
40 from kallithea.lib.base import BaseRepoController, render
@@ -44,7 +42,7 b' from kallithea.lib.auth import LoginRequ'
44 from kallithea.lib import diffs
42 from kallithea.lib import diffs
45 from kallithea.model.db import Repository
43 from kallithea.model.db import Repository
46 from kallithea.lib.diffs import LimitedDiffContainer
44 from kallithea.lib.diffs import LimitedDiffContainer
47 from kallithea.controllers.changeset import anchor_url, _ignorews_url,\
45 from kallithea.controllers.changeset import _ignorews_url,\
48 _context_url, get_line_ctx, get_ignore_ws
46 _context_url, get_line_ctx, get_ignore_ws
49 from kallithea.lib.graphmod import graph_data
47 from kallithea.lib.graphmod import graph_data
50 from kallithea.lib.compat import json
48 from kallithea.lib.compat import json
@@ -30,7 +30,7 b' import cgi'
30 import logging
30 import logging
31 import paste.fileapp
31 import paste.fileapp
32
32
33 from pylons import tmpl_context as c, request, config, url
33 from pylons import tmpl_context as c, request, config
34 from pylons.i18n.translation import _
34 from pylons.i18n.translation import _
35 from pylons.middleware import media_path
35 from pylons.middleware import media_path
36
36
@@ -60,7 +60,7 b' from kallithea.model.db import Repositor'
60 from kallithea.controllers.changeset import anchor_url, _ignorews_url,\
60 from kallithea.controllers.changeset import anchor_url, _ignorews_url,\
61 _context_url, get_line_ctx, get_ignore_ws
61 _context_url, get_line_ctx, get_ignore_ws
62 from webob.exc import HTTPNotFound
62 from webob.exc import HTTPNotFound
63 from kallithea.lib.exceptions import NonRelativePathError, IMCCommitError
63 from kallithea.lib.exceptions import NonRelativePathError
64
64
65
65
66 log = logging.getLogger(__name__)
66 log = logging.getLogger(__name__)
@@ -32,7 +32,7 b' from pylons import tmpl_context as c, re'
32 from kallithea.lib.helpers import Page
32 from kallithea.lib.helpers import Page
33 from kallithea.lib.auth import LoginRequired, HasRepoPermissionAnyDecorator
33 from kallithea.lib.auth import LoginRequired, HasRepoPermissionAnyDecorator
34 from kallithea.lib.base import BaseRepoController, render
34 from kallithea.lib.base import BaseRepoController, render
35 from kallithea.model.db import Repository, User, UserFollowing
35 from kallithea.model.db import UserFollowing
36 from kallithea.lib.utils2 import safe_int
36 from kallithea.lib.utils2 import safe_int
37
37
38 log = logging.getLogger(__name__)
38 log = logging.getLogger(__name__)
@@ -33,7 +33,6 b' from formencode import htmlfill'
33 from pylons import tmpl_context as c, request, url
33 from pylons import tmpl_context as c, request, url
34 from pylons.controllers.util import redirect
34 from pylons.controllers.util import redirect
35 from pylons.i18n.translation import _
35 from pylons.i18n.translation import _
36 from webob.exc import HTTPNotFound, HTTPInternalServerError
37
36
38 import kallithea.lib.helpers as h
37 import kallithea.lib.helpers as h
39
38
@@ -47,7 +46,6 b' from kallithea.model.repo import RepoMod'
47 from kallithea.model.forms import RepoForkForm
46 from kallithea.model.forms import RepoForkForm
48 from kallithea.model.scm import ScmModel, RepoGroupList
47 from kallithea.model.scm import ScmModel, RepoGroupList
49 from kallithea.lib.utils2 import safe_int
48 from kallithea.lib.utils2 import safe_int
50 from kallithea.lib.utils import jsonify
51
49
52 log = logging.getLogger(__name__)
50 log = logging.getLogger(__name__)
53
51
@@ -33,8 +33,6 b' from pylons.i18n.translation import _'
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
36 import kallithea
37 from kallithea.lib import helpers as h
38 from kallithea.lib.utils import jsonify, conditional_cache
36 from kallithea.lib.utils import jsonify, conditional_cache
39 from kallithea.lib.compat import json
37 from kallithea.lib.compat import json
40 from kallithea.lib.auth import LoginRequired, HasRepoPermissionAnyDecorator
38 from kallithea.lib.auth import LoginRequired, HasRepoPermissionAnyDecorator
@@ -31,8 +31,6 b' import formencode'
31 import re
31 import re
32
32
33 from webob.exc import HTTPNotFound, HTTPForbidden
33 from webob.exc import HTTPNotFound, HTTPForbidden
34 from collections import defaultdict
35 from itertools import groupby
36
34
37 from pylons import request, tmpl_context as c, url
35 from pylons import request, tmpl_context as c, url
38 from pylons.controllers.util import redirect
36 from pylons.controllers.util import redirect
@@ -58,7 +56,7 b' from kallithea.model.comment import Chan'
58 from kallithea.model.changeset_status import ChangesetStatusModel
56 from kallithea.model.changeset_status import ChangesetStatusModel
59 from kallithea.model.forms import PullRequestForm, PullRequestPostForm
57 from kallithea.model.forms import PullRequestForm, PullRequestPostForm
60 from kallithea.lib.utils2 import safe_int
58 from kallithea.lib.utils2 import safe_int
61 from kallithea.controllers.changeset import anchor_url, _ignorews_url,\
59 from kallithea.controllers.changeset import _ignorews_url,\
62 _context_url, get_line_ctx, get_ignore_ws
60 _context_url, get_line_ctx, get_ignore_ws
63 from kallithea.controllers.compare import CompareController
61 from kallithea.controllers.compare import CompareController
64 from kallithea.lib.graphmod import graph_data
62 from kallithea.lib.graphmod import graph_data
@@ -33,7 +33,7 b' from pylons import request, config, tmpl'
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
36 from whoosh.query import Phrase, Wildcard, Term, Prefix
36 from whoosh.query import Phrase, Prefix
37 from webhelpers.util import update_params
37 from webhelpers.util import update_params
38
38
39 from kallithea.lib.auth import LoginRequired
39 from kallithea.lib.auth import LoginRequired
@@ -28,12 +28,10 b' Original author and date, and relevant c'
28 import traceback
28 import traceback
29 import calendar
29 import calendar
30 import logging
30 import logging
31 import urllib
32 from time import mktime
31 from time import mktime
33 from datetime import timedelta, date
32 from datetime import timedelta, date
34 from urlparse import urlparse
35
33
36 from pylons import tmpl_context as c, request, url, config
34 from pylons import tmpl_context as c, request
37 from pylons.i18n.translation import _
35 from pylons.i18n.translation import _
38 from webob.exc import HTTPBadRequest
36 from webob.exc import HTTPBadRequest
39
37
@@ -45,7 +43,7 b' from kallithea.lib.vcs.exceptions import'
45 from kallithea.config.conf import ALL_READMES, ALL_EXTS, LANGUAGES_EXTENSIONS_MAP
43 from kallithea.config.conf import ALL_READMES, ALL_EXTS, LANGUAGES_EXTENSIONS_MAP
46 from kallithea.model.db import Statistics, CacheInvalidation, User
44 from kallithea.model.db import Statistics, CacheInvalidation, User
47 from kallithea.lib.utils import jsonify
45 from kallithea.lib.utils import jsonify
48 from kallithea.lib.utils2 import safe_unicode, safe_str
46 from kallithea.lib.utils2 import safe_str
49 from kallithea.lib.auth import LoginRequired, HasRepoPermissionAnyDecorator,\
47 from kallithea.lib.auth import LoginRequired, HasRepoPermissionAnyDecorator,\
50 NotAnonymous
48 NotAnonymous
51 from kallithea.lib.base import BaseRepoController, render
49 from kallithea.lib.base import BaseRepoController, render
@@ -58,7 +58,6 b' from kallithea.lib.utils import get_repo'
58 get_user_group_slug, conditional_cache
58 get_user_group_slug, conditional_cache
59 from kallithea.lib.caching_query import FromCache
59 from kallithea.lib.caching_query import FromCache
60
60
61 from beaker.cache import cache_region
62
61
63 log = logging.getLogger(__name__)
62 log = logging.getLogger(__name__)
64
63
@@ -24,7 +24,7 b' from kallithea.lib.utils2 import str2boo'
24 from kallithea.lib.compat import formatted_json, hybrid_property
24 from kallithea.lib.compat import formatted_json, hybrid_property
25 from kallithea.lib.auth import PasswordGenerator
25 from kallithea.lib.auth import PasswordGenerator
26 from kallithea.model.user import UserModel
26 from kallithea.model.user import UserModel
27 from kallithea.model.db import Setting, User, UserGroup
27 from kallithea.model.db import Setting, User
28 from kallithea.model.meta import Session
28 from kallithea.model.meta import Session
29 from kallithea.model.user_group import UserGroupModel
29 from kallithea.model.user_group import UserGroupModel
30
30
@@ -57,7 +57,6 b' from kallithea.model import meta'
57 from kallithea.model.db import Repository, Ui, User, Setting
57 from kallithea.model.db import Repository, Ui, User, Setting
58 from kallithea.model.notification import NotificationModel
58 from kallithea.model.notification import NotificationModel
59 from kallithea.model.scm import ScmModel
59 from kallithea.model.scm import ScmModel
60 from kallithea.model.meta import Session
61 from kallithea.model.pull_request import PullRequestModel
60 from kallithea.model.pull_request import PullRequestModel
62
61
63 log = logging.getLogger(__name__)
62 log = logging.getLogger(__name__)
@@ -26,12 +26,10 b' Original author and date, and relevant c'
26 """
26 """
27
27
28
28
29 import os
30 import sys
31 import socket
29 import socket
32 import traceback
30 import traceback
33 import logging
31 import logging
34 from os.path import dirname as dn, join as jn
32 from os.path import join as jn
35 from pylons import config
33 from pylons import config
36
34
37 from hashlib import md5
35 from hashlib import md5
@@ -43,11 +41,9 b' from kallithea.lib.utils2 import str2boo'
43 from kallithea.lib.pidlock import DaemonLock, LockHeld
41 from kallithea.lib.pidlock import DaemonLock, LockHeld
44 from kallithea.model import init_model
42 from kallithea.model import init_model
45 from kallithea.model import meta
43 from kallithea.model import meta
46 from kallithea.model.db import Statistics, Repository, User
47
44
48 from sqlalchemy import engine_from_config
45 from sqlalchemy import engine_from_config
49
46
50 from celery.messaging import establish_connection
51
47
52 log = logging.getLogger(__name__)
48 log = logging.getLogger(__name__)
53
49
@@ -37,13 +37,9 b' from time import mktime'
37 from operator import itemgetter
37 from operator import itemgetter
38 from string import lower
38 from string import lower
39
39
40 from pylons import config, url
40 from pylons import config
41 from pylons.i18n.translation import _
42
41
43 from kallithea.lib.vcs import get_backend
42 from kallithea import CELERY_ON
44
45 from kallithea import CELERY_ON, CELERY_EAGER
46 from kallithea.lib.utils2 import safe_str
47 from kallithea.lib.celerylib import run_task, locked_task, dbsession, \
43 from kallithea.lib.celerylib import run_task, locked_task, dbsession, \
48 str2bool, __get_lockkey, LockHeld, DaemonLock, get_session
44 str2bool, __get_lockkey, LockHeld, DaemonLock, get_session
49 from kallithea.lib.helpers import person
45 from kallithea.lib.helpers import person
@@ -53,7 +49,6 b' from kallithea.lib.compat import json, O'
53 from kallithea.lib.hooks import log_create_repository
49 from kallithea.lib.hooks import log_create_repository
54
50
55 from kallithea.model.db import Statistics, Repository, User
51 from kallithea.model.db import Statistics, Repository, User
56 from kallithea.model.scm import ScmModel
57
52
58
53
59 add_cache(config) # pragma: no cover
54 add_cache(config) # pragma: no cover
@@ -32,7 +32,6 b' import time'
32 import uuid
32 import uuid
33 import logging
33 import logging
34 from os.path import dirname as dn, join as jn
34 from os.path import dirname as dn, join as jn
35 import datetime
36
35
37 from kallithea import __dbversion__, __py_version__, EXTERN_TYPE_INTERNAL, DB_MIGRATIONS
36 from kallithea import __dbversion__, __py_version__, EXTERN_TYPE_INTERNAL, DB_MIGRATIONS
38 from kallithea.model.user import UserModel
37 from kallithea.model.user import UserModel
@@ -48,7 +47,6 b' from kallithea.model.repo_group import R'
48 from kallithea.model.meta import Session, Base
47 from kallithea.model.meta import Session, Base
49 from kallithea.model.repo import RepoModel
48 from kallithea.model.repo import RepoModel
50 from kallithea.model.permission import PermissionModel
49 from kallithea.model.permission import PermissionModel
51 from kallithea.model.user_group import UserGroupModel
52
50
53
51
54 log = logging.getLogger(__name__)
52 log = logging.getLogger(__name__)
@@ -26,8 +26,6 b' Original author and date, and relevant c'
26 """
26 """
27
27
28 import logging
28 import logging
29 from sqlalchemy import engine_from_config
30
31
29
32 from kallithea.lib.utils import BasePasterCommand, Command, add_cache
30 from kallithea.lib.utils import BasePasterCommand, Command, add_cache
33 from kallithea.lib.db_manage import DbManage
31 from kallithea.lib.db_manage import DbManage
@@ -1,6 +1,5 b''
1 from sqlalchemy import *
1 from sqlalchemy import *
2 from sqlalchemy.exc import DatabaseError
2 from sqlalchemy.orm import relation, class_mapper
3 from sqlalchemy.orm import relation, backref, class_mapper
4 from sqlalchemy.orm.session import Session
3 from sqlalchemy.orm.session import Session
5 from kallithea.model.meta import Base
4 from kallithea.model.meta import Base
6
5
@@ -37,7 +37,6 b' from collections import defaultdict'
37 from sqlalchemy import *
37 from sqlalchemy import *
38 from sqlalchemy.ext.hybrid import hybrid_property
38 from sqlalchemy.ext.hybrid import hybrid_property
39 from sqlalchemy.orm import relationship, joinedload, class_mapper, validates
39 from sqlalchemy.orm import relationship, joinedload, class_mapper, validates
40 from sqlalchemy.exc import DatabaseError
41 from beaker.cache import cache_region, region_invalidate
40 from beaker.cache import cache_region, region_invalidate
42 from webob.exc import HTTPNotFound
41 from webob.exc import HTTPNotFound
43
42
@@ -50,7 +49,6 b' from kallithea.lib.vcs.utils.lazy import'
50
49
51 from kallithea.lib.utils2 import str2bool, safe_str, get_changeset_safe, \
50 from kallithea.lib.utils2 import str2bool, safe_str, get_changeset_safe, \
52 safe_unicode, remove_suffix
51 safe_unicode, remove_suffix
53 from kallithea.lib.compat import json
54 from kallithea.lib.caching_query import FromCache
52 from kallithea.lib.caching_query import FromCache
55
53
56 from kallithea.model.meta import Base, Session
54 from kallithea.model.meta import Base, Session
@@ -36,7 +36,6 b' from collections import defaultdict'
36 from sqlalchemy import *
36 from sqlalchemy import *
37 from sqlalchemy.ext.hybrid import hybrid_property
37 from sqlalchemy.ext.hybrid import hybrid_property
38 from sqlalchemy.orm import relationship, joinedload, class_mapper, validates
38 from sqlalchemy.orm import relationship, joinedload, class_mapper, validates
39 from sqlalchemy.exc import DatabaseError
40 from beaker.cache import cache_region, region_invalidate
39 from beaker.cache import cache_region, region_invalidate
41 from webob.exc import HTTPNotFound
40 from webob.exc import HTTPNotFound
42
41
@@ -49,7 +48,6 b' from kallithea.lib.vcs.utils.lazy import'
49
48
50 from kallithea.lib.utils2 import str2bool, safe_str, get_changeset_safe, \
49 from kallithea.lib.utils2 import str2bool, safe_str, get_changeset_safe, \
51 safe_unicode, remove_suffix, remove_prefix
50 safe_unicode, remove_suffix, remove_prefix
52 from kallithea.lib.compat import json
53 from kallithea.lib.caching_query import FromCache
51 from kallithea.lib.caching_query import FromCache
54
52
55 from kallithea.model.meta import Base, Session
53 from kallithea.model.meta import Base, Session
@@ -36,7 +36,6 b' from collections import defaultdict'
36 from sqlalchemy import *
36 from sqlalchemy import *
37 from sqlalchemy.ext.hybrid import hybrid_property
37 from sqlalchemy.ext.hybrid import hybrid_property
38 from sqlalchemy.orm import relationship, joinedload, class_mapper, validates
38 from sqlalchemy.orm import relationship, joinedload, class_mapper, validates
39 from sqlalchemy.exc import DatabaseError
40 from beaker.cache import cache_region, region_invalidate
39 from beaker.cache import cache_region, region_invalidate
41 from webob.exc import HTTPNotFound
40 from webob.exc import HTTPNotFound
42
41
@@ -36,7 +36,6 b' from collections import defaultdict'
36 from sqlalchemy import *
36 from sqlalchemy import *
37 from sqlalchemy.ext.hybrid import hybrid_property
37 from sqlalchemy.ext.hybrid import hybrid_property
38 from sqlalchemy.orm import relationship, joinedload, class_mapper, validates
38 from sqlalchemy.orm import relationship, joinedload, class_mapper, validates
39 from sqlalchemy.exc import DatabaseError
40 from beaker.cache import cache_region, region_invalidate
39 from beaker.cache import cache_region, region_invalidate
41 from webob.exc import HTTPNotFound
40 from webob.exc import HTTPNotFound
42
41
@@ -36,7 +36,6 b' import collections'
36 from sqlalchemy import *
36 from sqlalchemy import *
37 from sqlalchemy.ext.hybrid import hybrid_property
37 from sqlalchemy.ext.hybrid import hybrid_property
38 from sqlalchemy.orm import relationship, joinedload, class_mapper, validates
38 from sqlalchemy.orm import relationship, joinedload, class_mapper, validates
39 from sqlalchemy.exc import DatabaseError
40 from beaker.cache import cache_region, region_invalidate
39 from beaker.cache import cache_region, region_invalidate
41 from webob.exc import HTTPNotFound
40 from webob.exc import HTTPNotFound
42
41
@@ -36,7 +36,6 b' import collections'
36 from sqlalchemy import *
36 from sqlalchemy import *
37 from sqlalchemy.ext.hybrid import hybrid_property
37 from sqlalchemy.ext.hybrid import hybrid_property
38 from sqlalchemy.orm import relationship, joinedload, class_mapper, validates
38 from sqlalchemy.orm import relationship, joinedload, class_mapper, validates
39 from sqlalchemy.exc import DatabaseError
40 from beaker.cache import cache_region, region_invalidate
39 from beaker.cache import cache_region, region_invalidate
41 from webob.exc import HTTPNotFound
40 from webob.exc import HTTPNotFound
42
41
@@ -37,7 +37,6 b' import functools'
37 from sqlalchemy import *
37 from sqlalchemy import *
38 from sqlalchemy.ext.hybrid import hybrid_property
38 from sqlalchemy.ext.hybrid import hybrid_property
39 from sqlalchemy.orm import relationship, joinedload, class_mapper, validates
39 from sqlalchemy.orm import relationship, joinedload, class_mapper, validates
40 from sqlalchemy.exc import DatabaseError
41 from beaker.cache import cache_region, region_invalidate
40 from beaker.cache import cache_region, region_invalidate
42 from webob.exc import HTTPNotFound
41 from webob.exc import HTTPNotFound
43
42
@@ -37,7 +37,6 b' import functools'
37 from sqlalchemy import *
37 from sqlalchemy import *
38 from sqlalchemy.ext.hybrid import hybrid_property
38 from sqlalchemy.ext.hybrid import hybrid_property
39 from sqlalchemy.orm import relationship, joinedload, class_mapper, validates
39 from sqlalchemy.orm import relationship, joinedload, class_mapper, validates
40 from sqlalchemy.exc import DatabaseError
41 from beaker.cache import cache_region, region_invalidate
40 from beaker.cache import cache_region, region_invalidate
42 from webob.exc import HTTPNotFound
41 from webob.exc import HTTPNotFound
43
42
@@ -37,7 +37,6 b' import functools'
37 from sqlalchemy import *
37 from sqlalchemy import *
38 from sqlalchemy.ext.hybrid import hybrid_property
38 from sqlalchemy.ext.hybrid import hybrid_property
39 from sqlalchemy.orm import relationship, joinedload, class_mapper, validates
39 from sqlalchemy.orm import relationship, joinedload, class_mapper, validates
40 from sqlalchemy.exc import DatabaseError
41 from beaker.cache import cache_region, region_invalidate
40 from beaker.cache import cache_region, region_invalidate
42 from webob.exc import HTTPNotFound
41 from webob.exc import HTTPNotFound
43
42
@@ -37,7 +37,6 b' import functools'
37 from sqlalchemy import *
37 from sqlalchemy import *
38 from sqlalchemy.ext.hybrid import hybrid_property
38 from sqlalchemy.ext.hybrid import hybrid_property
39 from sqlalchemy.orm import relationship, joinedload, class_mapper, validates
39 from sqlalchemy.orm import relationship, joinedload, class_mapper, validates
40 from sqlalchemy.exc import DatabaseError
41 from beaker.cache import cache_region, region_invalidate
40 from beaker.cache import cache_region, region_invalidate
42 from webob.exc import HTTPNotFound
41 from webob.exc import HTTPNotFound
43
42
@@ -37,7 +37,6 b' import functools'
37 from sqlalchemy import *
37 from sqlalchemy import *
38 from sqlalchemy.ext.hybrid import hybrid_property
38 from sqlalchemy.ext.hybrid import hybrid_property
39 from sqlalchemy.orm import relationship, joinedload, class_mapper, validates
39 from sqlalchemy.orm import relationship, joinedload, class_mapper, validates
40 from sqlalchemy.exc import DatabaseError
41 from beaker.cache import cache_region, region_invalidate
40 from beaker.cache import cache_region, region_invalidate
42 from webob.exc import HTTPNotFound
41 from webob.exc import HTTPNotFound
43
42
@@ -37,7 +37,6 b' import functools'
37 from sqlalchemy import *
37 from sqlalchemy import *
38 from sqlalchemy.ext.hybrid import hybrid_property
38 from sqlalchemy.ext.hybrid import hybrid_property
39 from sqlalchemy.orm import relationship, joinedload, class_mapper, validates
39 from sqlalchemy.orm import relationship, joinedload, class_mapper, validates
40 from sqlalchemy.exc import DatabaseError
41 from beaker.cache import cache_region, region_invalidate
40 from beaker.cache import cache_region, region_invalidate
42 from webob.exc import HTTPNotFound
41 from webob.exc import HTTPNotFound
43
42
@@ -6,7 +6,7 b' import datetime'
6
6
7 from sqlalchemy import *
7 from sqlalchemy import *
8 from sqlalchemy.exc import DatabaseError
8 from sqlalchemy.exc import DatabaseError
9 from sqlalchemy.orm import relation, backref, class_mapper
9 from sqlalchemy.orm import relation
10 from sqlalchemy.orm.session import Session
10 from sqlalchemy.orm.session import Session
11 from kallithea.model.meta import Base
11 from kallithea.model.meta import Base
12
12
@@ -1,11 +1,6 b''
1 import logging
1 import logging
2 import datetime
3
2
4 from sqlalchemy import *
3 from sqlalchemy import *
5 from sqlalchemy.exc import DatabaseError
6 from sqlalchemy.orm import relation, backref, class_mapper
7 from sqlalchemy.orm.session import Session
8 from kallithea.model.meta import Base
9
4
10 from kallithea.lib.dbmigrate.migrate import *
5 from kallithea.lib.dbmigrate.migrate import *
11 from kallithea.lib.dbmigrate.migrate.changeset import *
6 from kallithea.lib.dbmigrate.migrate.changeset import *
@@ -2,14 +2,10 b' import logging'
2 import datetime
2 import datetime
3
3
4 from sqlalchemy import *
4 from sqlalchemy import *
5 from sqlalchemy.exc import DatabaseError
6 from sqlalchemy.orm import relation, backref, class_mapper
7 from sqlalchemy.orm.session import Session
8
5
9 from kallithea.lib.dbmigrate.migrate import *
6 from kallithea.lib.dbmigrate.migrate import *
10 from kallithea.lib.dbmigrate.migrate.changeset import *
7 from kallithea.lib.dbmigrate.migrate.changeset import *
11
8
12 from kallithea.model.meta import Base
13
9
14 log = logging.getLogger(__name__)
10 log = logging.getLogger(__name__)
15
11
@@ -1,15 +1,10 b''
1 import logging
1 import logging
2 import datetime
3
2
4 from sqlalchemy import *
3 from sqlalchemy import *
5 from sqlalchemy.exc import DatabaseError
6 from sqlalchemy.orm import relation, backref, class_mapper
7 from sqlalchemy.orm.session import Session
8
4
9 from kallithea.lib.dbmigrate.migrate import *
5 from kallithea.lib.dbmigrate.migrate import *
10 from kallithea.lib.dbmigrate.migrate.changeset import *
6 from kallithea.lib.dbmigrate.migrate.changeset import *
11
7
12 from kallithea.model.meta import Base
13
8
14 log = logging.getLogger(__name__)
9 log = logging.getLogger(__name__)
15
10
@@ -1,15 +1,10 b''
1 import logging
1 import logging
2 import datetime
3
2
4 from sqlalchemy import *
3 from sqlalchemy import *
5 from sqlalchemy.exc import DatabaseError
6 from sqlalchemy.orm import relation, backref, class_mapper
7 from sqlalchemy.orm.session import Session
8
4
9 from kallithea.lib.dbmigrate.migrate import *
5 from kallithea.lib.dbmigrate.migrate import *
10 from kallithea.lib.dbmigrate.migrate.changeset import *
6 from kallithea.lib.dbmigrate.migrate.changeset import *
11
7
12 from kallithea.model.meta import Base
13
8
14 log = logging.getLogger(__name__)
9 log = logging.getLogger(__name__)
15
10
@@ -2,16 +2,10 b' import logging'
2 import datetime
2 import datetime
3
3
4 from sqlalchemy import *
4 from sqlalchemy import *
5 from sqlalchemy.exc import DatabaseError
6 from sqlalchemy.orm import relation, backref, class_mapper
7 from sqlalchemy.orm.session import Session
8 from sqlalchemy.ext.declarative import declarative_base
9
5
10 from kallithea.lib.dbmigrate.migrate import *
6 from kallithea.lib.dbmigrate.migrate import *
11 from kallithea.lib.dbmigrate.migrate.changeset import *
7 from kallithea.lib.dbmigrate.migrate.changeset import *
12
8
13 from kallithea.model.meta import Base
14 from kallithea.model import meta
15 from kallithea.lib.dbmigrate.versions import _reset_base
9 from kallithea.lib.dbmigrate.versions import _reset_base
16
10
17 log = logging.getLogger(__name__)
11 log = logging.getLogger(__name__)
@@ -1,17 +1,10 b''
1 import logging
1 import logging
2 import datetime
3
2
4 from sqlalchemy import *
3 from sqlalchemy import *
5 from sqlalchemy.exc import DatabaseError
6 from sqlalchemy.orm import relation, backref, class_mapper
7 from sqlalchemy.orm.session import Session
8 from sqlalchemy.ext.declarative import declarative_base
9
4
10 from kallithea.lib.dbmigrate.migrate import *
5 from kallithea.lib.dbmigrate.migrate import *
11 from kallithea.lib.dbmigrate.migrate.changeset import *
6 from kallithea.lib.dbmigrate.migrate.changeset import *
12
7
13 from kallithea.model.meta import Base
14 from kallithea.model import meta
15
8
16 log = logging.getLogger(__name__)
9 log = logging.getLogger(__name__)
17
10
@@ -1,16 +1,11 b''
1 import logging
1 import logging
2 import datetime
3
2
4 from sqlalchemy import *
3 from sqlalchemy import *
5 from sqlalchemy.exc import DatabaseError
4 from sqlalchemy.orm import joinedload
6 from sqlalchemy.orm import relation, backref, class_mapper, joinedload
7 from sqlalchemy.orm.session import Session
8 from sqlalchemy.ext.declarative import declarative_base
9
5
10 from kallithea.lib.dbmigrate.migrate import *
6 from kallithea.lib.dbmigrate.migrate import *
11 from kallithea.lib.dbmigrate.migrate.changeset import *
7 from kallithea.lib.dbmigrate.migrate.changeset import *
12
8
13 from kallithea.model.meta import Base
14 from kallithea.model import meta
9 from kallithea.model import meta
15 from kallithea.lib.dbmigrate.versions import _reset_base
10 from kallithea.lib.dbmigrate.versions import _reset_base
16
11
@@ -1,17 +1,10 b''
1 import logging
1 import logging
2 import datetime
3
2
4 from sqlalchemy import *
3 from sqlalchemy import *
5 from sqlalchemy.exc import DatabaseError
6 from sqlalchemy.orm import relation, backref, class_mapper, joinedload
7 from sqlalchemy.orm.session import Session
8 from sqlalchemy.ext.declarative import declarative_base
9
4
10 from kallithea.lib.dbmigrate.migrate import *
5 from kallithea.lib.dbmigrate.migrate import *
11 from kallithea.lib.dbmigrate.migrate.changeset import *
6 from kallithea.lib.dbmigrate.migrate.changeset import *
12
7
13 from kallithea.model.meta import Base
14 from kallithea.model import meta
15
8
16 log = logging.getLogger(__name__)
9 log = logging.getLogger(__name__)
17
10
@@ -1,16 +1,10 b''
1 import logging
1 import logging
2 import datetime
3
2
4 from sqlalchemy import *
3 from sqlalchemy import *
5 from sqlalchemy.exc import DatabaseError
6 from sqlalchemy.orm import relation, backref, class_mapper, joinedload
7 from sqlalchemy.orm.session import Session
8 from sqlalchemy.ext.declarative import declarative_base
9
4
10 from kallithea.lib.dbmigrate.migrate import *
5 from kallithea.lib.dbmigrate.migrate import *
11 from kallithea.lib.dbmigrate.migrate.changeset import *
6 from kallithea.lib.dbmigrate.migrate.changeset import *
12
7
13 from kallithea.model.meta import Base
14 from kallithea.model import meta
8 from kallithea.model import meta
15 from kallithea.lib.dbmigrate.versions import _reset_base, notify
9 from kallithea.lib.dbmigrate.versions import _reset_base, notify
16
10
@@ -1,16 +1,10 b''
1 import logging
1 import logging
2 import datetime
3
2
4 from sqlalchemy import *
3 from sqlalchemy import *
5 from sqlalchemy.exc import DatabaseError
6 from sqlalchemy.orm import relation, backref, class_mapper, joinedload
7 from sqlalchemy.orm.session import Session
8 from sqlalchemy.ext.declarative import declarative_base
9
4
10 from kallithea.lib.dbmigrate.migrate import *
5 from kallithea.lib.dbmigrate.migrate import *
11 from kallithea.lib.dbmigrate.migrate.changeset import *
6 from kallithea.lib.dbmigrate.migrate.changeset import *
12
7
13 from kallithea.model.meta import Base
14 from kallithea.model import meta
8 from kallithea.model import meta
15 from kallithea.lib.dbmigrate.versions import _reset_base, notify
9 from kallithea.lib.dbmigrate.versions import _reset_base, notify
16
10
@@ -1,16 +1,10 b''
1 import logging
1 import logging
2 import datetime
3
2
4 from sqlalchemy import *
3 from sqlalchemy import *
5 from sqlalchemy.exc import DatabaseError
6 from sqlalchemy.orm import relation, backref, class_mapper, joinedload
7 from sqlalchemy.orm.session import Session
8 from sqlalchemy.ext.declarative import declarative_base
9
4
10 from kallithea.lib.dbmigrate.migrate import *
5 from kallithea.lib.dbmigrate.migrate import *
11 from kallithea.lib.dbmigrate.migrate.changeset import *
6 from kallithea.lib.dbmigrate.migrate.changeset import *
12
7
13 from kallithea.model.meta import Base
14 from kallithea.model import meta
8 from kallithea.model import meta
15 from kallithea.lib.dbmigrate.versions import _reset_base
9 from kallithea.lib.dbmigrate.versions import _reset_base
16
10
@@ -1,17 +1,10 b''
1 import logging
1 import logging
2 import datetime
3
2
4 from sqlalchemy import *
3 from sqlalchemy import *
5 from sqlalchemy.exc import DatabaseError
6 from sqlalchemy.orm import relation, backref, class_mapper, joinedload
7 from sqlalchemy.orm.session import Session
8 from sqlalchemy.ext.declarative import declarative_base
9
4
10 from kallithea.lib.dbmigrate.migrate import *
5 from kallithea.lib.dbmigrate.migrate import *
11 from kallithea.lib.dbmigrate.migrate.changeset import *
6 from kallithea.lib.dbmigrate.migrate.changeset import *
12
7
13 from kallithea.model.meta import Base
14 from kallithea.model import meta
15 from kallithea.lib.dbmigrate.versions import _reset_base
8 from kallithea.lib.dbmigrate.versions import _reset_base
16
9
17 log = logging.getLogger(__name__)
10 log = logging.getLogger(__name__)
@@ -2,15 +2,10 b' import logging'
2 import datetime
2 import datetime
3
3
4 from sqlalchemy import *
4 from sqlalchemy import *
5 from sqlalchemy.exc import DatabaseError
6 from sqlalchemy.orm import relation, backref, class_mapper, joinedload
7 from sqlalchemy.orm.session import Session
8 from sqlalchemy.ext.declarative import declarative_base
9
5
10 from kallithea.lib.dbmigrate.migrate import *
6 from kallithea.lib.dbmigrate.migrate import *
11 from kallithea.lib.dbmigrate.migrate.changeset import *
7 from kallithea.lib.dbmigrate.migrate.changeset import *
12
8
13 from kallithea.model.meta import Base
14 from kallithea.model import meta
9 from kallithea.model import meta
15 from kallithea.lib.dbmigrate.versions import _reset_base
10 from kallithea.lib.dbmigrate.versions import _reset_base
16
11
@@ -1,16 +1,10 b''
1 import logging
1 import logging
2 import datetime
3
2
4 from sqlalchemy import *
3 from sqlalchemy import *
5 from sqlalchemy.exc import DatabaseError
6 from sqlalchemy.orm import relation, backref, class_mapper, joinedload
7 from sqlalchemy.orm.session import Session
8 from sqlalchemy.ext.declarative import declarative_base
9
4
10 from kallithea.lib.dbmigrate.migrate import *
5 from kallithea.lib.dbmigrate.migrate import *
11 from kallithea.lib.dbmigrate.migrate.changeset import *
6 from kallithea.lib.dbmigrate.migrate.changeset import *
12
7
13 from kallithea.model.meta import Base
14 from kallithea.model import meta
8 from kallithea.model import meta
15 from kallithea.lib.dbmigrate.versions import _reset_base, notify
9 from kallithea.lib.dbmigrate.versions import _reset_base, notify
16
10
@@ -2,16 +2,11 b' import logging'
2 import datetime
2 import datetime
3
3
4 from sqlalchemy import *
4 from sqlalchemy import *
5 from sqlalchemy.exc import DatabaseError
6 from sqlalchemy.orm import relation, backref, class_mapper, joinedload
7 from sqlalchemy.orm.session import Session
8 from sqlalchemy.ext.declarative import declarative_base
9
5
10 from kallithea import EXTERN_TYPE_INTERNAL
6 from kallithea import EXTERN_TYPE_INTERNAL
11 from kallithea.lib.dbmigrate.migrate import *
7 from kallithea.lib.dbmigrate.migrate import *
12 from kallithea.lib.dbmigrate.migrate.changeset import *
8 from kallithea.lib.dbmigrate.migrate.changeset import *
13
9
14 from kallithea.model.meta import Base
15 from kallithea.model import meta
10 from kallithea.model import meta
16 from kallithea.lib.dbmigrate.versions import _reset_base, notify
11 from kallithea.lib.dbmigrate.versions import _reset_base, notify
17
12
@@ -2,15 +2,10 b' import logging'
2 import datetime
2 import datetime
3
3
4 from sqlalchemy import *
4 from sqlalchemy import *
5 from sqlalchemy.exc import DatabaseError
6 from sqlalchemy.orm import relation, backref, class_mapper, joinedload
7 from sqlalchemy.orm.session import Session
8 from sqlalchemy.ext.declarative import declarative_base
9
5
10 from kallithea.lib.dbmigrate.migrate import *
6 from kallithea.lib.dbmigrate.migrate import *
11 from kallithea.lib.dbmigrate.migrate.changeset import *
7 from kallithea.lib.dbmigrate.migrate.changeset import *
12
8
13 from kallithea.model.meta import Base
14 from kallithea.model import meta
9 from kallithea.model import meta
15 from kallithea.lib.dbmigrate.versions import _reset_base, notify
10 from kallithea.lib.dbmigrate.versions import _reset_base, notify
16
11
@@ -1,17 +1,11 b''
1 import logging
1 import logging
2 import datetime
3
2
4 from sqlalchemy import *
3 from sqlalchemy import *
5 from sqlalchemy.exc import DatabaseError
6 from sqlalchemy.orm import relation, backref, class_mapper, joinedload
7 from sqlalchemy.orm.session import Session
8 from sqlalchemy.ext.declarative import declarative_base
9
4
10 from kallithea.lib.dbmigrate.migrate import *
5 from kallithea.lib.dbmigrate.migrate import *
11 from kallithea.lib.dbmigrate.migrate.changeset import *
6 from kallithea.lib.dbmigrate.migrate.changeset import *
12 from kallithea.lib.utils2 import str2bool
7 from kallithea.lib.utils2 import str2bool
13
8
14 from kallithea.model.meta import Base
15 from kallithea.model import meta
9 from kallithea.model import meta
16 from kallithea.lib.dbmigrate.versions import _reset_base, notify
10 from kallithea.lib.dbmigrate.versions import _reset_base, notify
17
11
@@ -1,19 +1,12 b''
1 import logging
1 import logging
2 import datetime
3
2
4 from sqlalchemy import *
3 from sqlalchemy import *
5 from sqlalchemy.exc import DatabaseError
6 from sqlalchemy.orm import relation, backref, class_mapper, joinedload
7 from sqlalchemy.orm.session import Session
8 from sqlalchemy.ext.declarative import declarative_base
9
4
10 from kallithea.lib.dbmigrate.migrate import *
5 from kallithea.lib.dbmigrate.migrate import *
11 from kallithea.lib.dbmigrate.migrate.changeset import *
6 from kallithea.lib.dbmigrate.migrate.changeset import *
12 from kallithea.lib.utils2 import str2bool
13
7
14 from kallithea.model.meta import Base
15 from kallithea.model import meta
8 from kallithea.model import meta
16 from kallithea.lib.dbmigrate.versions import _reset_base, notify
9 from kallithea.lib.dbmigrate.versions import _reset_base
17
10
18 log = logging.getLogger(__name__)
11 log = logging.getLogger(__name__)
19
12
@@ -1,20 +1,13 b''
1 import logging
1 import logging
2 import datetime
3
2
4 from sqlalchemy import *
3 from sqlalchemy import *
5 from sqlalchemy.exc import DatabaseError
6 from sqlalchemy.orm import relation, backref, class_mapper, joinedload
7 from sqlalchemy.orm.session import Session
8 from sqlalchemy.ext.declarative import declarative_base
9
4
10 from kallithea import EXTERN_TYPE_INTERNAL
5 from kallithea import EXTERN_TYPE_INTERNAL
11 from kallithea.lib.dbmigrate.migrate import *
6 from kallithea.lib.dbmigrate.migrate import *
12 from kallithea.lib.dbmigrate.migrate.changeset import *
7 from kallithea.lib.dbmigrate.migrate.changeset import *
13 from kallithea.lib.utils2 import str2bool
14
8
15 from kallithea.model.meta import Base
16 from kallithea.model import meta
9 from kallithea.model import meta
17 from kallithea.lib.dbmigrate.versions import _reset_base, notify
10 from kallithea.lib.dbmigrate.versions import _reset_base
18
11
19 log = logging.getLogger(__name__)
12 log = logging.getLogger(__name__)
20
13
@@ -3,16 +3,10 b' import logging'
3 import datetime
3 import datetime
4
4
5 from sqlalchemy import *
5 from sqlalchemy import *
6 from sqlalchemy.exc import DatabaseError
7 from sqlalchemy.orm import relation, backref, class_mapper, joinedload
8 from sqlalchemy.orm.session import Session
9 from sqlalchemy.ext.declarative import declarative_base
10
6
11 from kallithea.lib.dbmigrate.migrate import *
7 from kallithea.lib.dbmigrate.migrate import *
12 from kallithea.lib.dbmigrate.migrate.changeset import *
8 from kallithea.lib.dbmigrate.migrate.changeset import *
13 from kallithea.lib.utils2 import str2bool
14
9
15 from kallithea.model.meta import Base
16 from kallithea.model import meta
10 from kallithea.model import meta
17 from kallithea.lib.dbmigrate.versions import _reset_base, notify
11 from kallithea.lib.dbmigrate.versions import _reset_base, notify
18
12
@@ -1,17 +1,10 b''
1 import logging
1 import logging
2 import datetime
3
2
4 from sqlalchemy import *
3 from sqlalchemy import *
5 from sqlalchemy.exc import DatabaseError
6 from sqlalchemy.orm import relation, backref, class_mapper, joinedload
7 from sqlalchemy.orm.session import Session
8 from sqlalchemy.ext.declarative import declarative_base
9
4
10 from kallithea.lib.dbmigrate.migrate import *
5 from kallithea.lib.dbmigrate.migrate import *
11 from kallithea.lib.dbmigrate.migrate.changeset import *
6 from kallithea.lib.dbmigrate.migrate.changeset import *
12 from kallithea.lib.utils2 import str2bool
13
7
14 from kallithea.model.meta import Base
15 from kallithea.model import meta
8 from kallithea.model import meta
16 from kallithea.lib.dbmigrate.versions import _reset_base, notify
9 from kallithea.lib.dbmigrate.versions import _reset_base, notify
17
10
@@ -1,19 +1,12 b''
1 import logging
1 import logging
2 import datetime
3
2
4 from sqlalchemy import *
3 from sqlalchemy import *
5 from sqlalchemy.exc import DatabaseError
6 from sqlalchemy.orm import relation, backref, class_mapper, joinedload
7 from sqlalchemy.orm.session import Session
8 from sqlalchemy.ext.declarative import declarative_base
9
4
10 from kallithea.lib.dbmigrate.migrate import *
5 from kallithea.lib.dbmigrate.migrate import *
11 from kallithea.lib.dbmigrate.migrate.changeset import *
6 from kallithea.lib.dbmigrate.migrate.changeset import *
12 from kallithea.lib.utils2 import str2bool
13
7
14 from kallithea.model.meta import Base
15 from kallithea.model import meta
8 from kallithea.model import meta
16 from kallithea.lib.dbmigrate.versions import _reset_base, notify
9 from kallithea.lib.dbmigrate.versions import _reset_base
17
10
18 log = logging.getLogger(__name__)
11 log = logging.getLogger(__name__)
19
12
@@ -1,17 +1,10 b''
1 import logging
1 import logging
2 import datetime
3
2
4 from sqlalchemy import *
3 from sqlalchemy import *
5 from sqlalchemy.exc import DatabaseError
6 from sqlalchemy.orm import relation, backref, class_mapper, joinedload
7 from sqlalchemy.orm.session import Session
8 from sqlalchemy.ext.declarative import declarative_base
9
4
10 from kallithea.lib.dbmigrate.migrate import *
5 from kallithea.lib.dbmigrate.migrate import *
11 from kallithea.lib.dbmigrate.migrate.changeset import *
6 from kallithea.lib.dbmigrate.migrate.changeset import *
12 from kallithea.lib.utils2 import str2bool
13
7
14 from kallithea.model.meta import Base
15 from kallithea.model import meta
8 from kallithea.model import meta
16 from kallithea.lib.dbmigrate.versions import _reset_base, notify
9 from kallithea.lib.dbmigrate.versions import _reset_base, notify
17
10
@@ -37,7 +30,6 b' def downgrade(migrate_engine):'
37
30
38 def fixups(models, _SESSION):
31 def fixups(models, _SESSION):
39 from pylons import config
32 from pylons import config
40 from kallithea.lib.utils2 import str2bool
41
33
42 notify('migrating options from .ini file')
34 notify('migrating options from .ini file')
43 use_gravatar = str2bool(config.get('use_gravatar'))
35 use_gravatar = str2bool(config.get('use_gravatar'))
@@ -1,17 +1,10 b''
1 import logging
1 import logging
2 import datetime
3
2
4 from sqlalchemy import *
3 from sqlalchemy import *
5 from sqlalchemy.exc import DatabaseError
6 from sqlalchemy.orm import relation, backref, class_mapper, joinedload
7 from sqlalchemy.orm.session import Session
8 from sqlalchemy.ext.declarative import declarative_base
9
4
10 from kallithea.lib.dbmigrate.migrate import *
5 from kallithea.lib.dbmigrate.migrate import *
11 from kallithea.lib.dbmigrate.migrate.changeset import *
6 from kallithea.lib.dbmigrate.migrate.changeset import *
12 from kallithea.lib.utils2 import str2bool
13
7
14 from kallithea.model.meta import Base
15 from kallithea.model import meta
8 from kallithea.model import meta
16 from kallithea.lib.dbmigrate.versions import _reset_base, notify
9 from kallithea.lib.dbmigrate.versions import _reset_base, notify
17
10
@@ -1,19 +1,12 b''
1 import logging
1 import logging
2 import datetime
3
2
4 from sqlalchemy import *
3 from sqlalchemy import *
5 from sqlalchemy.exc import DatabaseError
6 from sqlalchemy.orm import relation, backref, class_mapper, joinedload
7 from sqlalchemy.orm.session import Session
8 from sqlalchemy.ext.declarative import declarative_base
9
4
10 from kallithea.lib.dbmigrate.migrate import *
5 from kallithea.lib.dbmigrate.migrate import *
11 from kallithea.lib.dbmigrate.migrate.changeset import *
6 from kallithea.lib.dbmigrate.migrate.changeset import *
12 from kallithea.lib.utils2 import str2bool
13
7
14 from kallithea.model.meta import Base
15 from kallithea.model import meta
8 from kallithea.model import meta
16 from kallithea.lib.dbmigrate.versions import _reset_base, notify
9 from kallithea.lib.dbmigrate.versions import _reset_base
17
10
18 log = logging.getLogger(__name__)
11 log = logging.getLogger(__name__)
19
12
@@ -1,19 +1,12 b''
1 import logging
1 import logging
2 import datetime
3
2
4 from sqlalchemy import *
3 from sqlalchemy import *
5 from sqlalchemy.exc import DatabaseError
6 from sqlalchemy.orm import relation, backref, class_mapper, joinedload
7 from sqlalchemy.orm.session import Session
8 from sqlalchemy.ext.declarative import declarative_base
9
4
10 from kallithea.lib.dbmigrate.migrate import *
5 from kallithea.lib.dbmigrate.migrate import *
11 from kallithea.lib.dbmigrate.migrate.changeset import *
6 from kallithea.lib.dbmigrate.migrate.changeset import *
12 from kallithea.lib.utils2 import str2bool
13
7
14 from kallithea.model.meta import Base
15 from kallithea.model import meta
8 from kallithea.model import meta
16 from kallithea.lib.dbmigrate.versions import _reset_base, notify
9 from kallithea.lib.dbmigrate.versions import _reset_base
17
10
18 log = logging.getLogger(__name__)
11 log = logging.getLogger(__name__)
19
12
@@ -1,19 +1,12 b''
1 import logging
1 import logging
2 import datetime
3
2
4 from sqlalchemy import *
3 from sqlalchemy import *
5 from sqlalchemy.exc import DatabaseError
6 from sqlalchemy.orm import relation, backref, class_mapper, joinedload
7 from sqlalchemy.orm.session import Session
8 from sqlalchemy.ext.declarative import declarative_base
9
4
10 from kallithea.lib.dbmigrate.migrate import *
5 from kallithea.lib.dbmigrate.migrate import *
11 from kallithea.lib.dbmigrate.migrate.changeset import *
6 from kallithea.lib.dbmigrate.migrate.changeset import *
12 from kallithea.lib.utils2 import str2bool
13
7
14 from kallithea.model.meta import Base
15 from kallithea.model import meta
8 from kallithea.model import meta
16 from kallithea.lib.dbmigrate.versions import _reset_base, notify
9 from kallithea.lib.dbmigrate.versions import _reset_base
17
10
18 log = logging.getLogger(__name__)
11 log = logging.getLogger(__name__)
19
12
@@ -1,17 +1,10 b''
1 import logging
1 import logging
2 import datetime
3
2
4 from sqlalchemy import *
3 from sqlalchemy import *
5 from sqlalchemy.exc import DatabaseError
6 from sqlalchemy.orm import relation, backref, class_mapper, joinedload
7 from sqlalchemy.orm.session import Session
8 from sqlalchemy.ext.declarative import declarative_base
9
4
10 from kallithea.lib.dbmigrate.migrate import *
5 from kallithea.lib.dbmigrate.migrate import *
11 from kallithea.lib.dbmigrate.migrate.changeset import *
6 from kallithea.lib.dbmigrate.migrate.changeset import *
12 from kallithea.lib.utils2 import str2bool
13
7
14 from kallithea.model.meta import Base
15 from kallithea.model import meta
8 from kallithea.model import meta
16 from kallithea.lib.dbmigrate.versions import _reset_base, notify
9 from kallithea.lib.dbmigrate.versions import _reset_base, notify
17
10
@@ -1,19 +1,12 b''
1 import logging
1 import logging
2 import datetime
3
2
4 from sqlalchemy import *
3 from sqlalchemy import *
5 from sqlalchemy.exc import DatabaseError
6 from sqlalchemy.orm import relation, backref, class_mapper, joinedload
7 from sqlalchemy.orm.session import Session
8 from sqlalchemy.ext.declarative import declarative_base
9
4
10 from kallithea.lib.dbmigrate.migrate import *
5 from kallithea.lib.dbmigrate.migrate import *
11 from kallithea.lib.dbmigrate.migrate.changeset import *
6 from kallithea.lib.dbmigrate.migrate.changeset import *
12 from kallithea.lib.utils2 import str2bool
13
7
14 from kallithea.model.meta import Base
15 from kallithea.model import meta
8 from kallithea.model import meta
16 from kallithea.lib.dbmigrate.versions import _reset_base, notify
9 from kallithea.lib.dbmigrate.versions import _reset_base
17
10
18 log = logging.getLogger(__name__)
11 log = logging.getLogger(__name__)
19
12
@@ -1,17 +1,10 b''
1 import logging
1 import logging
2 import datetime
3
2
4 from sqlalchemy import *
3 from sqlalchemy import *
5 from sqlalchemy.exc import DatabaseError
6 from sqlalchemy.orm import relation, backref, class_mapper, joinedload
7 from sqlalchemy.orm.session import Session
8 from sqlalchemy.ext.declarative import declarative_base
9
4
10 from kallithea.lib.dbmigrate.migrate import *
5 from kallithea.lib.dbmigrate.migrate import *
11 from kallithea.lib.dbmigrate.migrate.changeset import *
6 from kallithea.lib.dbmigrate.migrate.changeset import *
12 from kallithea.lib.utils2 import str2bool
13
7
14 from kallithea.model.meta import Base
15 from kallithea.model import meta
8 from kallithea.model import meta
16 from kallithea.lib.dbmigrate.versions import _reset_base, notify
9 from kallithea.lib.dbmigrate.versions import _reset_base, notify
17
10
@@ -26,10 +26,7 b' Original author and date, and relevant c'
26 """
26 """
27
27
28 from sqlalchemy import *
28 from sqlalchemy import *
29 from sqlalchemy.exc import DatabaseError
30 from sqlalchemy.orm import relation, backref, class_mapper, joinedload
31 from sqlalchemy.ext.declarative import declarative_base
29 from sqlalchemy.ext.declarative import declarative_base
32 from sqlalchemy.orm import scoped_session, sessionmaker
33 from kallithea.lib.dbmigrate.migrate import *
30 from kallithea.lib.dbmigrate.migrate import *
34 from kallithea.lib.dbmigrate.migrate.changeset import *
31 from kallithea.lib.dbmigrate.migrate.changeset import *
35
32
@@ -37,7 +37,7 b' from kallithea.lib.vcs.exceptions import'
37 from kallithea.lib.vcs.nodes import FileNode, SubModuleNode
37 from kallithea.lib.vcs.nodes import FileNode, SubModuleNode
38 from kallithea.lib.vcs.backends.base import EmptyChangeset
38 from kallithea.lib.vcs.backends.base import EmptyChangeset
39 from kallithea.lib.helpers import escape
39 from kallithea.lib.helpers import escape
40 from kallithea.lib.utils2 import safe_unicode, safe_str
40 from kallithea.lib.utils2 import safe_unicode
41
41
42 log = logging.getLogger(__name__)
42 log = logging.getLogger(__name__)
43
43
@@ -20,14 +20,12 b' available to Controllers. This module is'
20 import random
20 import random
21 import hashlib
21 import hashlib
22 import StringIO
22 import StringIO
23 import urllib
24 import math
23 import math
25 import logging
24 import logging
26 import re
25 import re
27 import urlparse
26 import urlparse
28 import textwrap
27 import textwrap
29
28
30 from datetime import datetime
31 from pygments.formatters.html import HtmlFormatter
29 from pygments.formatters.html import HtmlFormatter
32 from pygments import highlight as code_highlight
30 from pygments import highlight as code_highlight
33 from pylons import url
31 from pylons import url
@@ -33,7 +33,7 b' from os.path import dirname as dn, join '
33 # Add location of top level folder to sys.path
33 # Add location of top level folder to sys.path
34 sys.path.append(dn(dn(dn(os.path.realpath(__file__)))))
34 sys.path.append(dn(dn(dn(os.path.realpath(__file__)))))
35
35
36 from whoosh.analysis import RegexTokenizer, LowercaseFilter, StopFilter
36 from whoosh.analysis import RegexTokenizer, LowercaseFilter
37 from whoosh.fields import TEXT, ID, STORED, NUMERIC, BOOLEAN, Schema, FieldType, DATETIME
37 from whoosh.fields import TEXT, ID, STORED, NUMERIC, BOOLEAN, Schema, FieldType, DATETIME
38 from whoosh.formats import Characters
38 from whoosh.formats import Characters
39 from whoosh.highlight import highlight as whoosh_highlight, HtmlFormatter, ContextFragmenter
39 from whoosh.highlight import highlight as whoosh_highlight, HtmlFormatter, ContextFragmenter
@@ -34,7 +34,6 b' import logging'
34
34
35 from kallithea.lib.utils import BasePasterCommand
35 from kallithea.lib.utils import BasePasterCommand
36 from string import strip
36 from string import strip
37 from shutil import rmtree
38 from kallithea.model.repo import RepoModel
37 from kallithea.model.repo import RepoModel
39 from kallithea.lib.utils import BasePasterCommand, load_rcextensions
38 from kallithea.lib.utils import BasePasterCommand, load_rcextensions
40
39
@@ -1,6 +1,5 b''
1 from __future__ import with_statement
1 from __future__ import with_statement
2
2
3 import gc
4 import objgraph
3 import objgraph
5 import cProfile
4 import cProfile
6 import pstats
5 import pstats
@@ -46,9 +46,6 b' from beaker.cache import _cache_decorate'
46
46
47 from kallithea import BRAND
47 from kallithea import BRAND
48
48
49 from kallithea.lib.vcs import get_backend
50 from kallithea.lib.vcs.backends.base import BaseChangeset
51 from kallithea.lib.vcs.utils.lazy import LazyProperty
52 from kallithea.lib.vcs.utils.hgcompat import ui, config
49 from kallithea.lib.vcs.utils.hgcompat import ui, config
53 from kallithea.lib.vcs.utils.helpers import get_scm
50 from kallithea.lib.vcs.utils.helpers import get_scm
54 from kallithea.lib.vcs.exceptions import VCSError
51 from kallithea.lib.vcs.exceptions import VCSError
@@ -62,7 +59,6 b' from kallithea.model.meta import Session'
62 from kallithea.model.repo_group import RepoGroupModel
59 from kallithea.model.repo_group import RepoGroupModel
63 from kallithea.lib.utils2 import safe_str, safe_unicode, get_current_authuser
60 from kallithea.lib.utils2 import safe_str, safe_unicode, get_current_authuser
64 from kallithea.lib.vcs.utils.fakemod import create_module
61 from kallithea.lib.vcs.utils.fakemod import create_module
65 from kallithea.model.user_group import UserGroupModel
66
62
67 log = logging.getLogger(__name__)
63 log = logging.getLogger(__name__)
68
64
@@ -324,7 +324,6 b' def engine_from_config(configuration, pr'
324 else:
324 else:
325 import time
325 import time
326 from sqlalchemy import event
326 from sqlalchemy import event
327 from sqlalchemy.engine import Engine
328
327
329 log = logging.getLogger('sqlalchemy.engine')
328 log = logging.getLogger('sqlalchemy.engine')
330 BLACK, RED, GREEN, YELLOW, BLUE, MAGENTA, CYAN, WHITE = xrange(30, 38)
329 BLACK, RED, GREEN, YELLOW, BLUE, MAGENTA, CYAN, WHITE = xrange(30, 38)
@@ -3,7 +3,6 b' import datetime'
3 import posixpath
3 import posixpath
4 import stat
4 import stat
5 from dulwich import objects
5 from dulwich import objects
6 from dulwich.repo import Repo
7 from kallithea.lib.vcs.backends.base import BaseInMemoryChangeset
6 from kallithea.lib.vcs.backends.base import BaseInMemoryChangeset
8 from kallithea.lib.vcs.exceptions import RepositoryError
7 from kallithea.lib.vcs.exceptions import RepositoryError
9 from kallithea.lib.vcs.utils import safe_str
8 from kallithea.lib.vcs.utils import safe_str
@@ -16,9 +16,7 b' import urllib2'
16 import logging
16 import logging
17 import datetime
17 import datetime
18
18
19
20 from kallithea.lib.vcs.backends.base import BaseRepository, CollectionGenerator
19 from kallithea.lib.vcs.backends.base import BaseRepository, CollectionGenerator
21 from kallithea.lib.vcs.conf import settings
22
20
23 from kallithea.lib.vcs.exceptions import (
21 from kallithea.lib.vcs.exceptions import (
24 BranchDoesNotExistError, ChangesetDoesNotExistError, EmptyRepositoryError,
22 BranchDoesNotExistError, ChangesetDoesNotExistError, EmptyRepositoryError,
@@ -8,7 +8,7 b''
8 :created_on: Apr 8, 2010
8 :created_on: Apr 8, 2010
9 :copyright: (c) 2010-2011 by Marcin Kuzminski, Lukasz Balcerzak.
9 :copyright: (c) 2010-2011 by Marcin Kuzminski, Lukasz Balcerzak.
10 """
10 """
11 import os
11
12 import stat
12 import stat
13 import posixpath
13 import posixpath
14 import mimetypes
14 import mimetypes
@@ -2,7 +2,7 b''
2 This module provides some useful tools for ``vcs`` like annotate/diff html
2 This module provides some useful tools for ``vcs`` like annotate/diff html
3 output. It also includes some internal helpers.
3 output. It also includes some internal helpers.
4 """
4 """
5 import sys
5
6 import time
6 import time
7 import datetime
7 import datetime
8
8
@@ -3,7 +3,6 b''
3 discussion at PyCon 2009.
3 discussion at PyCon 2009.
4 """
4 """
5
5
6 import sys
7 import re
6 import re
8
7
9 class IrrationalVersionError(Exception):
8 class IrrationalVersionError(Exception):
@@ -26,7 +26,6 b' Original author and date, and relevant c'
26 """
26 """
27
27
28 import logging
28 import logging
29 import traceback
30
29
31 from pylons.i18n.translation import _
30 from pylons.i18n.translation import _
32 from sqlalchemy.util.compat import defaultdict
31 from sqlalchemy.util.compat import defaultdict
@@ -34,7 +33,7 b' from sqlalchemy.util.compat import defau'
34 from kallithea.lib.utils2 import extract_mentioned_users, safe_unicode
33 from kallithea.lib.utils2 import extract_mentioned_users, safe_unicode
35 from kallithea.lib import helpers as h
34 from kallithea.lib import helpers as h
36 from kallithea.model import BaseModel
35 from kallithea.model import BaseModel
37 from kallithea.model.db import ChangesetComment, User, Repository, \
36 from kallithea.model.db import ChangesetComment, User, \
38 Notification, PullRequest
37 Notification, PullRequest
39 from kallithea.model.notification import NotificationModel
38 from kallithea.model.notification import NotificationModel
40 from kallithea.model.meta import Session
39 from kallithea.model.meta import Session
@@ -37,7 +37,6 b' import functools'
37 from sqlalchemy import *
37 from sqlalchemy import *
38 from sqlalchemy.ext.hybrid import hybrid_property
38 from sqlalchemy.ext.hybrid import hybrid_property
39 from sqlalchemy.orm import relationship, joinedload, class_mapper, validates
39 from sqlalchemy.orm import relationship, joinedload, class_mapper, validates
40 from sqlalchemy.exc import DatabaseError
41 from beaker.cache import cache_region, region_invalidate
40 from beaker.cache import cache_region, region_invalidate
42 from webob.exc import HTTPNotFound
41 from webob.exc import HTTPNotFound
43
42
@@ -32,11 +32,9 b' import logging'
32 import traceback
32 import traceback
33 import shutil
33 import shutil
34
34
35 from pylons.i18n.translation import _
36 from kallithea.lib.utils2 import safe_unicode, unique_id, safe_int, \
35 from kallithea.lib.utils2 import safe_unicode, unique_id, safe_int, \
37 time_to_datetime, safe_str, AttributeDict
36 time_to_datetime, safe_str, AttributeDict
38 from kallithea.lib.compat import json
37 from kallithea.lib.compat import json
39 from kallithea.lib import helpers as h
40 from kallithea.model import BaseModel
38 from kallithea.model import BaseModel
41 from kallithea.model.db import Gist
39 from kallithea.model.db import Gist
42 from kallithea.model.repo import RepoModel
40 from kallithea.model.repo import RepoModel
@@ -26,8 +26,6 b' Original author and date, and relevant c'
26 :license: GPLv3, see LICENSE.md for more details.
26 :license: GPLv3, see LICENSE.md for more details.
27 """
27 """
28
28
29
30 import os
31 import logging
29 import logging
32 import traceback
30 import traceback
33
31
@@ -39,7 +39,7 b' from kallithea.lib.compat import json'
39 from kallithea.lib.utils2 import LazyProperty, safe_str, safe_unicode, \
39 from kallithea.lib.utils2 import LazyProperty, safe_str, safe_unicode, \
40 remove_prefix, obfuscate_url_pw, get_current_authuser
40 remove_prefix, obfuscate_url_pw, get_current_authuser
41 from kallithea.lib.caching_query import FromCache
41 from kallithea.lib.caching_query import FromCache
42 from kallithea.lib.hooks import log_create_repository, log_delete_repository
42 from kallithea.lib.hooks import log_delete_repository
43
43
44 from kallithea.model import BaseModel
44 from kallithea.model import BaseModel
45 from kallithea.model.db import Repository, UserRepoToPerm, UserGroupRepoToPerm, \
45 from kallithea.model.db import Repository, UserRepoToPerm, UserGroupRepoToPerm, \
@@ -42,9 +42,6 b' from os.path import join as jn'
42
42
43 from tempfile import _RandomNameSequence
43 from tempfile import _RandomNameSequence
44
44
45 from paste.deploy import loadapp
46 from paste.script.appinstall import SetupCommand
47
48 import pylons
45 import pylons
49 import pylons.test
46 import pylons.test
50 from pylons import config, url
47 from pylons import config, url
@@ -57,10 +54,9 b' from nose.plugins.skip import SkipTest'
57
54
58 from kallithea.lib.compat import unittest
55 from kallithea.lib.compat import unittest
59 from kallithea import is_windows
56 from kallithea import is_windows
60 from kallithea.model.meta import Session
61 from kallithea.model.db import User
57 from kallithea.model.db import User
62 from kallithea.tests.nose_parametrized import parameterized
58 from kallithea.tests.nose_parametrized import parameterized
63 from kallithea.lib.utils2 import safe_unicode, safe_str
59 from kallithea.lib.utils2 import safe_str
64
60
65
61
66 os.environ['TZ'] = 'UTC'
62 os.environ['TZ'] = 'UTC'
@@ -140,6 +136,7 b' HG_REMOTE_REPO = jn(TESTS_TMP_PATH, HG_R'
140 ldap_lib_installed = False
136 ldap_lib_installed = False
141 try:
137 try:
142 import ldap
138 import ldap
139 ldap.API_VERSION
143 ldap_lib_installed = True
140 ldap_lib_installed = True
144 except ImportError:
141 except ImportError:
145 # means that python-ldap is not installed
142 # means that python-ldap is not installed
@@ -1,5 +1,3 b''
1 import datetime
2
3 from kallithea.tests import *
1 from kallithea.tests import *
4 from kallithea.model.gist import GistModel
2 from kallithea.model.gist import GistModel
5 from kallithea.model.meta import Session
3 from kallithea.model.meta import Session
@@ -11,7 +11,6 b' from kallithea.model.user import UserMod'
11 from kallithea.tests import *
11 from kallithea.tests import *
12 from kallithea.model.repo_group import RepoGroupModel
12 from kallithea.model.repo_group import RepoGroupModel
13 from kallithea.model.repo import RepoModel
13 from kallithea.model.repo import RepoModel
14 from kallithea.model.scm import ScmModel
15 from kallithea.model.meta import Session
14 from kallithea.model.meta import Session
16 from kallithea.tests.fixture import Fixture, error_function
15 from kallithea.tests.fixture import Fixture, error_function
17
16
@@ -1,13 +1,8 b''
1 # -*- coding: utf-8 -*-
1 # -*- coding: utf-8 -*-
2
2
3 from kallithea.lib.auth import get_crypt_password, check_password
3 from kallithea.model.db import Setting, Ui
4 from kallithea.model.db import User, Setting, Repository, Ui
5 from kallithea.tests import *
4 from kallithea.tests import *
6 from kallithea.tests.fixture import Fixture
5 from kallithea.tests.fixture import Fixture
7 from kallithea.lib import helpers as h
8 from kallithea.model.user import UserModel
9 from kallithea.model.scm import ScmModel
10 from kallithea.model.meta import Session
11
6
12 fixture = Fixture()
7 fixture = Fixture()
13
8
@@ -1,5 +1,5 b''
1 from kallithea.tests import *
1 from kallithea.tests import *
2 from kallithea.model.db import ChangesetComment, Notification, User, \
2 from kallithea.model.db import ChangesetComment, Notification, \
3 UserNotification
3 UserNotification
4 from kallithea.model.meta import Session
4 from kallithea.model.meta import Session
5
5
@@ -1,8 +1,7 b''
1 import time
2 from kallithea.tests import *
1 from kallithea.tests import *
3 from kallithea.tests.fixture import Fixture
2 from kallithea.tests.fixture import Fixture
4 from kallithea.model.meta import Session
3 from kallithea.model.meta import Session
5 from kallithea.model.db import User, Repository
4 from kallithea.model.db import Repository
6 from kallithea.model.repo import RepoModel
5 from kallithea.model.repo import RepoModel
7 from kallithea.model.repo_group import RepoGroupModel
6 from kallithea.model.repo_group import RepoGroupModel
8
7
@@ -1,6 +1,4 b''
1 from kallithea.tests import *
1 from kallithea.tests import *
2 from kallithea.model.db import UserFollowing, User, Repository
3 from kallithea.lib.helpers import get_token
4 import datetime
2 import datetime
5
3
6
4
@@ -1,5 +1,3 b''
1 import os
2 from sqlalchemy.exc import IntegrityError
3 from kallithea.model.db import User
1 from kallithea.model.db import User
4
2
5 from kallithea.tests import *
3 from kallithea.tests import *
@@ -2,7 +2,7 b' import functools'
2 from kallithea.tests import *
2 from kallithea.tests import *
3
3
4 from kallithea.model.repo_group import RepoGroupModel
4 from kallithea.model.repo_group import RepoGroupModel
5 from kallithea.model.db import RepoGroup, Repository, User
5 from kallithea.model.db import RepoGroup, User
6
6
7 from kallithea.model.meta import Session
7 from kallithea.model.meta import Session
8 from nose.tools import with_setup
8 from nose.tools import with_setup
@@ -37,7 +37,6 b' from tempfile import _RandomNameSequence'
37 from subprocess import Popen, PIPE
37 from subprocess import Popen, PIPE
38
38
39 from paste.deploy import appconfig
39 from paste.deploy import appconfig
40 from pylons import config
41 from sqlalchemy import engine_from_config
40 from sqlalchemy import engine_from_config
42
41
43 from kallithea.lib.utils import add_cache
42 from kallithea.lib.utils import add_cache
@@ -46,7 +45,7 b' from kallithea.model import meta'
46 from kallithea.model.db import User, Repository
45 from kallithea.model.db import User, Repository
47 from kallithea.lib.auth import get_crypt_password
46 from kallithea.lib.auth import get_crypt_password
48
47
49 from kallithea.tests import TESTS_TMP_PATH, NEW_HG_REPO, HG_REPO
48 from kallithea.tests import TESTS_TMP_PATH, HG_REPO
50 from kallithea.config.environment import load_environment
49 from kallithea.config.environment import load_environment
51
50
52 rel_path = dn(dn(dn(dn(os.path.abspath(__file__)))))
51 rel_path = dn(dn(dn(dn(os.path.abspath(__file__)))))
@@ -4,7 +4,7 b' import os'
4 from kallithea.lib.vcs.backends.hg import MercurialRepository, MercurialChangeset
4 from kallithea.lib.vcs.backends.hg import MercurialRepository, MercurialChangeset
5 from kallithea.lib.vcs.exceptions import RepositoryError, VCSError, NodeDoesNotExistError
5 from kallithea.lib.vcs.exceptions import RepositoryError, VCSError, NodeDoesNotExistError
6 from kallithea.lib.vcs.nodes import NodeKind, NodeState
6 from kallithea.lib.vcs.nodes import NodeKind, NodeState
7 from kallithea.tests.vcs.conf import PACKAGE_DIR, TEST_HG_REPO, TEST_HG_REPO_CLONE, \
7 from kallithea.tests.vcs.conf import TEST_HG_REPO, TEST_HG_REPO_CLONE, \
8 TEST_HG_REPO_PULL
8 TEST_HG_REPO_PULL
9 from kallithea.lib.vcs.utils.compat import unittest
9 from kallithea.lib.vcs.utils.compat import unittest
10
10
General Comments 0
You need to be logged in to leave comments. Login now