MCPcopy Create free account
hub / github.com/comaps/comaps / write_strings_formatted

Method write_strings_formatted

tools/python/categories_converter.py:97–106  ·  view source on GitHub ↗
(self, outfile, key_format, line_format)

Source from the content-addressed store, hash-verified

95
96
97 def write_strings_formatted(self, outfile, key_format, line_format):
98 for key in self.keys_in_order:
99 outfile.write(key_format.format(key.strip("[]")))
100 pair = self.translations[key]
101 for lang in ITUNES_LANGS:
102 if lang in pair:
103 outfile.write(line_format.format(lang, pair[lang]))
104 remaining_langs = sorted(list(set(pair.keys()) - set(ITUNES_LANGS)))
105 for lang in remaining_langs:
106 outfile.write(line_format.format(lang, pair[lang]))
107
108
109 def add_translation(self, translation, key, lang):

Callers 2

write_as_categoriesMethod · 0.95
write_as_stringsMethod · 0.95

Calls 2

formatMethod · 0.80
writeMethod · 0.45

Tested by

no test coverage detected