Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Quite a large reorganization of imports in the activity-browser, and controllers packages. This change allows us to import certain important objects like the application, main window, signals, controllers and logger in a simplified manner. For example the logger can now be accessed by simply putting:
from activity_browser import log
after which you can uselog.debug
orlog.info
as usual.Quick summary of changes
from activity_browser import application, log, signals, ab_settings, project_settings, version
and any of the controllersapplication.main_window
, which make it easier to create widgets that inherit the main_window directly.Considerations regarding stand-alone controllers
For future reference: at this moment I chose to make the controllers global instead of singletons or instanceless for the following reasons:
Why not instanceless and access through static methods?
Tried it out, but properties don't work for objects that have no instance. And as the plan is to add properties like
databases
orprojects
to the controllers later, this won't work.Why not singletons?
Although implementing a singleton structure using the
__new__
dundermethod seemed easy at first,__init__
is called every time a class is called for. Because we have a lot of signal connections in the init-phase of the controllers right now I decided it was not worth the stability risk.Checklist
bug
,feature
,ui
,change
,documentation
,breaking
,ci
as they show up in the changelog.