kkpyutil 1.33.3__tar.gz → 1.33.5__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: kkpyutil
3
- Version: 1.33.3
3
+ Version: 1.33.5
4
4
  Summary: Building blocks for sysadmin and DevOps
5
5
  Home-page: https://github.com/kakyoism/kkpyutil/
6
6
  License: MIT
@@ -591,17 +591,15 @@ def alert(content, title='Debug', action='Close'):
591
591
  - mshta (ms html application host) tend to open vbs using text editor; so we use dedicated vbscript cli instead
592
592
  """
593
593
  if PLATFORM == 'Windows':
594
- # Escape double quotes inside content and title for VBScript
595
594
  # vbs uses its own line-end
596
- content = content.replace('\n', '" & vbCrLf & "').replace('"', '""')
597
- title = title.replace('"', '""')
595
+ lines = [f'"{line}"' for line in content.split('\n')]
596
+ vbs_lines = ' & vbCrLf & '.join(lines)
598
597
  # Construct the VBScript command for the message box
599
- vbs_content = f'MsgBox "{content}", 0, "{title}"'
598
+ vbs_content = f'MsgBox {vbs_lines}, vbOKOnly, "{title}"'
600
599
  vbs = osp.join(get_platform_tmp_dir(), 'msg.vbs')
601
600
  save_text(vbs, vbs_content)
602
601
  cmd = ['cscript', '//Nologo', vbs]
603
- subprocess.run(cmd, shell=True)
604
- # Clean up the temporary file
602
+ subprocess.run(cmd)
605
603
  os.remove(vbs)
606
604
  return cmd
607
605
  if PLATFORM == 'Darwin':
@@ -1516,7 +1514,7 @@ def convert_compound_cases(text, style='pascal', instyle='auto'):
1516
1514
 
1517
1515
  def _detect_casing(txt):
1518
1516
  case_patterns = {
1519
- 'snake': r'^[a-z]+(_[a-zA_Z0-9]+)*$',
1517
+ 'snake': r'^[a-z][a-z0-9]*(_[a-zA_Z0-9]+)*$',
1520
1518
  'SNAKE': r'^[A-Z]+(_[A-Z0-9]+)*$',
1521
1519
  'camel': r'^[a-z]+([A-Z][a-z0-9]*)*$',
1522
1520
  'kebab': r'^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)+$',
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "kkpyutil"
3
- version = "1.33.3"
3
+ version = "1.33.5"
4
4
  description = "Building blocks for sysadmin and DevOps"
5
5
  authors = ["Beinan Li <li.beinan@gmail.com>"]
6
6
  maintainers = ["Beinan Li <li.beinan@gmail.com>"]
File without changes
File without changes