-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add globals
kwarg to app and adjust ideconfig
behavior
#1017
base: main
Are you sure you want to change the base?
Conversation
@@ -186,13 +196,19 @@ def __init__(self, db_file=None, private_appdata=False, **kwargs): | |||
runtime.initialize(self._version) | |||
connect_warnings(self) | |||
self._poster = None | |||
# Set the initialized flag to True | |||
self._app._initialized = True | |||
|
|||
self._disposed = False | |||
atexit.register(_dispose_embedded_app, INSTANCES) | |||
INSTANCES.append(self) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@klmcadams No need to add a flag. You can check len(INSTANCES)
@@ -218,6 +234,10 @@ def _dispose(self): | |||
self._app.Dispose() | |||
self._disposed = True | |||
|
|||
def is_initialized(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should be a free function. otherwise you need an instance of the app to check if the app is initialized
# SOFTWARE. | ||
"""Import Mechanical globals.""" | ||
|
||
import clr |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missing the exception here if the app hasn't been initialized yet
Need to update examples. one should use the new globals() argument. Another should avoid globals entirely and import the types manually after constructing the app instance |
globals
kwarg to App classideconfig