MCPcopy Index your code
hub / github.com/python/cpython / _dump

Function _dump

Lib/idlelib/config.py:881–908  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

879
880# TODO Revise test output, write expanded unittest
881def _dump(): # htest # (not really, but ignore in coverage)
882 from zlib import crc32
883 line, crc = 0, 0
884
885 def sprint(obj):
886 nonlocal line, crc
887 txt = str(obj)
888 line += 1
889 crc = crc32(txt.encode(encoding='utf-8'), crc)
890 print(txt)
891 #print('***', line, crc, '***') # Uncomment for diagnosis.
892
893 def dumpCfg(cfg):
894 print('\n', cfg, '\n') # Cfg has variable '0xnnnnnnnn' address.
895 for key in sorted(cfg):
896 sections = cfg[key].sections()
897 sprint(key)
898 sprint(sections)
899 for section in sections:
900 options = cfg[key].options(section)
901 sprint(section)
902 sprint(options)
903 for option in options:
904 sprint(option + ' = ' + cfg[key].Get(section, option))
905
906 dumpCfg(idleConf.defaultCfg)
907 dumpCfg(idleConf.userCfg)
908 print('\nlines = ', line, ', crc = ', crc, sep='')
909
910
911if __name__ == '__main__':

Callers 1

config.pyFile · 0.70

Calls 1

dumpCfgFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…