Skip to content

Commit a0d95b1

Browse files
ci: [pre-commit.ci] autoupdate (#227)
* ci: [pre-commit.ci] autoupdate updates: - [github.com/crate-ci/typos: v1.27.0 → typos-dict-v0.11.37](crate-ci/typos@v1.27.0...typos-dict-v0.11.37) - [github.com/astral-sh/ruff-pre-commit: v0.7.2 → v0.8.1](astral-sh/ruff-pre-commit@v0.7.2...v0.8.1) - [github.com/abravalheri/validate-pyproject: v0.22 → v0.23](abravalheri/validate-pyproject@v0.22...v0.23) * style: [pre-commit.ci] auto fixes [...] --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Talley Lambert <[email protected]>
1 parent 8a26cc3 commit a0d95b1

File tree

10 files changed

+23
-25
lines changed

10 files changed

+23
-25
lines changed

.pre-commit-config.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,20 @@ ci:
55

66
repos:
77
- repo: https://github.com/crate-ci/typos
8-
rev: v1.27.0
8+
rev: typos-dict-v0.11.37
99
hooks:
1010
- id: typos
1111
args: []
1212

1313
- repo: https://github.com/astral-sh/ruff-pre-commit
14-
rev: v0.7.2
14+
rev: v0.8.1
1515
hooks:
1616
- id: ruff
1717
args: ["--fix", "--unsafe-fixes"]
1818
- id: ruff-format
1919

2020
- repo: https://github.com/abravalheri/validate-pyproject
21-
rev: v0.22
21+
rev: v0.23
2222
hooks:
2323
- id: validate-pyproject
2424

src/app_model/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@
1111
from .registries._register import register_action
1212
from .types import Action
1313

14-
__all__ = ["__version__", "Application", "Action", "register_action"]
14+
__all__ = ["Action", "Application", "__version__", "register_action"]

src/app_model/backends/qt/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,17 @@
1616
__all__ = [
1717
"QCommandAction",
1818
"QCommandRuleAction",
19-
"qkey2modelkey",
2019
"QKeyBindingSequence",
21-
"qkeycombo2modelkey",
22-
"qkeysequence2modelkeybinding",
2320
"QMenuItemAction",
2421
"QModelKeyBindingEdit",
2522
"QModelMainWindow",
2623
"QModelMenu",
2724
"QModelMenuBar",
2825
"QModelSubmenu",
2926
"QModelToolBar",
27+
"qkey2modelkey",
28+
"qkeycombo2modelkey",
29+
"qkeysequence2modelkeybinding",
3030
"qmods2modelmods",
3131
"to_qicon",
3232
]

src/app_model/backends/qt/_qaction.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -107,10 +107,8 @@ def update_from_context(self, ctx: Mapping[str, object]) -> None:
107107
"""Update the enabled state of this menu item from `ctx`."""
108108
self.setEnabled(expr.eval(ctx) if (expr := self._cmd_rule.enablement) else True)
109109
if expr2 := self._cmd_rule.toggled:
110-
if (
111-
isinstance(expr2, Expr)
112-
or isinstance(expr2, ToggleRule)
113-
and (expr2 := expr2.condition)
110+
if isinstance(expr2, Expr) or (
111+
isinstance(expr2, ToggleRule) and (expr2 := expr2.condition)
114112
):
115113
self.setChecked(expr2.eval(ctx))
116114

src/app_model/expressions/__init__.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
)
1717

1818
__all__ = [
19-
"app_model_context",
2019
"BinOp",
2120
"BoolOp",
2221
"Compare",
@@ -25,12 +24,13 @@
2524
"ContextKey",
2625
"ContextKeyInfo",
2726
"ContextNamespace",
28-
"create_context",
2927
"Expr",
30-
"get_context",
3128
"IfExp",
3229
"Name",
30+
"UnaryOp",
31+
"app_model_context",
32+
"create_context",
33+
"get_context",
3334
"parse_expression",
3435
"safe_eval",
35-
"UnaryOp",
3636
]

src/app_model/expressions/_expressions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -619,7 +619,7 @@ def visit_Constant(self, node: ast.Constant) -> None:
619619
def visit_BoolOp(self, node: ast.BoolOp) -> Any:
620620
op = f" {_OPS[type(node.op)]} "
621621
for idx, value in enumerate(node.values):
622-
self.write(idx and op or "", value)
622+
self.write((idx and op) or "", value)
623623

624624
def visit_Compare(self, node: ast.Compare) -> None:
625625
self.visit(node.left)

src/app_model/registries/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@
99
"CommandsRegistry",
1010
"KeyBindingsRegistry",
1111
"MenusRegistry",
12-
"register_action",
1312
"RegisteredCommand",
13+
"register_action",
1414
]

src/app_model/registries/_commands_reg.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,13 @@ class RegisteredCommand(Generic[P, R]):
3838
"""
3939

4040
__slots__ = (
41-
"id",
41+
"_initialized",
42+
"_injected_callback",
43+
"_injection_store",
44+
"_resolved_callback",
4245
"callback",
46+
"id",
4347
"title",
44-
"_resolved_callback",
45-
"_injection_store",
46-
"_injected_callback",
47-
"_initialized",
4848
)
4949

5050
def __init__(

src/app_model/types/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,15 +38,15 @@
3838
"Icon",
3939
"KeyBinding",
4040
"KeyBindingRule",
41+
"KeyBindingSource",
4142
"KeyChord",
4243
"KeyCode",
4344
"KeyCombo",
4445
"KeyMod",
45-
"KeyBindingSource",
46-
"OperatingSystem",
4746
"MenuItem",
4847
"MenuItemBase",
4948
"MenuRule",
49+
"OperatingSystem",
5050
"ScanCode",
5151
"SimpleKeyBinding",
5252
"StandardKeyBinding",

src/app_model/types/_keys/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@
99
"KeyCombo",
1010
"KeyMod",
1111
"ScanCode",
12-
"StandardKeyBinding",
1312
"SimpleKeyBinding",
13+
"StandardKeyBinding",
1414
]

0 commit comments

Comments
 (0)