kkpyutil 1.33.2__tar.gz → 1.33.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.
- {kkpyutil-1.33.2 → kkpyutil-1.33.3}/PKG-INFO +1 -1
- {kkpyutil-1.33.2 → kkpyutil-1.33.3}/kkpyutil.py +9 -3
- {kkpyutil-1.33.2 → kkpyutil-1.33.3}/pyproject.toml +1 -1
- {kkpyutil-1.33.2 → kkpyutil-1.33.3}/LICENSE +0 -0
- {kkpyutil-1.33.2 → kkpyutil-1.33.3}/README.md +0 -0
- {kkpyutil-1.33.2 → kkpyutil-1.33.3}/kkpyutil_helper/windows/kkttssave.ps1 +0 -0
- {kkpyutil-1.33.2 → kkpyutil-1.33.3}/kkpyutil_helper/windows/kkttsspeak.ps1 +0 -0
|
@@ -588,15 +588,21 @@ def alert(content, title='Debug', action='Close'):
|
|
|
588
588
|
- on Windows, mshta msgbox does not support custom button text
|
|
589
589
|
- so "action" is ignored on windows
|
|
590
590
|
- multiline message uses \n as line separator
|
|
591
|
+
- mshta (ms html application host) tend to open vbs using text editor; so we use dedicated vbscript cli instead
|
|
591
592
|
"""
|
|
592
593
|
if PLATFORM == 'Windows':
|
|
593
594
|
# Escape double quotes inside content and title for VBScript
|
|
594
595
|
# vbs uses its own line-end
|
|
595
596
|
content = content.replace('\n', '" & vbCrLf & "').replace('"', '""')
|
|
596
597
|
title = title.replace('"', '""')
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
598
|
+
# Construct the VBScript command for the message box
|
|
599
|
+
vbs_content = f'MsgBox "{content}", 0, "{title}"'
|
|
600
|
+
vbs = osp.join(get_platform_tmp_dir(), 'msg.vbs')
|
|
601
|
+
save_text(vbs, vbs_content)
|
|
602
|
+
cmd = ['cscript', '//Nologo', vbs]
|
|
603
|
+
subprocess.run(cmd, shell=True)
|
|
604
|
+
# Clean up the temporary file
|
|
605
|
+
os.remove(vbs)
|
|
600
606
|
return cmd
|
|
601
607
|
if PLATFORM == 'Darwin':
|
|
602
608
|
cmd = ['osascript', '-e', f'display alert "{title}" message "{content}"']
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|