MCPcopy Index your code
hub / github.com/RustPython/RustPython / get_header

Method get_header

Lib/test/test_tools/test_i18n.py:50–59  ·  view source on GitHub ↗

utility: return the header of a .po file as a dictionary

(self, data)

Source from the content-addressed store, hash-verified

48 script = Path(toolsdir, 'i18n', 'pygettext.py')
49
50 def get_header(self, data):
51 """ utility: return the header of a .po file as a dictionary """
52 headers = {}
53 for line in data.split('\n'):
54 if not line or line.startswith(('#', 'msgid', 'msgstr')):
55 continue
56 line = line.strip('"')
57 key, val = line.split(':', 1)
58 headers[key] = val.strip()
59 return headers
60
61 def get_msgids(self, data):
62 """ utility: return all msgids in .po file as a list of strings """

Callers 9

test_headerMethod · 0.95
test_http_body_fileMethod · 0.45
test_http_body_pipeMethod · 0.45
test_http_body_arrayMethod · 0.45
_test_basic_authMethod · 0.45

Calls 3

splitMethod · 0.45
startswithMethod · 0.45
stripMethod · 0.45

Tested by

no test coverage detected