Skip to content

Commit

Permalink
Rename utils module to helpers
Browse files Browse the repository at this point in the history
  • Loading branch information
pylover committed Jul 21, 2019
1 parent d5cc3ec commit ca5223a
Show file tree
Hide file tree
Showing 8 changed files with 7 additions and 11 deletions.
1 change: 0 additions & 1 deletion restfulpy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,5 @@

warnings.filterwarnings('ignore', message='Unknown REQUEST_METHOD')

# TODO: unused imports
__version__ = '3.3.1a5'

2 changes: 1 addition & 1 deletion restfulpy/controllers.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from nanohttp import Controller, context, json, RestController, action

from restfulpy.orm import DBSession
from restfulpy.utils import split_url
from restfulpy.helpers import split_url


class RootController(Controller):
Expand Down
3 changes: 0 additions & 3 deletions restfulpy/utils.py → restfulpy/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@
from urllib.parse import parse_qs


# TODO: Rename this module to helpers


def import_python_module_by_filename(name, module_filename):
"""
Import's a file as a python module, with specified name.
Expand Down
2 changes: 1 addition & 1 deletion restfulpy/messaging/providers.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from mako.lookup import TemplateLookup
from nanohttp import settings, LazyAttribute

from restfulpy.utils import construct_class_by_name
from restfulpy.helpers import construct_class_by_name


class Messenger(object):
Expand Down
2 changes: 1 addition & 1 deletion restfulpy/mockup.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

from . import datetimehelpers
from .messaging import Messenger
from .utils import copy_stream
from .helpers import copy_stream
from .application import Application


Expand Down
2 changes: 1 addition & 1 deletion restfulpy/orm/metadata.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from ..utils import to_camel_case
from ..helpers import to_camel_case


class FieldInfo:
Expand Down
2 changes: 1 addition & 1 deletion restfulpy/orm/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

from ..datetimehelpers import parse_datetime, parse_date, parse_time, \
format_date, format_time, format_datetime
from ..utils import to_camel_case
from ..helpers import to_camel_case
from .field import Field
from .metadata import MetadataField
from .mixins import PaginationMixin, FilteringMixin, OrderingMixin
Expand Down
4 changes: 2 additions & 2 deletions tests/test_utils.py → tests/test_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from os import mkdir
from os.path import dirname, abspath, join, exists

from restfulpy.utils import import_python_module_by_filename, \
from restfulpy.helpers import import_python_module_by_filename, \
construct_class_by_name, copy_stream, md5sum, to_camel_case, \
encode_multipart_data, split_url

Expand Down Expand Up @@ -32,7 +32,7 @@ def test_import_python_module_by_filename():

def test_construct_class_by_name():
obj = construct_class_by_name(
'tests.test_utils.MyClassToConstructByName',
'tests.test_helpers.MyClassToConstructByName',
1
)
assert obj.a == 1
Expand Down

0 comments on commit ca5223a

Please sign in to comment.