From f80e6a0764aa8821690cf1a716f2d757831006f3 Mon Sep 17 00:00:00 2001 From: Xavier Bustamante Talavera Date: Sat, 29 Sep 2018 15:55:29 +0200 Subject: [PATCH] Use __name__ instead of __package__ as recommended by flask --- ereuse_devicehub/devicehub.py | 2 +- ereuse_devicehub/resources/agent/__init__.py | 2 +- ereuse_devicehub/resources/event/__init__.py | 2 +- ereuse_devicehub/resources/lot/__init__.py | 2 +- ereuse_devicehub/resources/tag/__init__.py | 2 +- ereuse_devicehub/resources/user/__init__.py | 2 +- setup.py | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/ereuse_devicehub/devicehub.py b/ereuse_devicehub/devicehub.py index ccc80960..10205103 100644 --- a/ereuse_devicehub/devicehub.py +++ b/ereuse_devicehub/devicehub.py @@ -19,7 +19,7 @@ class Devicehub(Teal): def __init__(self, config: ConfigClass, db: SQLAlchemy = db, - import_name=__package__, + import_name=__name__.split('.')[0], static_url_path=None, static_folder='static', static_host=None, diff --git a/ereuse_devicehub/resources/agent/__init__.py b/ereuse_devicehub/resources/agent/__init__.py index 460f49bd..89f275b8 100644 --- a/ereuse_devicehub/resources/agent/__init__.py +++ b/ereuse_devicehub/resources/agent/__init__.py @@ -20,7 +20,7 @@ class OrganizationDef(AgentDef): SCHEMA = schemas.Organization VIEW = None - def __init__(self, app, import_name=__package__, static_folder=None, static_url_path=None, + def __init__(self, app, import_name=__name__.split('.')[0], static_folder=None, static_url_path=None, template_folder=None, url_prefix=None, subdomain=None, url_defaults=None, root_path=None): cli_commands = ((self.create_org, 'create-org'),) diff --git a/ereuse_devicehub/resources/event/__init__.py b/ereuse_devicehub/resources/event/__init__.py index 75ffe1ef..561bf961 100644 --- a/ereuse_devicehub/resources/event/__init__.py +++ b/ereuse_devicehub/resources/event/__init__.py @@ -98,7 +98,7 @@ class SnapshotDef(EventDef): VIEW = SnapshotView SCHEMA = schemas.Snapshot - def __init__(self, app, import_name=__package__, static_folder=None, static_url_path=None, + def __init__(self, app, import_name=__name__.split('.')[0], static_folder=None, static_url_path=None, template_folder=None, url_prefix=None, subdomain=None, url_defaults=None, root_path=None, cli_commands: Iterable[Tuple[Callable, str or None]] = tuple()): super().__init__(app, import_name, static_folder, static_url_path, template_folder, diff --git a/ereuse_devicehub/resources/lot/__init__.py b/ereuse_devicehub/resources/lot/__init__.py index fe68df71..bf70f0e1 100644 --- a/ereuse_devicehub/resources/lot/__init__.py +++ b/ereuse_devicehub/resources/lot/__init__.py @@ -15,7 +15,7 @@ class LotDef(Resource): AUTH = True ID_CONVERTER = Converters.uuid - def __init__(self, app, import_name=__package__, static_folder=None, static_url_path=None, + def __init__(self, app, import_name=__name__.split('.')[0], static_folder=None, static_url_path=None, template_folder=None, url_prefix=None, subdomain=None, url_defaults=None, root_path=None, cli_commands: Iterable[Tuple[Callable, str or None]] = tuple()): super().__init__(app, import_name, static_folder, static_url_path, template_folder, diff --git a/ereuse_devicehub/resources/tag/__init__.py b/ereuse_devicehub/resources/tag/__init__.py index e15a0f04..0483a3f3 100644 --- a/ereuse_devicehub/resources/tag/__init__.py +++ b/ereuse_devicehub/resources/tag/__init__.py @@ -23,7 +23,7 @@ class TagDef(Resource): 'By default set to the actual Devicehub.' CLI_SCHEMA = schema.Tag(only=('id', 'provider', 'org', 'secondary')) - def __init__(self, app: Teal, import_name=__package__, static_folder=None, + def __init__(self, app: Teal, import_name=__name__.split('.')[0], static_folder=None, static_url_path=None, template_folder=None, url_prefix=None, subdomain=None, url_defaults=None, root_path=None): diff --git a/ereuse_devicehub/resources/user/__init__.py b/ereuse_devicehub/resources/user/__init__.py index 9c194b44..77ad9677 100644 --- a/ereuse_devicehub/resources/user/__init__.py +++ b/ereuse_devicehub/resources/user/__init__.py @@ -14,7 +14,7 @@ class UserDef(Resource): ID_CONVERTER = Converters.uuid AUTH = True - def __init__(self, app, import_name=__package__, static_folder=None, + def __init__(self, app, import_name=__name__.split('.')[0], static_folder=None, static_url_path=None, template_folder=None, url_prefix=None, subdomain=None, url_defaults=None, root_path=None): cli_commands = ((self.create_user, 'create-user'),) diff --git a/setup.py b/setup.py index 4edb67a6..f36e0bce 100644 --- a/setup.py +++ b/setup.py @@ -34,7 +34,7 @@ setup( long_description=long_description, long_description_content_type='text/markdown', install_requires=[ - 'teal>=0.2.0a17', # teal always first + 'teal>=0.2.0a18', # teal always first 'click', 'click-spinner', 'ereuse-rate==0.0.2',