kkpyutil 1.46.0__tar.gz → 1.46.2__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.46.0
3
+ Version: 1.46.2
4
4
  Summary: Building blocks for sysadmin and DevOps
5
5
  Home-page: https://github.com/kakyoism/kkpyutil/
6
6
  License: MIT
@@ -581,7 +581,7 @@ glogger.setLevel(logging.DEBUG)
581
581
  def catch_unknown_exception(exc_type, exc_value, exc_traceback):
582
582
  """Global exception to handle uncaught exceptions"""
583
583
  exc_info = exc_type, exc_value, exc_traceback
584
- glogger.error('Unhandled exception: ', exc_info=exc_info)
584
+ glogger.error('Unhandled exception:', exc_info=exc_info)
585
585
  # _logger.exception('Unhandled exception: ') # try-except block only.
586
586
  # sys.__excepthook__(*exc_info) # Keep commented out to avoid msg dup.
587
587
 
@@ -1260,8 +1260,7 @@ def _log_subprocess_command(cmd, cwd, logger, func_name="subprocess"):
1260
1260
  cmd_log = f"""\
1261
1261
  {func_name}:
1262
1262
  {' '.join(cmd)}
1263
- cwd: {osp.abspath(cwd) if cwd else os.getcwd()}
1264
- """
1263
+ cwd: {osp.abspath(cwd) if cwd else os.getcwd()}"""
1265
1264
  logger.info(cmd_log)
1266
1265
 
1267
1266
 
@@ -1344,9 +1343,9 @@ def run_cmd(cmd, cwd=None, logger=None, check=True, shell=False, verbose=False,
1344
1343
  stdout_log = safe_decode_bytes(proc.stdout)
1345
1344
  stderr_log = safe_decode_bytes(proc.stderr)
1346
1345
  if stdout_log:
1347
- console_info(f'stdout:\n{stdout_log}')
1346
+ console_info(f'stdout:\n{stdout_log.rstrip()}')
1348
1347
  if stderr_log:
1349
- logger.error(f'stderr:\n{stderr_log}')
1348
+ logger.error(f'stderr:\n{stderr_log.rstrip()}')
1350
1349
  # subprocess started but failed halfway: check=True, proc returns non-zero
1351
1350
  except subprocess.CalledProcessError as e:
1352
1351
  stdout_log = safe_decode_bytes(e.stdout)
@@ -1354,9 +1353,9 @@ def run_cmd(cmd, cwd=None, logger=None, check=True, shell=False, verbose=False,
1354
1353
 
1355
1354
  # Log subprocess output with clear separation
1356
1355
  if stdout_log:
1357
- logger.info(f'Process stdout:\n{stdout_log}')
1356
+ logger.info(f'stdout:\n{stdout_log.rstrip()}')
1358
1357
  if stderr_log:
1359
- logger.error(f'Process stderr:\n{stderr_log}')
1358
+ logger.error(f'stderr:\n{stderr_log.rstrip()}')
1360
1359
 
1361
1360
  # Log structured error message
1362
1361
  situation = "Subprocess completed with non-zero exit code"
@@ -1796,13 +1795,13 @@ def convert_compound_cases(text, style='pascal', instyle='auto'):
1796
1795
 
1797
1796
  def _detect_casing(txt):
1798
1797
  case_patterns = {
1799
- 'snake': r'^[a-z][a-z0-9]*(_[a-zA_Z0-9]+)*$',
1800
- 'SNAKE': r'^[A-Z]+(_[A-Z0-9]+)*$',
1798
+ 'snake': r'^[a-zA-Z][a-zA-Z0-9\(\)]*(_[a-zA-Z0-9\(\)]+)+$', # Must have at least one underscore
1799
+ 'SNAKE': r'^[A-Z][A-Z0-9\(\)]*(_[A-Z0-9\(\)]+)*$',
1801
1800
  'camel': r'^[a-z]+([A-Z][a-z0-9]*)*$',
1802
1801
  'kebab': r'^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)+$',
1803
1802
  'pascal': r'^[A-Z][a-z0-9]+([A-Z][a-z0-9]*)*$',
1804
1803
  'phrase': r'^[a-z]+( [a-z]+)*$',
1805
- 'title': r'^[A-Z][a-z]*([ ][A-Z][a-z]*)*$',
1804
+ 'title': r'^[A-Z][a-z]*( [A-Z\(][a-z\)]*)*$',
1806
1805
  }
1807
1806
  for case_style, pattern in case_patterns.items():
1808
1807
  if re.match(pattern, txt):
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "kkpyutil"
3
- version = "1.46.0"
3
+ version = "1.46.2"
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