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,
|
||||
config: ConfigClass,
|
||||
db: SQLAlchemy = db,
|
||||
import_name=__package__,
|
||||
import_name=__name__.split('.')[0],
|
||||
static_url_path=None,
|
||||
static_folder='static',
|
||||
static_host=None,
|
||||
|
|
|
@ -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'),)
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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):
|
||||
|
|
|
@ -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'),)
|
||||
|
|
Reference in a new issue