Skip to content
Snippets Groups Projects
Commit 028cbfe2 authored by ave's avatar ave Committed by ave
Browse files

expose bundle metadata to ApplicationContext

parent cf7cdc06
No related branches found
No related tags found
No related merge requests found
...@@ -30,13 +30,18 @@ class ApplicationContext: ...@@ -30,13 +30,18 @@ class ApplicationContext:
_bundle_path: str _bundle_path: str
def __init__(self, bundle_path: str = "") -> None: def __init__(self, bundle_path: str = "", bundle_metadata: dict = None) -> None:
self._bundle_path = bundle_path self._bundle_path = bundle_path
self._bundle_metadata = bundle_metadata
@property @property
def bundle_path(self) -> str: def bundle_path(self) -> str:
return self._bundle_path return self._bundle_path
@property
def bundle_metadata(self) -> str:
return self._bundle_metadata
class Application(BaseView): class Application(BaseView):
def __init__(self, app_ctx: ApplicationContext) -> None: def __init__(self, app_ctx: ApplicationContext) -> None:
...@@ -172,7 +177,7 @@ class BundleMetadata: ...@@ -172,7 +177,7 @@ class BundleMetadata:
log.info(f"Loaded {self.name} module: {m}") log.info(f"Loaded {self.name} module: {m}")
klass = getattr(m, class_entry) klass = getattr(m, class_entry)
log.info(f"Loaded {self.name} class: {klass}") log.info(f"Loaded {self.name} class: {klass}")
inst = klass(ApplicationContext(self.path)) inst = klass(ApplicationContext(self.path, self._t))
log.info(f"Instantiated {self.name} class: {inst}") log.info(f"Instantiated {self.name} class: {inst}")
return inst # type: ignore return inst # type: ignore
except Exception as e: except Exception as e:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment