server/general: rename 'util' to 'func'
This commit is contained in:
parent
d3f2ef296b
commit
57b18c6461
|
@ -1,6 +1,6 @@
|
||||||
from szurubooru import config, errors
|
from szurubooru import config, errors
|
||||||
from szurubooru.util import auth, mailer, users
|
|
||||||
from szurubooru.api.base_api import BaseApi
|
from szurubooru.api.base_api import BaseApi
|
||||||
|
from szurubooru.func import auth, mailer, users
|
||||||
|
|
||||||
MAIL_SUBJECT = 'Password reset for {name}'
|
MAIL_SUBJECT = 'Password reset for {name}'
|
||||||
MAIL_BODY = \
|
MAIL_BODY = \
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import datetime
|
import datetime
|
||||||
from szurubooru import search
|
from szurubooru import search
|
||||||
from szurubooru.util import auth, tags, snapshots
|
|
||||||
from szurubooru.api.base_api import BaseApi
|
from szurubooru.api.base_api import BaseApi
|
||||||
|
from szurubooru.func import auth, tags, snapshots
|
||||||
|
|
||||||
def _serialize_tag(tag):
|
def _serialize_tag(tag):
|
||||||
return {
|
return {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
from szurubooru.util import auth, tags, tag_categories, snapshots
|
|
||||||
from szurubooru.api.base_api import BaseApi
|
from szurubooru.api.base_api import BaseApi
|
||||||
|
from szurubooru.func import auth, tags, tag_categories, snapshots
|
||||||
|
|
||||||
def _serialize_category(category):
|
def _serialize_category(category):
|
||||||
return {
|
return {
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import hashlib
|
import hashlib
|
||||||
from szurubooru import config, search
|
from szurubooru import config, search
|
||||||
from szurubooru.util import auth, users
|
|
||||||
from szurubooru.api.base_api import BaseApi
|
from szurubooru.api.base_api import BaseApi
|
||||||
|
from szurubooru.func import auth, users
|
||||||
|
|
||||||
def _serialize_user(authenticated_user, user):
|
def _serialize_user(authenticated_user, user):
|
||||||
ret = {
|
ret = {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import re
|
import re
|
||||||
from szurubooru import config, db, errors
|
from szurubooru import config, db, errors
|
||||||
from szurubooru.util import misc
|
from szurubooru.func import misc
|
||||||
|
|
||||||
class TagCategoryNotFoundError(errors.NotFoundError): pass
|
class TagCategoryNotFoundError(errors.NotFoundError): pass
|
||||||
class TagCategoryAlreadyExistsError(errors.ValidationError): pass
|
class TagCategoryAlreadyExistsError(errors.ValidationError): pass
|
|
@ -4,7 +4,7 @@ import os
|
||||||
import re
|
import re
|
||||||
import sqlalchemy
|
import sqlalchemy
|
||||||
from szurubooru import config, db, errors
|
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 TagNotFoundError(errors.NotFoundError): pass
|
||||||
class TagAlreadyExistsError(errors.ValidationError): pass
|
class TagAlreadyExistsError(errors.ValidationError): pass
|
|
@ -2,7 +2,7 @@ import datetime
|
||||||
import re
|
import re
|
||||||
from sqlalchemy import func
|
from sqlalchemy import func
|
||||||
from szurubooru import config, db, errors
|
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 UserNotFoundError(errors.NotFoundError): pass
|
||||||
class UserAlreadyExistsError(errors.ValidationError): pass
|
class UserAlreadyExistsError(errors.ValidationError): pass
|
|
@ -1,7 +1,7 @@
|
||||||
import base64
|
import base64
|
||||||
import falcon
|
import falcon
|
||||||
from szurubooru import db, errors
|
from szurubooru import db, errors
|
||||||
from szurubooru.util import auth, users
|
from szurubooru.func import auth, users
|
||||||
|
|
||||||
class Authenticator(object):
|
class Authenticator(object):
|
||||||
'''
|
'''
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import sqlalchemy
|
import sqlalchemy
|
||||||
import szurubooru.errors
|
import szurubooru.errors
|
||||||
from szurubooru.util import misc
|
from szurubooru.func import misc
|
||||||
from szurubooru.search import criteria
|
from szurubooru.search import criteria
|
||||||
|
|
||||||
class BaseSearchConfig(object):
|
class BaseSearchConfig(object):
|
||||||
|
|
|
@ -2,7 +2,7 @@ from datetime import datetime
|
||||||
from unittest import mock
|
from unittest import mock
|
||||||
import pytest
|
import pytest
|
||||||
from szurubooru import api, db, errors
|
from szurubooru import api, db, errors
|
||||||
from szurubooru.util import auth, mailer
|
from szurubooru.func import auth, mailer
|
||||||
|
|
||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
def password_reset_api(config_injector):
|
def password_reset_api(config_injector):
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import os
|
import os
|
||||||
import pytest
|
import pytest
|
||||||
from szurubooru import api, config, db, errors
|
from szurubooru import api, config, db, errors
|
||||||
from szurubooru.util import misc, tag_categories
|
from szurubooru.func import misc, tag_categories
|
||||||
|
|
||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
def test_ctx(tmpdir, config_injector, context_factory, user_factory):
|
def test_ctx(tmpdir, config_injector, context_factory, user_factory):
|
||||||
|
|
|
@ -2,7 +2,7 @@ import pytest
|
||||||
import os
|
import os
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
from szurubooru import api, config, db, errors
|
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
|
@pytest.fixture
|
||||||
def test_ctx(
|
def test_ctx(
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import datetime
|
import datetime
|
||||||
import pytest
|
import pytest
|
||||||
from szurubooru import api, db, errors
|
from szurubooru import api, db, errors
|
||||||
from szurubooru.util import misc, tag_categories
|
from szurubooru.func import misc, tag_categories
|
||||||
|
|
||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
def test_ctx(
|
def test_ctx(
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import os
|
import os
|
||||||
import pytest
|
import pytest
|
||||||
from szurubooru import api, config, db, errors
|
from szurubooru import api, config, db, errors
|
||||||
from szurubooru.util import misc, tag_categories
|
from szurubooru.func import misc, tag_categories
|
||||||
|
|
||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
def test_ctx(
|
def test_ctx(
|
||||||
|
|
|
@ -2,7 +2,7 @@ import datetime
|
||||||
import os
|
import os
|
||||||
import pytest
|
import pytest
|
||||||
from szurubooru import api, config, db, errors
|
from szurubooru import api, config, db, errors
|
||||||
from szurubooru.util import misc, tags
|
from szurubooru.func import misc, tags
|
||||||
|
|
||||||
def get_tag(name):
|
def get_tag(name):
|
||||||
return db.session \
|
return db.session \
|
||||||
|
|
|
@ -2,7 +2,7 @@ import pytest
|
||||||
import os
|
import os
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
from szurubooru import api, config, db, errors
|
from szurubooru import api, config, db, errors
|
||||||
from szurubooru.util import misc, tags
|
from szurubooru.func import misc, tags
|
||||||
|
|
||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
def test_ctx(
|
def test_ctx(
|
||||||
|
|
|
@ -2,7 +2,7 @@ import datetime
|
||||||
import os
|
import os
|
||||||
import json
|
import json
|
||||||
from szurubooru import config, db
|
from szurubooru import config, db
|
||||||
from szurubooru.util import tags
|
from szurubooru.func import tags
|
||||||
|
|
||||||
def test_export(
|
def test_export(
|
||||||
tmpdir,
|
tmpdir,
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import datetime
|
import datetime
|
||||||
import pytest
|
import pytest
|
||||||
from szurubooru import api, db, errors
|
from szurubooru import api, db, errors
|
||||||
from szurubooru.util import misc, tags
|
from szurubooru.func import misc, tags
|
||||||
|
|
||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
def test_ctx(context_factory, config_injector, user_factory, tag_factory):
|
def test_ctx(context_factory, config_injector, user_factory, tag_factory):
|
||||||
|
|
|
@ -2,7 +2,7 @@ import datetime
|
||||||
import os
|
import os
|
||||||
import pytest
|
import pytest
|
||||||
from szurubooru import api, config, db, errors
|
from szurubooru import api, config, db, errors
|
||||||
from szurubooru.util import misc, tags
|
from szurubooru.func import misc, tags
|
||||||
|
|
||||||
def get_tag(name):
|
def get_tag(name):
|
||||||
return db.session \
|
return db.session \
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import datetime
|
import datetime
|
||||||
import pytest
|
import pytest
|
||||||
from szurubooru import api, config, db, errors
|
from szurubooru import api, config, db, errors
|
||||||
from szurubooru.util import auth, misc, users
|
from szurubooru.func import auth, misc, users
|
||||||
|
|
||||||
EMPTY_PIXEL = \
|
EMPTY_PIXEL = \
|
||||||
b'\x47\x49\x46\x38\x39\x61\x01\x00\x01\x00\x80\x01\x00\x00\x00\x00' \
|
b'\x47\x49\x46\x38\x39\x61\x01\x00\x01\x00\x80\x01\x00\x00\x00\x00' \
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import pytest
|
import pytest
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
from szurubooru import api, db, errors
|
from szurubooru import api, db, errors
|
||||||
from szurubooru.util import misc, users
|
from szurubooru.func import misc, users
|
||||||
|
|
||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
def test_ctx(config_injector, context_factory, user_factory):
|
def test_ctx(config_injector, context_factory, user_factory):
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import datetime
|
import datetime
|
||||||
import pytest
|
import pytest
|
||||||
from szurubooru import api, db, errors
|
from szurubooru import api, db, errors
|
||||||
from szurubooru.util import misc, users
|
from szurubooru.func import misc, users
|
||||||
|
|
||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
def test_ctx(context_factory, config_injector, user_factory):
|
def test_ctx(context_factory, config_injector, user_factory):
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import datetime
|
import datetime
|
||||||
import pytest
|
import pytest
|
||||||
from szurubooru import api, config, db, errors
|
from szurubooru import api, config, db, errors
|
||||||
from szurubooru.util import auth, misc, users
|
from szurubooru.func import auth, misc, users
|
||||||
|
|
||||||
EMPTY_PIXEL = \
|
EMPTY_PIXEL = \
|
||||||
b'\x47\x49\x46\x38\x39\x61\x01\x00\x01\x00\x80\x01\x00\x00\x00\x00' \
|
b'\x47\x49\x46\x38\x39\x61\x01\x00\x01\x00\x80\x01\x00\x00\x00\x00' \
|
||||||
|
|
|
@ -5,7 +5,7 @@ import pytest
|
||||||
import freezegun
|
import freezegun
|
||||||
import sqlalchemy
|
import sqlalchemy
|
||||||
from szurubooru import api, config, db
|
from szurubooru import api, config, db
|
||||||
from szurubooru.util import misc
|
from szurubooru.func import misc
|
||||||
|
|
||||||
class QueryCounter(object):
|
class QueryCounter(object):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import pytest
|
import pytest
|
||||||
from szurubooru import errors
|
from szurubooru import errors
|
||||||
from szurubooru.util import misc
|
from szurubooru.func import misc
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
|
|
||||||
dt = datetime
|
dt = datetime
|
|
@ -1,7 +1,7 @@
|
||||||
import datetime
|
import datetime
|
||||||
import pytest
|
import pytest
|
||||||
from szurubooru import db
|
from szurubooru import db
|
||||||
from szurubooru.util import snapshots
|
from szurubooru.func import snapshots
|
||||||
|
|
||||||
def test_serializing_tag(tag_factory):
|
def test_serializing_tag(tag_factory):
|
||||||
tag = tag_factory(names=['main_name', 'alias'], category_name='dummy')
|
tag = tag_factory(names=['main_name', 'alias'], category_name='dummy')
|
Loading…
Reference in New Issue