quickmacapp 2025.6.24__tar.gz → 2026.2.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {quickmacapp-2025.6.24 → quickmacapp-2026.2.3}/PKG-INFO +1 -1
- {quickmacapp-2025.6.24 → quickmacapp-2026.2.3}/pyproject.toml +1 -1
- {quickmacapp-2025.6.24 → quickmacapp-2026.2.3}/src/quickmacapp/__init__.py +2 -1
- {quickmacapp-2025.6.24 → quickmacapp-2026.2.3}/src/quickmacapp/_background.py +37 -6
- {quickmacapp-2025.6.24 → quickmacapp-2026.2.3}/src/quickmacapp/_quickapp.py +10 -1
- {quickmacapp-2025.6.24 → quickmacapp-2026.2.3}/src/quickmacapp.egg-info/PKG-INFO +1 -1
- {quickmacapp-2025.6.24 → quickmacapp-2026.2.3}/LICENSE +0 -0
- {quickmacapp-2025.6.24 → quickmacapp-2026.2.3}/README.rst +0 -0
- {quickmacapp-2025.6.24 → quickmacapp-2026.2.3}/setup.cfg +0 -0
- {quickmacapp-2025.6.24 → quickmacapp-2026.2.3}/src/quickmacapp/_interactions.py +0 -0
- {quickmacapp-2025.6.24 → quickmacapp-2026.2.3}/src/quickmacapp/_notifications.py +0 -0
- {quickmacapp-2025.6.24 → quickmacapp-2026.2.3}/src/quickmacapp/notifications.py +0 -0
- {quickmacapp-2025.6.24 → quickmacapp-2026.2.3}/src/quickmacapp/py.typed +0 -0
- {quickmacapp-2025.6.24 → quickmacapp-2026.2.3}/src/quickmacapp.egg-info/SOURCES.txt +0 -0
- {quickmacapp-2025.6.24 → quickmacapp-2026.2.3}/src/quickmacapp.egg-info/dependency_links.txt +0 -0
- {quickmacapp-2025.6.24 → quickmacapp-2026.2.3}/src/quickmacapp.egg-info/requires.txt +0 -0
- {quickmacapp-2025.6.24 → quickmacapp-2026.2.3}/src/quickmacapp.egg-info/top_level.txt +0 -0
|
@@ -9,7 +9,7 @@ build-backend = "setuptools.build_meta"
|
|
|
9
9
|
name = "quickmacapp"
|
|
10
10
|
description = "Make it easier to write Mac apps in Python"
|
|
11
11
|
readme = "README.rst"
|
|
12
|
-
version = "
|
|
12
|
+
version = "2026.02.03"
|
|
13
13
|
dependencies = [
|
|
14
14
|
"pyobjc-framework-Cocoa",
|
|
15
15
|
"pyobjc-framework-ExceptionHandling",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
from ._quickapp import Actionable, ItemState, Status, mainpoint, menu, quit
|
|
2
2
|
from ._interactions import ask, choose, answer, getpass
|
|
3
|
-
from ._background import dockIconWhenVisible
|
|
3
|
+
from ._background import dockIconWhenVisible, DockIconManager
|
|
4
4
|
|
|
5
5
|
__all__ = [
|
|
6
6
|
"Actionable",
|
|
@@ -14,4 +14,5 @@ __all__ = [
|
|
|
14
14
|
"answer",
|
|
15
15
|
"getpass",
|
|
16
16
|
"dockIconWhenVisible",
|
|
17
|
+
"DockIconManager",
|
|
17
18
|
]
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
from
|
|
2
|
-
|
|
1
|
+
from contextlib import contextmanager
|
|
3
2
|
from dataclasses import dataclass, field
|
|
3
|
+
from typing import Any, Callable, Iterator, Protocol, ContextManager
|
|
4
4
|
|
|
5
5
|
from AppKit import (
|
|
6
6
|
NSApplication,
|
|
@@ -21,6 +21,18 @@ from AppKit import (
|
|
|
21
21
|
)
|
|
22
22
|
|
|
23
23
|
|
|
24
|
+
class DockIconManager(Protocol):
|
|
25
|
+
"""
|
|
26
|
+
Methods for managing the background dock icon status.
|
|
27
|
+
"""
|
|
28
|
+
|
|
29
|
+
def noDockIcon(self) -> ContextManager[None]:
|
|
30
|
+
"""
|
|
31
|
+
Temporarily suppress the application foregrounding with a dock icon,
|
|
32
|
+
for example, while displaying a brief popup.
|
|
33
|
+
"""
|
|
34
|
+
|
|
35
|
+
|
|
24
36
|
@dataclass
|
|
25
37
|
class SometimesBackground:
|
|
26
38
|
"""
|
|
@@ -35,12 +47,27 @@ class SometimesBackground:
|
|
|
35
47
|
onSpaceChange: Callable[[], None]
|
|
36
48
|
currentlyRegular: bool = False
|
|
37
49
|
previouslyActiveApp: NSRunningApplication = field(init=False)
|
|
50
|
+
suppressed: bool = False
|
|
51
|
+
|
|
52
|
+
@contextmanager
|
|
53
|
+
def noDockIcon(self) -> Iterator[None]:
|
|
54
|
+
"""
|
|
55
|
+
For the duration of this contextmanager, don't show the dock icon or show the main window.
|
|
56
|
+
"""
|
|
57
|
+
self.suppressed = True
|
|
58
|
+
try:
|
|
59
|
+
yield None
|
|
60
|
+
finally:
|
|
61
|
+
self.suppressed = False
|
|
38
62
|
|
|
39
63
|
def someApplicationActivated_(self, notification: Any) -> None:
|
|
40
64
|
# NSLog(f"active {notification} {__file__}")
|
|
41
65
|
whichApp = notification.userInfo()[NSWorkspaceApplicationKey]
|
|
42
66
|
|
|
43
|
-
if
|
|
67
|
+
if (
|
|
68
|
+
whichApp == NSRunningApplication.currentApplication()
|
|
69
|
+
and not self.suppressed
|
|
70
|
+
):
|
|
44
71
|
if self.currentlyRegular:
|
|
45
72
|
# NSLog("show editor window")
|
|
46
73
|
self.mainWindow.setIsVisible_(True)
|
|
@@ -89,7 +116,9 @@ class SometimesBackground:
|
|
|
89
116
|
NSLog("I am not on the active space, closing the window")
|
|
90
117
|
self.mainWindow.close()
|
|
91
118
|
else:
|
|
92
|
-
NSLog(
|
|
119
|
+
NSLog(
|
|
120
|
+
"I am not on the active space, but that's OK, leaving window open."
|
|
121
|
+
)
|
|
93
122
|
else:
|
|
94
123
|
NSLog("I am on the active space; not closing.")
|
|
95
124
|
self.onSpaceChange()
|
|
@@ -143,7 +172,7 @@ def dockIconWhenVisible(
|
|
|
143
172
|
mainWindow: NSWindow,
|
|
144
173
|
hideIconOnOtherSpaces: bool = True,
|
|
145
174
|
onSpaceChange: Callable[[], None] = lambda: None,
|
|
146
|
-
):
|
|
175
|
+
) -> DockIconManager:
|
|
147
176
|
"""
|
|
148
177
|
When the given main window is visible, we should have a dock icon (i.e.: be
|
|
149
178
|
NSApplicationActivationPolicyRegular). When our application is activated,
|
|
@@ -152,4 +181,6 @@ def dockIconWhenVisible(
|
|
|
152
181
|
then closed, or when our application is hidden, we should hide our dock
|
|
153
182
|
icon (i.e.: be NSApplicationActivationPolicyAccessory).
|
|
154
183
|
"""
|
|
155
|
-
SometimesBackground(mainWindow, hideIconOnOtherSpaces, onSpaceChange)
|
|
184
|
+
background = SometimesBackground(mainWindow, hideIconOnOtherSpaces, onSpaceChange)
|
|
185
|
+
background.startObserving()
|
|
186
|
+
return background
|
|
@@ -56,13 +56,22 @@ class Actionable(NSObject):
|
|
|
56
56
|
_thunk: Callable[[], object]
|
|
57
57
|
_state: ItemState
|
|
58
58
|
|
|
59
|
+
def initWithFunction_(self, thunk: Callable[[], None]) -> Actionable:
|
|
60
|
+
"""
|
|
61
|
+
Backwards compatibility initializer, creating this L{Actionable} in the
|
|
62
|
+
default L{ItemState}.
|
|
63
|
+
"""
|
|
64
|
+
return self.initWithFunction_andState_(thunk, ItemState())
|
|
65
|
+
|
|
59
66
|
def initWithFunction_andState_(
|
|
60
67
|
self, thunk: Callable[[], None], state: ItemState
|
|
61
68
|
) -> Actionable:
|
|
62
69
|
"""
|
|
63
|
-
Remember the given callable.
|
|
70
|
+
Remember the given callable, and the given menu state.
|
|
64
71
|
|
|
65
72
|
@param thunk: the callable to run in L{doIt_}.
|
|
73
|
+
|
|
74
|
+
@param state: the initial state of the menu item presentation
|
|
66
75
|
"""
|
|
67
76
|
self._thunk = thunk
|
|
68
77
|
self._state = state
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{quickmacapp-2025.6.24 → quickmacapp-2026.2.3}/src/quickmacapp.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|