server/general: rename 'util' to 'func'

This commit is contained in:
rr- 2016-04-20 11:58:17 +02:00
parent d3f2ef296b
commit 57b18c6461
33 changed files with 26 additions and 26 deletions

View file

@ -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 = \

View file

@ -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 {

View file

@ -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 {

View file

@ -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 = {

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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):
'''

View file

@ -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):

View file

@ -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):

View file

@ -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):

View file

@ -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(

View file

@ -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(

View file

@ -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(

View file

@ -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 \

View file

@ -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(

View file

@ -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,

View file

@ -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):

View file

@ -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 \

View file

@ -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' \

View file

@ -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):

View file

@ -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):

View file

@ -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' \

View file

@ -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):

View file

@ -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

View file

@ -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')