diff --git a/server/szurubooru/api/password_reset_api.py b/server/szurubooru/api/password_reset_api.py index 7f8b4ea2..93466705 100644 --- a/server/szurubooru/api/password_reset_api.py +++ b/server/szurubooru/api/password_reset_api.py @@ -1,6 +1,6 @@ from szurubooru import config, errors -from szurubooru.util import auth, mailer, users from szurubooru.api.base_api import BaseApi +from szurubooru.func import auth, mailer, users MAIL_SUBJECT = 'Password reset for {name}' MAIL_BODY = \ diff --git a/server/szurubooru/api/tag_api.py b/server/szurubooru/api/tag_api.py index 6e6dc9de..6f91c966 100644 --- a/server/szurubooru/api/tag_api.py +++ b/server/szurubooru/api/tag_api.py @@ -1,7 +1,7 @@ import datetime from szurubooru import search -from szurubooru.util import auth, tags, snapshots from szurubooru.api.base_api import BaseApi +from szurubooru.func import auth, tags, snapshots def _serialize_tag(tag): return { diff --git a/server/szurubooru/api/tag_category_api.py b/server/szurubooru/api/tag_category_api.py index b60f5545..627ee536 100644 --- a/server/szurubooru/api/tag_category_api.py +++ b/server/szurubooru/api/tag_category_api.py @@ -1,5 +1,5 @@ -from szurubooru.util import auth, tags, tag_categories, snapshots from szurubooru.api.base_api import BaseApi +from szurubooru.func import auth, tags, tag_categories, snapshots def _serialize_category(category): return { diff --git a/server/szurubooru/api/user_api.py b/server/szurubooru/api/user_api.py index cbe5c45f..f035ad12 100644 --- a/server/szurubooru/api/user_api.py +++ b/server/szurubooru/api/user_api.py @@ -1,7 +1,7 @@ import hashlib from szurubooru import config, search -from szurubooru.util import auth, users from szurubooru.api.base_api import BaseApi +from szurubooru.func import auth, users def _serialize_user(authenticated_user, user): ret = { diff --git a/server/szurubooru/util/__init__.py b/server/szurubooru/func/__init__.py similarity index 100% rename from server/szurubooru/util/__init__.py rename to server/szurubooru/func/__init__.py diff --git a/server/szurubooru/util/auth.py b/server/szurubooru/func/auth.py similarity index 100% rename from server/szurubooru/util/auth.py rename to server/szurubooru/func/auth.py diff --git a/server/szurubooru/util/files.py b/server/szurubooru/func/files.py similarity index 100% rename from server/szurubooru/util/files.py rename to server/szurubooru/func/files.py diff --git a/server/szurubooru/util/images.py b/server/szurubooru/func/images.py similarity index 100% rename from server/szurubooru/util/images.py rename to server/szurubooru/func/images.py diff --git a/server/szurubooru/util/mailer.py b/server/szurubooru/func/mailer.py similarity index 100% rename from server/szurubooru/util/mailer.py rename to server/szurubooru/func/mailer.py diff --git a/server/szurubooru/util/misc.py b/server/szurubooru/func/misc.py similarity index 100% rename from server/szurubooru/util/misc.py rename to server/szurubooru/func/misc.py diff --git a/server/szurubooru/util/snapshots.py b/server/szurubooru/func/snapshots.py similarity index 100% rename from server/szurubooru/util/snapshots.py rename to server/szurubooru/func/snapshots.py diff --git a/server/szurubooru/util/tag_categories.py b/server/szurubooru/func/tag_categories.py similarity index 98% rename from server/szurubooru/util/tag_categories.py rename to server/szurubooru/func/tag_categories.py index 15e86894..40ef4e01 100644 --- a/server/szurubooru/util/tag_categories.py +++ b/server/szurubooru/func/tag_categories.py @@ -1,6 +1,6 @@ import re from szurubooru import config, db, errors -from szurubooru.util import misc +from szurubooru.func import misc class TagCategoryNotFoundError(errors.NotFoundError): pass class TagCategoryAlreadyExistsError(errors.ValidationError): pass diff --git a/server/szurubooru/util/tags.py b/server/szurubooru/func/tags.py similarity index 99% rename from server/szurubooru/util/tags.py rename to server/szurubooru/func/tags.py index ff3c6ec9..0c96203f 100644 --- a/server/szurubooru/util/tags.py +++ b/server/szurubooru/func/tags.py @@ -4,7 +4,7 @@ import os import re import sqlalchemy from szurubooru import config, db, errors -from szurubooru.util import misc, tag_categories +from szurubooru.func import misc, tag_categories class TagNotFoundError(errors.NotFoundError): pass class TagAlreadyExistsError(errors.ValidationError): pass diff --git a/server/szurubooru/util/users.py b/server/szurubooru/func/users.py similarity index 98% rename from server/szurubooru/util/users.py rename to server/szurubooru/func/users.py index 07700c4a..528bac70 100644 --- a/server/szurubooru/util/users.py +++ b/server/szurubooru/func/users.py @@ -2,7 +2,7 @@ import datetime import re from sqlalchemy import func from szurubooru import config, db, errors -from szurubooru.util import auth, misc, files, images +from szurubooru.func import auth, misc, files, images class UserNotFoundError(errors.NotFoundError): pass class UserAlreadyExistsError(errors.ValidationError): pass diff --git a/server/szurubooru/middleware/authenticator.py b/server/szurubooru/middleware/authenticator.py index 7497e1e8..1aa8d191 100644 --- a/server/szurubooru/middleware/authenticator.py +++ b/server/szurubooru/middleware/authenticator.py @@ -1,7 +1,7 @@ import base64 import falcon from szurubooru import db, errors -from szurubooru.util import auth, users +from szurubooru.func import auth, users class Authenticator(object): ''' diff --git a/server/szurubooru/search/base_search_config.py b/server/szurubooru/search/base_search_config.py index 5ed3ea5f..e5583761 100644 --- a/server/szurubooru/search/base_search_config.py +++ b/server/szurubooru/search/base_search_config.py @@ -1,6 +1,6 @@ import sqlalchemy import szurubooru.errors -from szurubooru.util import misc +from szurubooru.func import misc from szurubooru.search import criteria class BaseSearchConfig(object): diff --git a/server/szurubooru/tests/api/test_password_reset.py b/server/szurubooru/tests/api/test_password_reset.py index 34f6f023..f5227414 100644 --- a/server/szurubooru/tests/api/test_password_reset.py +++ b/server/szurubooru/tests/api/test_password_reset.py @@ -2,7 +2,7 @@ from datetime import datetime from unittest import mock import pytest from szurubooru import api, db, errors -from szurubooru.util import auth, mailer +from szurubooru.func import auth, mailer @pytest.fixture def password_reset_api(config_injector): diff --git a/server/szurubooru/tests/api/test_tag_category_creating.py b/server/szurubooru/tests/api/test_tag_category_creating.py index 065e00d9..7eac22b6 100644 --- a/server/szurubooru/tests/api/test_tag_category_creating.py +++ b/server/szurubooru/tests/api/test_tag_category_creating.py @@ -1,7 +1,7 @@ import os import pytest from szurubooru import api, config, db, errors -from szurubooru.util import misc, tag_categories +from szurubooru.func import misc, tag_categories @pytest.fixture def test_ctx(tmpdir, config_injector, context_factory, user_factory): diff --git a/server/szurubooru/tests/api/test_tag_category_deleting.py b/server/szurubooru/tests/api/test_tag_category_deleting.py index 115c9060..a1b93af0 100644 --- a/server/szurubooru/tests/api/test_tag_category_deleting.py +++ b/server/szurubooru/tests/api/test_tag_category_deleting.py @@ -2,7 +2,7 @@ import pytest import os from datetime import datetime from szurubooru import api, config, db, errors -from szurubooru.util import misc, tags, tag_categories +from szurubooru.func import misc, tags, tag_categories @pytest.fixture def test_ctx( diff --git a/server/szurubooru/tests/api/test_tag_category_retrieving.py b/server/szurubooru/tests/api/test_tag_category_retrieving.py index c9a7ac7c..748ad4cf 100644 --- a/server/szurubooru/tests/api/test_tag_category_retrieving.py +++ b/server/szurubooru/tests/api/test_tag_category_retrieving.py @@ -1,7 +1,7 @@ import datetime import pytest from szurubooru import api, db, errors -from szurubooru.util import misc, tag_categories +from szurubooru.func import misc, tag_categories @pytest.fixture def test_ctx( diff --git a/server/szurubooru/tests/api/test_tag_category_updating.py b/server/szurubooru/tests/api/test_tag_category_updating.py index 104659cb..1e75bf4f 100644 --- a/server/szurubooru/tests/api/test_tag_category_updating.py +++ b/server/szurubooru/tests/api/test_tag_category_updating.py @@ -1,7 +1,7 @@ import os import pytest from szurubooru import api, config, db, errors -from szurubooru.util import misc, tag_categories +from szurubooru.func import misc, tag_categories @pytest.fixture def test_ctx( diff --git a/server/szurubooru/tests/api/test_tag_creating.py b/server/szurubooru/tests/api/test_tag_creating.py index e765cc11..0b01ab2d 100644 --- a/server/szurubooru/tests/api/test_tag_creating.py +++ b/server/szurubooru/tests/api/test_tag_creating.py @@ -2,7 +2,7 @@ import datetime import os import pytest from szurubooru import api, config, db, errors -from szurubooru.util import misc, tags +from szurubooru.func import misc, tags def get_tag(name): return db.session \ diff --git a/server/szurubooru/tests/api/test_tag_deleting.py b/server/szurubooru/tests/api/test_tag_deleting.py index 67fa1113..edcccfbc 100644 --- a/server/szurubooru/tests/api/test_tag_deleting.py +++ b/server/szurubooru/tests/api/test_tag_deleting.py @@ -2,7 +2,7 @@ import pytest import os from datetime import datetime from szurubooru import api, config, db, errors -from szurubooru.util import misc, tags +from szurubooru.func import misc, tags @pytest.fixture def test_ctx( diff --git a/server/szurubooru/tests/api/test_tag_export.py b/server/szurubooru/tests/api/test_tag_export.py index 34592dc0..7ea84fb6 100644 --- a/server/szurubooru/tests/api/test_tag_export.py +++ b/server/szurubooru/tests/api/test_tag_export.py @@ -2,7 +2,7 @@ import datetime import os import json from szurubooru import config, db -from szurubooru.util import tags +from szurubooru.func import tags def test_export( tmpdir, diff --git a/server/szurubooru/tests/api/test_tag_retrieving.py b/server/szurubooru/tests/api/test_tag_retrieving.py index c794e6fd..db7bb154 100644 --- a/server/szurubooru/tests/api/test_tag_retrieving.py +++ b/server/szurubooru/tests/api/test_tag_retrieving.py @@ -1,7 +1,7 @@ import datetime import pytest from szurubooru import api, db, errors -from szurubooru.util import misc, tags +from szurubooru.func import misc, tags @pytest.fixture def test_ctx(context_factory, config_injector, user_factory, tag_factory): diff --git a/server/szurubooru/tests/api/test_tag_updating.py b/server/szurubooru/tests/api/test_tag_updating.py index 9ffe21a2..b1c8febc 100644 --- a/server/szurubooru/tests/api/test_tag_updating.py +++ b/server/szurubooru/tests/api/test_tag_updating.py @@ -2,7 +2,7 @@ import datetime import os import pytest from szurubooru import api, config, db, errors -from szurubooru.util import misc, tags +from szurubooru.func import misc, tags def get_tag(name): return db.session \ diff --git a/server/szurubooru/tests/api/test_user_creating.py b/server/szurubooru/tests/api/test_user_creating.py index 8da53b49..56f35cf4 100644 --- a/server/szurubooru/tests/api/test_user_creating.py +++ b/server/szurubooru/tests/api/test_user_creating.py @@ -1,7 +1,7 @@ import datetime import pytest from szurubooru import api, config, db, errors -from szurubooru.util import auth, misc, users +from szurubooru.func import auth, misc, users EMPTY_PIXEL = \ b'\x47\x49\x46\x38\x39\x61\x01\x00\x01\x00\x80\x01\x00\x00\x00\x00' \ diff --git a/server/szurubooru/tests/api/test_user_deleting.py b/server/szurubooru/tests/api/test_user_deleting.py index dcbcde53..95d2c44f 100644 --- a/server/szurubooru/tests/api/test_user_deleting.py +++ b/server/szurubooru/tests/api/test_user_deleting.py @@ -1,7 +1,7 @@ import pytest from datetime import datetime from szurubooru import api, db, errors -from szurubooru.util import misc, users +from szurubooru.func import misc, users @pytest.fixture def test_ctx(config_injector, context_factory, user_factory): diff --git a/server/szurubooru/tests/api/test_user_retrieving.py b/server/szurubooru/tests/api/test_user_retrieving.py index 68910572..af4c59bc 100644 --- a/server/szurubooru/tests/api/test_user_retrieving.py +++ b/server/szurubooru/tests/api/test_user_retrieving.py @@ -1,7 +1,7 @@ import datetime import pytest from szurubooru import api, db, errors -from szurubooru.util import misc, users +from szurubooru.func import misc, users @pytest.fixture def test_ctx(context_factory, config_injector, user_factory): diff --git a/server/szurubooru/tests/api/test_user_updating.py b/server/szurubooru/tests/api/test_user_updating.py index 58c7e1c8..47d54e88 100644 --- a/server/szurubooru/tests/api/test_user_updating.py +++ b/server/szurubooru/tests/api/test_user_updating.py @@ -1,7 +1,7 @@ import datetime import pytest from szurubooru import api, config, db, errors -from szurubooru.util import auth, misc, users +from szurubooru.func import auth, misc, users EMPTY_PIXEL = \ b'\x47\x49\x46\x38\x39\x61\x01\x00\x01\x00\x80\x01\x00\x00\x00\x00' \ diff --git a/server/szurubooru/tests/conftest.py b/server/szurubooru/tests/conftest.py index 1ab70997..e6c0d43d 100644 --- a/server/szurubooru/tests/conftest.py +++ b/server/szurubooru/tests/conftest.py @@ -5,7 +5,7 @@ import pytest import freezegun import sqlalchemy from szurubooru import api, config, db -from szurubooru.util import misc +from szurubooru.func import misc class QueryCounter(object): def __init__(self): diff --git a/server/szurubooru/tests/util/test_misc.py b/server/szurubooru/tests/func/test_misc.py similarity index 97% rename from server/szurubooru/tests/util/test_misc.py rename to server/szurubooru/tests/func/test_misc.py index dbea305f..fc04bdb8 100644 --- a/server/szurubooru/tests/util/test_misc.py +++ b/server/szurubooru/tests/func/test_misc.py @@ -1,6 +1,6 @@ import pytest from szurubooru import errors -from szurubooru.util import misc +from szurubooru.func import misc from datetime import datetime dt = datetime diff --git a/server/szurubooru/tests/util/test_snapshots.py b/server/szurubooru/tests/func/test_snapshots.py similarity index 99% rename from server/szurubooru/tests/util/test_snapshots.py rename to server/szurubooru/tests/func/test_snapshots.py index 80577686..3bd44af6 100644 --- a/server/szurubooru/tests/util/test_snapshots.py +++ b/server/szurubooru/tests/func/test_snapshots.py @@ -1,7 +1,7 @@ import datetime import pytest from szurubooru import db -from szurubooru.util import snapshots +from szurubooru.func import snapshots def test_serializing_tag(tag_factory): tag = tag_factory(names=['main_name', 'alias'], category_name='dummy')