Use __name__ instead of __package__ as recommended by flask
This commit is contained in:
parent
83ade6de8f
commit
f80e6a0764
|
@ -19,7 +19,7 @@ class Devicehub(Teal):
|
||||||
def __init__(self,
|
def __init__(self,
|
||||||
config: ConfigClass,
|
config: ConfigClass,
|
||||||
db: SQLAlchemy = db,
|
db: SQLAlchemy = db,
|
||||||
import_name=__package__,
|
import_name=__name__.split('.')[0],
|
||||||
static_url_path=None,
|
static_url_path=None,
|
||||||
static_folder='static',
|
static_folder='static',
|
||||||
static_host=None,
|
static_host=None,
|
||||||
|
|
|
@ -20,7 +20,7 @@ class OrganizationDef(AgentDef):
|
||||||
SCHEMA = schemas.Organization
|
SCHEMA = schemas.Organization
|
||||||
VIEW = None
|
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,
|
template_folder=None, url_prefix=None, subdomain=None, url_defaults=None,
|
||||||
root_path=None):
|
root_path=None):
|
||||||
cli_commands = ((self.create_org, 'create-org'),)
|
cli_commands = ((self.create_org, 'create-org'),)
|
||||||
|
|
|
@ -98,7 +98,7 @@ class SnapshotDef(EventDef):
|
||||||
VIEW = SnapshotView
|
VIEW = SnapshotView
|
||||||
SCHEMA = schemas.Snapshot
|
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,
|
template_folder=None, url_prefix=None, subdomain=None, url_defaults=None,
|
||||||
root_path=None, cli_commands: Iterable[Tuple[Callable, str or None]] = tuple()):
|
root_path=None, cli_commands: Iterable[Tuple[Callable, str or None]] = tuple()):
|
||||||
super().__init__(app, import_name, static_folder, static_url_path, template_folder,
|
super().__init__(app, import_name, static_folder, static_url_path, template_folder,
|
||||||
|
|
|
@ -15,7 +15,7 @@ class LotDef(Resource):
|
||||||
AUTH = True
|
AUTH = True
|
||||||
ID_CONVERTER = Converters.uuid
|
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,
|
template_folder=None, url_prefix=None, subdomain=None, url_defaults=None,
|
||||||
root_path=None, cli_commands: Iterable[Tuple[Callable, str or None]] = tuple()):
|
root_path=None, cli_commands: Iterable[Tuple[Callable, str or None]] = tuple()):
|
||||||
super().__init__(app, import_name, static_folder, static_url_path, template_folder,
|
super().__init__(app, import_name, static_folder, static_url_path, template_folder,
|
||||||
|
|
|
@ -23,7 +23,7 @@ class TagDef(Resource):
|
||||||
'By default set to the actual Devicehub.'
|
'By default set to the actual Devicehub.'
|
||||||
CLI_SCHEMA = schema.Tag(only=('id', 'provider', 'org', 'secondary'))
|
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,
|
static_url_path=None,
|
||||||
template_folder=None, url_prefix=None, subdomain=None, url_defaults=None,
|
template_folder=None, url_prefix=None, subdomain=None, url_defaults=None,
|
||||||
root_path=None):
|
root_path=None):
|
||||||
|
|
|
@ -14,7 +14,7 @@ class UserDef(Resource):
|
||||||
ID_CONVERTER = Converters.uuid
|
ID_CONVERTER = Converters.uuid
|
||||||
AUTH = True
|
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,
|
static_url_path=None, template_folder=None, url_prefix=None, subdomain=None,
|
||||||
url_defaults=None, root_path=None):
|
url_defaults=None, root_path=None):
|
||||||
cli_commands = ((self.create_user, 'create-user'),)
|
cli_commands = ((self.create_user, 'create-user'),)
|
||||||
|
|
2
setup.py
2
setup.py
|
@ -34,7 +34,7 @@ setup(
|
||||||
long_description=long_description,
|
long_description=long_description,
|
||||||
long_description_content_type='text/markdown',
|
long_description_content_type='text/markdown',
|
||||||
install_requires=[
|
install_requires=[
|
||||||
'teal>=0.2.0a17', # teal always first
|
'teal>=0.2.0a18', # teal always first
|
||||||
'click',
|
'click',
|
||||||
'click-spinner',
|
'click-spinner',
|
||||||
'ereuse-rate==0.0.2',
|
'ereuse-rate==0.0.2',
|
||||||
|
|
Reference in New Issue