diff --git a/vcsserver/base.py b/vcsserver/base.py --- a/vcsserver/base.py +++ b/vcsserver/base.py @@ -25,7 +25,7 @@ from vcsserver.lib.rc_cache.archive_cach from vcsserver import exceptions from vcsserver.exceptions import NoContentException from vcsserver.hgcompat import archival -from vcsserver.str_utils import safe_bytes +from vcsserver.lib.str_utils import safe_bytes from vcsserver.lib.exc_tracking import format_exc log = logging.getLogger(__name__) diff --git a/vcsserver/config/settings_maker.py b/vcsserver/config/settings_maker.py --- a/vcsserver/config/settings_maker.py +++ b/vcsserver/config/settings_maker.py @@ -24,7 +24,7 @@ import logging import tempfile import logging.config -from vcsserver.type_utils import str2bool, aslist +from vcsserver.lib.type_utils import str2bool, aslist log = logging.getLogger(__name__) diff --git a/vcsserver/git_lfs/app.py b/vcsserver/git_lfs/app.py --- a/vcsserver/git_lfs/app.py +++ b/vcsserver/git_lfs/app.py @@ -27,7 +27,7 @@ from pyramid.httpexceptions import ( from vcsserver.lib.ext_json import json from vcsserver.git_lfs.lib import OidHandler, LFSOidStore from vcsserver.git_lfs.utils import safe_result, get_cython_compat_decorator -from vcsserver.str_utils import safe_int +from vcsserver.lib.str_utils import safe_int log = logging.getLogger(__name__) diff --git a/vcsserver/git_lfs/tests/test_lfs_app.py b/vcsserver/git_lfs/tests/test_lfs_app.py --- a/vcsserver/git_lfs/tests/test_lfs_app.py +++ b/vcsserver/git_lfs/tests/test_lfs_app.py @@ -20,7 +20,7 @@ import pytest from webtest.app import TestApp as WebObTestApp from vcsserver.lib.ext_json import json -from vcsserver.str_utils import safe_bytes +from vcsserver.lib.str_utils import safe_bytes from vcsserver.git_lfs.app import create_app from vcsserver.git_lfs.lib import LFSOidStore diff --git a/vcsserver/git_lfs/tests/test_lib.py b/vcsserver/git_lfs/tests/test_lib.py --- a/vcsserver/git_lfs/tests/test_lib.py +++ b/vcsserver/git_lfs/tests/test_lib.py @@ -17,7 +17,7 @@ import os import pytest -from vcsserver.str_utils import safe_bytes +from vcsserver.lib.str_utils import safe_bytes from vcsserver.git_lfs.lib import OidHandler, LFSOidStore diff --git a/vcsserver/hgcompat.py b/vcsserver/hgcompat.py --- a/vcsserver/hgcompat.py +++ b/vcsserver/hgcompat.py @@ -24,7 +24,7 @@ from mercurial import demandimport # patch demandimport, due to bug in mercurial when it always triggers # demandimport.enable() -from vcsserver.str_utils import safe_bytes +from vcsserver.lib.str_utils import safe_bytes demandimport.enable = lambda *args, **kwargs: 1 diff --git a/vcsserver/hook_utils/__init__.py b/vcsserver/hook_utils/__init__.py --- a/vcsserver/hook_utils/__init__.py +++ b/vcsserver/hook_utils/__init__.py @@ -25,7 +25,7 @@ import pkg_resources import vcsserver import vcsserver.settings -from vcsserver.str_utils import safe_bytes +from vcsserver.lib.str_utils import safe_bytes log = logging.getLogger(__name__) diff --git a/vcsserver/hooks.py b/vcsserver/hooks.py --- a/vcsserver/hooks.py +++ b/vcsserver/hooks.py @@ -33,7 +33,7 @@ import mercurial.node from vcsserver.lib.ext_json import json from vcsserver import exceptions, subprocessio, settings -from vcsserver.str_utils import ascii_str, safe_str +from vcsserver.lib.str_utils import ascii_str, safe_str from vcsserver.remote.git_remote import Repository celery_app = Celery('__vcsserver__') diff --git a/vcsserver/http_main.py b/vcsserver/http_main.py --- a/vcsserver/http_main.py +++ b/vcsserver/http_main.py @@ -39,7 +39,7 @@ from pyramid.response import Response from vcsserver.base import BytesEnvelope, BinaryEnvelope from vcsserver.lib.ext_json import json from vcsserver.config.settings_maker import SettingsMaker -from vcsserver.str_utils import safe_int +from vcsserver.lib.str_utils import safe_int from vcsserver.lib.statsd_client import StatsdClient from vcsserver.tweens.request_wrapper import get_headers_call_context diff --git a/vcsserver/lib/memory_lru_dict.py b/vcsserver/lib/memory_lru_dict.py --- a/vcsserver/lib/memory_lru_dict.py +++ b/vcsserver/lib/memory_lru_dict.py @@ -20,7 +20,7 @@ import logging from repoze.lru import LRUCache -from vcsserver.str_utils import safe_str +from vcsserver.lib.str_utils import safe_str log = logging.getLogger(__name__) diff --git a/vcsserver/lib/rc_cache/backends.py b/vcsserver/lib/rc_cache/backends.py --- a/vcsserver/lib/rc_cache/backends.py +++ b/vcsserver/lib/rc_cache/backends.py @@ -38,8 +38,8 @@ from dogpile.cache.backends.file import from dogpile.cache.util import memoized_property from vcsserver.lib.memory_lru_dict import LRUDict, LRUDictDebug -from vcsserver.str_utils import safe_bytes, safe_str -from vcsserver.type_utils import str2bool +from vcsserver.lib.str_utils import safe_bytes, safe_str +from vcsserver.lib.type_utils import str2bool _default_max_size = 1024 diff --git a/vcsserver/lib/rc_cache/utils.py b/vcsserver/lib/rc_cache/utils.py --- a/vcsserver/lib/rc_cache/utils.py +++ b/vcsserver/lib/rc_cache/utils.py @@ -26,8 +26,8 @@ from dogpile.cache import CacheRegion from vcsserver.utils import sha1 -from vcsserver.str_utils import safe_bytes -from vcsserver.type_utils import str2bool # noqa :required by imports from .utils +from vcsserver.lib.str_utils import safe_bytes +from vcsserver.lib.type_utils import str2bool # noqa :required by imports from .utils from . import region_meta diff --git a/vcsserver/str_utils.py b/vcsserver/lib/str_utils.py rename from vcsserver/str_utils.py rename to vcsserver/lib/str_utils.py diff --git a/vcsserver/lib/svnremoterepo.py b/vcsserver/lib/svnremoterepo.py --- a/vcsserver/lib/svnremoterepo.py +++ b/vcsserver/lib/svnremoterepo.py @@ -24,7 +24,7 @@ from svn import ra from mercurial import error -from vcsserver.str_utils import safe_bytes +from vcsserver.lib.str_utils import safe_bytes core.svn_config_ensure(None) svn_config = core.svn_config_get_config(None) diff --git a/vcsserver/type_utils.py b/vcsserver/lib/type_utils.py rename from vcsserver/type_utils.py rename to vcsserver/lib/type_utils.py diff --git a/vcsserver/pygrack.py b/vcsserver/pygrack.py --- a/vcsserver/pygrack.py +++ b/vcsserver/pygrack.py @@ -27,7 +27,7 @@ from webob import Request, Response, exc from vcsserver.lib.ext_json import json from vcsserver import hooks, subprocessio -from vcsserver.str_utils import ascii_bytes +from vcsserver.lib.str_utils import ascii_bytes log = logging.getLogger(__name__) diff --git a/vcsserver/remote/git_remote.py b/vcsserver/remote/git_remote.py --- a/vcsserver/remote/git_remote.py +++ b/vcsserver/remote/git_remote.py @@ -40,7 +40,7 @@ from dulwich.repo import Repo as Dulwich import rhodecode from vcsserver import exceptions, settings, subprocessio -from vcsserver.str_utils import safe_str, safe_int, safe_bytes, ascii_bytes, convert_to_str, splitnewlines +from vcsserver.lib.str_utils import safe_str, safe_int, safe_bytes, ascii_bytes, convert_to_str, splitnewlines from vcsserver.base import RepoFactory, obfuscate_qs, ArchiveNode, store_archive_in_cache, BytesEnvelope, BinaryEnvelope from vcsserver.hgcompat import ( hg_url as url_parser, httpbasicauthhandler, httpdigestauthhandler) diff --git a/vcsserver/remote/hg_remote.py b/vcsserver/remote/hg_remote.py --- a/vcsserver/remote/hg_remote.py +++ b/vcsserver/remote/hg_remote.py @@ -78,7 +78,7 @@ from vcsserver.hgcompat import ( patternmatcher, hgext_strip, ) -from vcsserver.str_utils import ascii_bytes, ascii_str, safe_str, safe_bytes, convert_to_str +from vcsserver.lib.str_utils import ascii_bytes, ascii_str, safe_str, safe_bytes, convert_to_str from vcsserver.vcs_base import RemoteBase from vcsserver.config import hooks as hooks_config from vcsserver.lib.exc_tracking import format_exc diff --git a/vcsserver/remote/svn_remote.py b/vcsserver/remote/svn_remote.py --- a/vcsserver/remote/svn_remote.py +++ b/vcsserver/remote/svn_remote.py @@ -47,8 +47,8 @@ from vcsserver.base import ( BinaryEnvelope, ) from vcsserver.exceptions import NoContentException -from vcsserver.str_utils import safe_str, safe_bytes -from vcsserver.type_utils import assert_bytes +from vcsserver.lib.str_utils import safe_str, safe_bytes +from vcsserver.lib.type_utils import assert_bytes from vcsserver.vcs_base import RemoteBase from vcsserver.lib.svnremoterepo import svnremoterepo diff --git a/vcsserver/scm_app.py b/vcsserver/scm_app.py --- a/vcsserver/scm_app.py +++ b/vcsserver/scm_app.py @@ -27,7 +27,7 @@ import mercurial.hgweb.hgweb_mod import webob.exc from vcsserver import pygrack, exceptions, settings, git_lfs -from vcsserver.str_utils import ascii_bytes, safe_bytes +from vcsserver.lib.str_utils import ascii_bytes, safe_bytes log = logging.getLogger(__name__) diff --git a/vcsserver/subprocessio.py b/vcsserver/subprocessio.py --- a/vcsserver/subprocessio.py +++ b/vcsserver/subprocessio.py @@ -28,7 +28,7 @@ import logging import subprocess import threading -from vcsserver.str_utils import safe_str +from vcsserver.lib.str_utils import safe_str log = logging.getLogger(__name__) diff --git a/vcsserver/tests/test_install_hooks.py b/vcsserver/tests/test_install_hooks.py --- a/vcsserver/tests/test_install_hooks.py +++ b/vcsserver/tests/test_install_hooks.py @@ -24,7 +24,7 @@ import tempfile from vcsserver import hook_utils from vcsserver.hook_utils import set_permissions_if_needed, HOOKS_DIR_MODE, HOOKS_FILE_MODE from vcsserver.tests.fixture import no_newline_id_generator -from vcsserver.str_utils import safe_bytes +from vcsserver.lib.str_utils import safe_bytes from vcsserver.utils import AttributeDict diff --git a/vcsserver/tests/test_pygrack.py b/vcsserver/tests/test_pygrack.py --- a/vcsserver/tests/test_pygrack.py +++ b/vcsserver/tests/test_pygrack.py @@ -26,7 +26,7 @@ import webtest from vcsserver import hooks, pygrack -from vcsserver.str_utils import ascii_bytes +from vcsserver.lib.str_utils import ascii_bytes @pytest.fixture() diff --git a/vcsserver/tests/test_scm_app.py b/vcsserver/tests/test_scm_app.py --- a/vcsserver/tests/test_scm_app.py +++ b/vcsserver/tests/test_scm_app.py @@ -25,7 +25,7 @@ import pytest import webtest from vcsserver import scm_app -from vcsserver.str_utils import ascii_bytes +from vcsserver.lib.str_utils import ascii_bytes def test_hg_does_not_accept_invalid_cmd(tmpdir): diff --git a/vcsserver/tests/test_subprocessio.py b/vcsserver/tests/test_subprocessio.py --- a/vcsserver/tests/test_subprocessio.py +++ b/vcsserver/tests/test_subprocessio.py @@ -22,7 +22,7 @@ import sys import pytest from vcsserver import subprocessio -from vcsserver.str_utils import ascii_bytes +from vcsserver.lib.str_utils import ascii_bytes class FileLikeObj: # pragma: no cover diff --git a/vcsserver/tests/test_svn.py b/vcsserver/tests/test_svn.py --- a/vcsserver/tests/test_svn.py +++ b/vcsserver/tests/test_svn.py @@ -20,7 +20,7 @@ import mock import pytest import sys -from vcsserver.str_utils import ascii_bytes +from vcsserver.lib.str_utils import ascii_bytes class MockPopen: diff --git a/vcsserver/tests/test_utils.py b/vcsserver/tests/test_utils.py --- a/vcsserver/tests/test_utils.py +++ b/vcsserver/tests/test_utils.py @@ -16,7 +16,7 @@ # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA import pytest -from vcsserver.str_utils import ascii_bytes, ascii_str, convert_to_str +from vcsserver.lib.str_utils import ascii_bytes, ascii_str, convert_to_str @pytest.mark.parametrize('given, expected', [ diff --git a/vcsserver/tests/test_wsgi_app_caller.py b/vcsserver/tests/test_wsgi_app_caller.py --- a/vcsserver/tests/test_wsgi_app_caller.py +++ b/vcsserver/tests/test_wsgi_app_caller.py @@ -19,7 +19,7 @@ import wsgiref.simple_server import wsgiref.validate from vcsserver import wsgi_app_caller -from vcsserver.str_utils import ascii_bytes, safe_str +from vcsserver.lib.str_utils import ascii_bytes, safe_str @wsgiref.validate.validator diff --git a/vcsserver/tweens/request_wrapper.py b/vcsserver/tweens/request_wrapper.py --- a/vcsserver/tweens/request_wrapper.py +++ b/vcsserver/tweens/request_wrapper.py @@ -21,7 +21,7 @@ import time import msgpack import vcsserver -from vcsserver.str_utils import safe_str +from vcsserver.lib.str_utils import safe_str log = logging.getLogger(__name__) diff --git a/vcsserver/wsgi_app_caller.py b/vcsserver/wsgi_app_caller.py --- a/vcsserver/wsgi_app_caller.py +++ b/vcsserver/wsgi_app_caller.py @@ -23,7 +23,7 @@ import io import logging import os -from vcsserver.str_utils import ascii_bytes +from vcsserver.lib.str_utils import ascii_bytes log = logging.getLogger(__name__)