kkpyutil 1.49.0__py3-none-any.whl → 1.49.2__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: kkpyutil
3
- Version: 1.49.0
3
+ Version: 1.49.2
4
4
  Summary: Building blocks for sysadmin and DevOps
5
5
  Home-page: https://github.com/kakyoism/kkpyutil/
6
6
  License: MIT
@@ -0,0 +1,7 @@
1
+ kkpyutil.py,sha256=LgdvMPixTXc_TcJsYR5X-Wi2HqVFHffK8viRKWDMmN4,122199
2
+ kkpyutil_helper/windows/kkttssave.ps1,sha256=xa3-WzqNh2rGYlOx_I4ewOuCE94gkTO5cEwYH0M67_0,446
3
+ kkpyutil_helper/windows/kkttsspeak.ps1,sha256=7WUUHMmjTQroUWA2Mvdt4JtSt475nZUHQx-qP-7rS6o,305
4
+ kkpyutil-1.49.2.dist-info/LICENSE,sha256=uISevGnCxB5QOU0ftbofN75_yUtd6E2h_MWE1zqagC8,1065
5
+ kkpyutil-1.49.2.dist-info/METADATA,sha256=uJk9c3JplvpyWsjV1lxbxRyScrozjRy_QZn75zwjc7g,1136
6
+ kkpyutil-1.49.2.dist-info/WHEEL,sha256=kLuE8m1WYU0Ig0_YEGrXyTtiJvKPpLpDEiChiNyei5Y,88
7
+ kkpyutil-1.49.2.dist-info/RECORD,,
kkpyutil.py CHANGED
@@ -2148,6 +2148,13 @@ def sync_dirs(src_root, dst_root, logger=glogger, sudo=False):
2148
2148
  if not _run_sudo_command(cmd, pwd, logger):
2149
2149
  logger.error(f'Sync failed with command: {cmd}; you may have entered wrong password')
2150
2150
  return False
2151
+ # 3. Step Two: Fix Ownership
2152
+ # -R is recursive. We set it to the user and the 'staff' group.
2153
+ chown_cmd = ['chown', '-R', f'{user}:staff', dst_root]
2154
+ logger.info(f"Setting ownership of {dst_root} to {user}...")
2155
+ if not _run_sudo_command(chown_cmd, pwd, logger):
2156
+ logger.error("Failed to set ownership.")
2157
+ return False
2151
2158
  return True
2152
2159
 
2153
2160
 
@@ -3212,11 +3219,14 @@ def json_from_text(json_str):
3212
3219
 
3213
3220
 
3214
3221
  def prompt_macos_admin_password(action="Your operation"):
3222
+ # Use {{ }} to escape curly braces in an f-string for AppleScript lists
3215
3223
  applescript = f'''
3216
- display dialog "{action} requires administrator privileges. Please enter your password:" default answer "" with hidden answer buttons {"Cancel", "OK"} default button "OK"
3217
- text returned of the result
3218
- '''
3224
+ display dialog "{action} requires administrator privileges. Please enter your password:" default answer "" with hidden answer buttons {{"Cancel", "OK"}} default button "OK"
3225
+ text returned of the result
3226
+ '''
3219
3227
  try:
3228
+ # We add 'with echoing' logic or focus if needed,
3229
+ # but the main fix is the braces below.
3220
3230
  result = subprocess.run(
3221
3231
  ['osascript', '-e', applescript],
3222
3232
  capture_output=True,
@@ -3224,8 +3234,8 @@ text returned of the result
3224
3234
  check=True
3225
3235
  )
3226
3236
  return result.stdout.strip()
3227
- except subprocess.CalledProcessError:
3228
- # User cancelled the dialog
3237
+ except subprocess.CalledProcessError as e:
3238
+ # If the dialog doesn't show, check e.stderr for AppleScript errors
3229
3239
  return None
3230
3240
 
3231
3241
 
@@ -3233,8 +3243,7 @@ text returned of the result
3233
3243
 
3234
3244
 
3235
3245
  def _test():
3236
- # print(say('hello'))
3237
- print(create_guid())
3246
+ sync_dirs('/Volumes/public/Audio/Tools/WwisePlugins/MiaSidechainRecv/2025.2.3.1/Wwise2023.1/Authoring', '/Library/Application Support/Audiokinetic/Wwise 2023.1.14.8770/Authoring', sudo=True)
3238
3247
 
3239
3248
 
3240
3249
  if __name__ == '__main__':
@@ -1,7 +0,0 @@
1
- kkpyutil.py,sha256=1iRFRACJJ87sA4ZimVznl4-caKzxB_VVkMnWiqVn_3U,121453
2
- kkpyutil_helper/windows/kkttssave.ps1,sha256=xa3-WzqNh2rGYlOx_I4ewOuCE94gkTO5cEwYH0M67_0,446
3
- kkpyutil_helper/windows/kkttsspeak.ps1,sha256=7WUUHMmjTQroUWA2Mvdt4JtSt475nZUHQx-qP-7rS6o,305
4
- kkpyutil-1.49.0.dist-info/LICENSE,sha256=uISevGnCxB5QOU0ftbofN75_yUtd6E2h_MWE1zqagC8,1065
5
- kkpyutil-1.49.0.dist-info/METADATA,sha256=4zhDruYqdoicThlEjVhbwFlAaDQzkr9fPTjZvjZ16-o,1136
6
- kkpyutil-1.49.0.dist-info/WHEEL,sha256=kLuE8m1WYU0Ig0_YEGrXyTtiJvKPpLpDEiChiNyei5Y,88
7
- kkpyutil-1.49.0.dist-info/RECORD,,