fix: [tool] Write in utf8

pull/176/head
mokaddem 2019-11-05 15:13:41 +01:00
parent 07fa7a0553
commit a7bba2caeb
3 changed files with 480 additions and 480 deletions

File diff suppressed because it is too large Load Diff

View File

@ -14,7 +14,7 @@ def fetchTaxonomies():
allTaxonomies = list(taxonomiesFolder.glob('./*/machinetag.json')) allTaxonomies = list(taxonomiesFolder.glob('./*/machinetag.json'))
allTaxonomies.sort() allTaxonomies.sort()
for taxonomyFile in allTaxonomies: for taxonomyFile in allTaxonomies:
with open(taxonomyFile) as f: with open(taxonomyFile, 'rb') as f:
taxonomy = json.load(f) taxonomy = json.load(f)
taxonomies.append(taxonomy) taxonomies.append(taxonomy)
return taxonomies return taxonomies
@ -39,7 +39,7 @@ def generateManifest(taxonomies):
def saveManifest(manifest): def saveManifest(manifest):
with open(TAXONOMY_ROOT_PATH / 'MANIFEST.json', 'w') as f: with open(TAXONOMY_ROOT_PATH / 'MANIFEST.json', 'w') as f:
json.dump(manifest, f, indent=2, sort_keys=True) json.dump(manifest, f, indent=2, sort_keys=True, ensure_ascii=False)
def awesomePrint(text): def awesomePrint(text):
print('\033[1;32m{}\033[0;39m'.format(text)) print('\033[1;32m{}\033[0;39m'.format(text))

View File

@ -14,7 +14,7 @@ def fetchTaxonomies():
allTaxonomies = list(taxonomiesFolder.glob('./*/machinetag.json')) allTaxonomies = list(taxonomiesFolder.glob('./*/machinetag.json'))
allTaxonomies.sort() allTaxonomies.sort()
for taxonomyFile in allTaxonomies: for taxonomyFile in allTaxonomies:
with open(taxonomyFile) as f: with open(taxonomyFile, 'rb') as f:
taxonomy = json.load(f) taxonomy = json.load(f)
taxonomies.append(taxonomy) taxonomies.append(taxonomy)
return taxonomies return taxonomies
@ -39,7 +39,7 @@ def generateMarkdown(taxonomies):
return markdown return markdown
def saveMarkdown(markdown): def saveMarkdown(markdown):
with open(TAXONOMY_ROOT_PATH / 'Summary.md', 'w') as f: with open(TAXONOMY_ROOT_PATH / 'summary.md', 'w') as f:
f.write(markdown) f.write(markdown)
def awesomePrint(text): def awesomePrint(text):