omdev 0.0.0.dev384__py3-none-any.whl → 0.0.0.dev385__py3-none-any.whl
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.
- omdev/ptk/__init__.py +3 -0
- omdev/ptk/confirm.py +11 -2
- {omdev-0.0.0.dev384.dist-info → omdev-0.0.0.dev385.dist-info}/METADATA +2 -2
- {omdev-0.0.0.dev384.dist-info → omdev-0.0.0.dev385.dist-info}/RECORD +8 -8
- {omdev-0.0.0.dev384.dist-info → omdev-0.0.0.dev385.dist-info}/WHEEL +0 -0
- {omdev-0.0.0.dev384.dist-info → omdev-0.0.0.dev385.dist-info}/entry_points.txt +0 -0
- {omdev-0.0.0.dev384.dist-info → omdev-0.0.0.dev385.dist-info}/licenses/LICENSE +0 -0
- {omdev-0.0.0.dev384.dist-info → omdev-0.0.0.dev385.dist-info}/top_level.txt +0 -0
omdev/ptk/__init__.py
CHANGED
@@ -97,4 +97,7 @@ from prompt_toolkit.widgets.toolbars import SearchToolbar
|
|
97
97
|
from prompt_toolkit.widgets.toolbars import SystemToolbar
|
98
98
|
from prompt_toolkit.widgets.toolbars import ValidationToolbar
|
99
99
|
|
100
|
+
#
|
101
|
+
from .confirm import a_strict_confirm
|
102
|
+
from .confirm import create_strict_confirm_session
|
100
103
|
from .confirm import strict_confirm
|
omdev/ptk/confirm.py
CHANGED
@@ -1,9 +1,11 @@
|
|
1
|
+
|
1
2
|
from prompt_toolkit.formatted_text import merge_formatted_text
|
2
3
|
from prompt_toolkit.key_binding import KeyBindings
|
3
4
|
from prompt_toolkit.key_binding import KeyPressEvent
|
4
5
|
from prompt_toolkit.shortcuts import PromptSession
|
5
6
|
|
6
7
|
from omlish import check
|
8
|
+
from omlish import lang
|
7
9
|
|
8
10
|
|
9
11
|
##
|
@@ -37,12 +39,15 @@ def create_strict_confirm_session(
|
|
37
39
|
return session
|
38
40
|
|
39
41
|
|
40
|
-
|
42
|
+
##
|
43
|
+
|
44
|
+
|
45
|
+
def _m_strict_confirm(message: str = 'Confirm?', suffix: str = ' (y/n) ') -> lang.MaysyncGen[bool]:
|
41
46
|
"""Display a confirmation prompt that returns True/False. Requires an explicit answer."""
|
42
47
|
|
43
48
|
while True:
|
44
49
|
session = create_strict_confirm_session(message, suffix)
|
45
|
-
ret = session.prompt
|
50
|
+
ret = (yield lang.maysync_op(session.prompt, session.prompt_async))
|
46
51
|
|
47
52
|
if isinstance(ret, str):
|
48
53
|
check.empty(ret)
|
@@ -52,3 +57,7 @@ def strict_confirm(message: str = 'Confirm?', suffix: str = ' (y/n) ') -> bool:
|
|
52
57
|
|
53
58
|
else:
|
54
59
|
raise TypeError(ret)
|
60
|
+
|
61
|
+
|
62
|
+
strict_confirm = lang.maysync_wrap(_m_strict_confirm)
|
63
|
+
a_strict_confirm = lang.a_maysync_wrap(_m_strict_confirm)
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: omdev
|
3
|
-
Version: 0.0.0.
|
3
|
+
Version: 0.0.0.dev385
|
4
4
|
Summary: omdev
|
5
5
|
Author: wrmsr
|
6
6
|
License-Expression: BSD-3-Clause
|
@@ -14,7 +14,7 @@ Classifier: Programming Language :: Python :: 3.13
|
|
14
14
|
Requires-Python: >=3.13
|
15
15
|
Description-Content-Type: text/markdown
|
16
16
|
License-File: LICENSE
|
17
|
-
Requires-Dist: omlish==0.0.0.
|
17
|
+
Requires-Dist: omlish==0.0.0.dev385
|
18
18
|
Provides-Extra: all
|
19
19
|
Requires-Dist: black~=25.1; extra == "all"
|
20
20
|
Requires-Dist: pycparser~=2.22; extra == "all"
|
@@ -216,8 +216,8 @@ omdev/precheck/main.py,sha256=_1A5wiu9p2th1dn_17w1ZIFtMmCIOaTFpWyvK0jopEA,4374
|
|
216
216
|
omdev/precheck/manifests.py,sha256=1CG0PG0feagydT-cgxiOBvQKhoILjZVXk4MYf65wkkM,786
|
217
217
|
omdev/precheck/scripts.py,sha256=244Jq5xee2QErn0gvpt0hmdYg95TYtuefMDXaE9YPws,1344
|
218
218
|
omdev/precheck/unicode.py,sha256=VUNDCrlfUas_U8ugV_q0eFUXuBgKjS8YdCFm0FXREXo,2583
|
219
|
-
omdev/ptk/__init__.py,sha256=
|
220
|
-
omdev/ptk/confirm.py,sha256=
|
219
|
+
omdev/ptk/__init__.py,sha256=EfZaAaPbOxgOt3-fdYS8ssI5A0KsCIIMbTRdalWSrR4,5233
|
220
|
+
omdev/ptk/confirm.py,sha256=ldkQJ6ywJskLHcXrH7cDt9_JEOFUtA3YGGXqIrCHG4g,1680
|
221
221
|
omdev/ptk/apps/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
222
222
|
omdev/ptk/apps/ncdu.py,sha256=KTbAgwhzcROOvq20VGN92UwMWcgkMMVOeFfpjZAsKUk,4561
|
223
223
|
omdev/ptk/markdown/LICENSE,sha256=oSmc9j-n23wTJUO0TbY8sIHrf9pFZUovFWfDL7D53IA,1489
|
@@ -315,9 +315,9 @@ omdev/tools/jsonview/resources/jsonview.js,sha256=faDvXDOXKvEvjOuIlz4D3F2ReQXb_b
|
|
315
315
|
omdev/tools/pawk/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
316
316
|
omdev/tools/pawk/__main__.py,sha256=VCqeRVnqT1RPEoIrqHFSu4PXVMg4YEgF4qCQm90-eRI,66
|
317
317
|
omdev/tools/pawk/pawk.py,sha256=ao5mdrpiSU4AZ8mBozoEaV3UVlmVTnRG9wD9XP70MZE,11429
|
318
|
-
omdev-0.0.0.
|
319
|
-
omdev-0.0.0.
|
320
|
-
omdev-0.0.0.
|
321
|
-
omdev-0.0.0.
|
322
|
-
omdev-0.0.0.
|
323
|
-
omdev-0.0.0.
|
318
|
+
omdev-0.0.0.dev385.dist-info/licenses/LICENSE,sha256=B_hVtavaA8zCYDW99DYdcpDLKz1n3BBRjZrcbv8uG8c,1451
|
319
|
+
omdev-0.0.0.dev385.dist-info/METADATA,sha256=D1mBJy5Mdz6ekz7Sxubze0fVmSrFQuCbchUwVF3p7GM,5094
|
320
|
+
omdev-0.0.0.dev385.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
321
|
+
omdev-0.0.0.dev385.dist-info/entry_points.txt,sha256=dHLXFmq5D9B8qUyhRtFqTGWGxlbx3t5ejedjrnXNYLU,33
|
322
|
+
omdev-0.0.0.dev385.dist-info/top_level.txt,sha256=1nr7j30fEWgLYHW3lGR9pkdHkb7knv1U1ES1XRNVQ6k,6
|
323
|
+
omdev-0.0.0.dev385.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|