kkpyutil 1.35.0__tar.gz → 1.36.0__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.35.0
3
+ Version: 1.36.0
4
4
  Summary: Building blocks for sysadmin and DevOps
5
5
  Home-page: https://github.com/kakyoism/kkpyutil/
6
6
  License: MIT
@@ -314,6 +314,14 @@ def format_error(expected, got):
314
314
  {log_got}"""
315
315
 
316
316
 
317
+ def format_xml(elem, indent=' ', encoding='utf-8'):
318
+ import xml.etree.ElementTree as ET
319
+ from xml.dom import minidom
320
+ rough_string = ET.tostring(elem, encoding)
321
+ reparsed = minidom.parseString(rough_string)
322
+ return reparsed.toprettyxml(indent=indent)
323
+
324
+
317
325
  def throw(err_cls, detail, advice):
318
326
  raise err_cls(f"""
319
327
  {format_brief('Detail', detail if isinstance(detail, list) else [detail])}
@@ -2878,6 +2886,10 @@ def remove_unsupported_dict_keys(mydict: dict, supported_keys: set):
2878
2886
  return mydict
2879
2887
 
2880
2888
 
2889
+
2890
+
2891
+
2892
+
2881
2893
  def _test():
2882
2894
  print(say('hello'))
2883
2895
 
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "kkpyutil"
3
- version = "1.35.0"
3
+ version = "1.36.0"
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