Use __name__ instead of __package__ as recommended by flask

This commit is contained in:
Xavier Bustamante Talavera 2018-09-29 15:55:29 +02:00
parent 83ade6de8f
commit f80e6a0764
7 changed files with 7 additions and 7 deletions

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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