quickmacapp 2023.4.24__tar.gz → 2025.3.16__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-2023.4.24 → quickmacapp-2025.3.16}/PKG-INFO +6 -2
- {quickmacapp-2023.4.24 → quickmacapp-2025.3.16}/pyproject.toml +1 -1
- {quickmacapp-2023.4.24 → quickmacapp-2025.3.16}/src/quickmacapp/__init__.py +2 -1
- {quickmacapp-2023.4.24 → quickmacapp-2025.3.16}/src/quickmacapp/_interactions.py +22 -5
- {quickmacapp-2023.4.24 → quickmacapp-2025.3.16}/src/quickmacapp/_quickapp.py +10 -4
- {quickmacapp-2023.4.24 → quickmacapp-2025.3.16}/src/quickmacapp.egg-info/PKG-INFO +6 -2
- {quickmacapp-2023.4.24 → quickmacapp-2025.3.16}/LICENSE +0 -0
- {quickmacapp-2023.4.24 → quickmacapp-2025.3.16}/README.rst +0 -0
- {quickmacapp-2023.4.24 → quickmacapp-2025.3.16}/setup.cfg +0 -0
- {quickmacapp-2023.4.24 → quickmacapp-2025.3.16}/src/quickmacapp/py.typed +0 -0
- {quickmacapp-2023.4.24 → quickmacapp-2025.3.16}/src/quickmacapp.egg-info/SOURCES.txt +0 -0
- {quickmacapp-2023.4.24 → quickmacapp-2025.3.16}/src/quickmacapp.egg-info/dependency_links.txt +0 -0
- {quickmacapp-2023.4.24 → quickmacapp-2025.3.16}/src/quickmacapp.egg-info/requires.txt +0 -0
- {quickmacapp-2023.4.24 → quickmacapp-2025.3.16}/src/quickmacapp.egg-info/top_level.txt +0 -0
|
@@ -1,9 +1,13 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.2
|
|
2
2
|
Name: quickmacapp
|
|
3
|
-
Version:
|
|
3
|
+
Version: 2025.3.16
|
|
4
4
|
Summary: Make it easier to write Mac apps in Python
|
|
5
5
|
Description-Content-Type: text/x-rst
|
|
6
6
|
License-File: LICENSE
|
|
7
|
+
Requires-Dist: pyobjc-framework-Cocoa
|
|
8
|
+
Requires-Dist: pyobjc-framework-ExceptionHandling
|
|
9
|
+
Requires-Dist: pyobjc-framework-UserNotifications
|
|
10
|
+
Requires-Dist: twisted[macos_platform,tls]
|
|
7
11
|
|
|
8
12
|
QuickMacApp
|
|
9
13
|
==============================
|
|
@@ -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 = "2025.03.16"
|
|
13
13
|
dependencies = [
|
|
14
14
|
"pyobjc-framework-Cocoa",
|
|
15
15
|
"pyobjc-framework-ExceptionHandling",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
from ._quickapp import Actionable, Status, mainpoint, menu, quit
|
|
2
|
-
from ._interactions import ask, choose, answer
|
|
2
|
+
from ._interactions import ask, choose, answer, getpass
|
|
3
3
|
|
|
4
4
|
__all__ = [
|
|
5
5
|
"Actionable",
|
|
@@ -10,4 +10,5 @@ __all__ = [
|
|
|
10
10
|
"ask",
|
|
11
11
|
"choose",
|
|
12
12
|
"answer",
|
|
13
|
+
"getpass",
|
|
13
14
|
]
|
|
@@ -6,10 +6,12 @@ from AppKit import (
|
|
|
6
6
|
NSAlertThirdButtonReturn,
|
|
7
7
|
NSAlert,
|
|
8
8
|
NSApp,
|
|
9
|
+
NSTextField,
|
|
10
|
+
NSSecureTextField,
|
|
11
|
+
NSCenterTextAlignment,
|
|
9
12
|
)
|
|
10
13
|
from Foundation import (
|
|
11
14
|
NSRunLoop,
|
|
12
|
-
NSTextField,
|
|
13
15
|
NSRect,
|
|
14
16
|
)
|
|
15
17
|
from twisted.internet.defer import Deferred
|
|
@@ -68,7 +70,25 @@ async def choose(values: Iterable[tuple[T, str]], question: str, description: st
|
|
|
68
70
|
return potentialResults[await asyncModal(msg)]
|
|
69
71
|
|
|
70
72
|
|
|
71
|
-
async def
|
|
73
|
+
async def getpass(question: str, description: str="") -> str | None:
|
|
74
|
+
# set a sample value to get a reasonable visual width
|
|
75
|
+
txt = NSSecureTextField.textFieldWithString_("testing " * 4)
|
|
76
|
+
# clear it out because of course we don't want to use that value
|
|
77
|
+
txt.setStringValue_("")
|
|
78
|
+
txt.setAlignment_(NSCenterTextAlignment)
|
|
79
|
+
txt.setMaximumNumberOfLines_(5)
|
|
80
|
+
return await _ask(question, description, txt)
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
async def ask(question: str, description: str="", defaultValue: str=""):
|
|
84
|
+
# TODO: version of this with a NSSecureTextField for entering passwords
|
|
85
|
+
txt = NSTextField.alloc().initWithFrame_(NSRect((0, 0), (200, 100)))
|
|
86
|
+
txt.setMaximumNumberOfLines_(5)
|
|
87
|
+
txt.setStringValue_(defaultValue)
|
|
88
|
+
return await _ask(question, description, txt)
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
async def _ask(question: str, description: str, txt: NSTextField) -> str | None:
|
|
72
92
|
"""
|
|
73
93
|
Prompt the user for a short string of text.
|
|
74
94
|
"""
|
|
@@ -78,9 +98,6 @@ async def ask(question: str, description: str="", defaultValue: str="") -> str |
|
|
|
78
98
|
msg.setMessageText_(question)
|
|
79
99
|
msg.setInformativeText_(description)
|
|
80
100
|
|
|
81
|
-
txt = NSTextField.alloc().initWithFrame_(NSRect((0, 0), (200, 100)))
|
|
82
|
-
txt.setMaximumNumberOfLines_(5)
|
|
83
|
-
txt.setStringValue_(defaultValue)
|
|
84
101
|
msg.setAccessoryView_(txt)
|
|
85
102
|
msg.window().setInitialFirstResponder_(txt)
|
|
86
103
|
msg.layout()
|
|
@@ -18,6 +18,7 @@ from AppKit import (
|
|
|
18
18
|
NSEvent,
|
|
19
19
|
NSResponder,
|
|
20
20
|
NSMenu,
|
|
21
|
+
NSImage,
|
|
21
22
|
NSMenuItem,
|
|
22
23
|
NSStatusBar,
|
|
23
24
|
NSVariableStatusItemLength,
|
|
@@ -82,7 +83,7 @@ class Status:
|
|
|
82
83
|
Application status (top menu bar, on right)
|
|
83
84
|
"""
|
|
84
85
|
|
|
85
|
-
def __init__(self, text: str) -> None:
|
|
86
|
+
def __init__(self, text: str | None = None, image: NSImage | None = None) -> None:
|
|
86
87
|
"""
|
|
87
88
|
Create a L{Status} with some text to use as its label.
|
|
88
89
|
|
|
@@ -91,9 +92,14 @@ class Status:
|
|
|
91
92
|
self.item = NSStatusBar.systemStatusBar().statusItemWithLength_(
|
|
92
93
|
NSVariableStatusItemLength
|
|
93
94
|
)
|
|
94
|
-
self.item.
|
|
95
|
-
|
|
96
|
-
|
|
95
|
+
self.item.button().setEnabled_(True)
|
|
96
|
+
if image is not None:
|
|
97
|
+
self.item.button().setImage_(image)
|
|
98
|
+
elif text is None:
|
|
99
|
+
from __main__ import __file__ as default
|
|
100
|
+
text = os.path.basename(default)
|
|
101
|
+
if text is not None:
|
|
102
|
+
self.item.button().setTitle_(text)
|
|
97
103
|
|
|
98
104
|
def menu(self, items: list[tuple[str, Callable[[], object]]]) -> None:
|
|
99
105
|
"""
|
|
@@ -1,9 +1,13 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.2
|
|
2
2
|
Name: quickmacapp
|
|
3
|
-
Version:
|
|
3
|
+
Version: 2025.3.16
|
|
4
4
|
Summary: Make it easier to write Mac apps in Python
|
|
5
5
|
Description-Content-Type: text/x-rst
|
|
6
6
|
License-File: LICENSE
|
|
7
|
+
Requires-Dist: pyobjc-framework-Cocoa
|
|
8
|
+
Requires-Dist: pyobjc-framework-ExceptionHandling
|
|
9
|
+
Requires-Dist: pyobjc-framework-UserNotifications
|
|
10
|
+
Requires-Dist: twisted[macos_platform,tls]
|
|
7
11
|
|
|
8
12
|
QuickMacApp
|
|
9
13
|
==============================
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{quickmacapp-2023.4.24 → quickmacapp-2025.3.16}/src/quickmacapp.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|