Skip to content

feat: add top level Application.context#145

Merged
tlambert03 merged 3 commits intopyapp-kit:mainfrom
tlambert03:app-context
Nov 6, 2023
Merged

feat: add top level Application.context#145
tlambert03 merged 3 commits intopyapp-kit:mainfrom
tlambert03:app-context

Conversation

@tlambert03
Copy link
Copy Markdown
Member

@tlambert03 tlambert03 commented Nov 3, 2023

This PR adds an Application.context attribute. It can serve as a natural place for applications to put a top level context (and, as usual, they can spawn children contexts with context.new_child).

it does not yet hook up context.changed signals to anything in the Qt backend. mostly because I think more consideration of context "scoping" is necessary. For example, it's not obvious that app.context is the "correct" context to pass to one of the update_from_context methods... it might be a more narrowly scoped child context provided by the user.

@codecov
Copy link
Copy Markdown

codecov bot commented Nov 3, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (9e1d527) 100.00% compared to head (af9f9d6) 100.00%.

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #145   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           31        31           
  Lines         1761      1781   +20     
=========================================
+ Hits          1761      1781   +20     
Files Coverage Δ
src/app_model/_app.py 100.00% <100.00%> (ø)
src/app_model/backends/qt/_qaction.py 100.00% <100.00%> (ø)
src/app_model/expressions/__init__.py 100.00% <100.00%> (ø)
src/app_model/expressions/_context.py 100.00% <100.00%> (ø)

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@tlambert03
Copy link
Copy Markdown
Member Author

cc @lucyleeow, this is (in-part) addressing #142 (review)

@tlambert03 tlambert03 merged commit 668544b into pyapp-kit:main Nov 6, 2023
@tlambert03 tlambert03 deleted the app-context branch November 6, 2023 22:35
@tlambert03 tlambert03 added the enhancement New feature or request label Dec 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Development

Successfully merging this pull request may close these issues.

1 participant