From 05778f01573154ac4bf369603cde97cb542250d7 Mon Sep 17 00:00:00 2001 From: mokaddem Date: Tue, 5 Nov 2019 15:03:02 +0100 Subject: [PATCH] chg: [tool] sort before output --- tools/gen_manifest.py | 6 ++++-- tools/gen_markdown.py | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/tools/gen_manifest.py b/tools/gen_manifest.py index d3e4611..89cd650 100755 --- a/tools/gen_manifest.py +++ b/tools/gen_manifest.py @@ -10,7 +10,9 @@ TAXONOMY_ROOT_PATH = Path(__file__).resolve().parent.parent def fetchTaxonomies(): taxonomiesFolder = TAXONOMY_ROOT_PATH taxonomies = [] - for taxonomyFile in taxonomiesFolder.glob('./*/machinetag.json'): + allTaxonomies = list(taxonomiesFolder.glob('./*/machinetag.json')) + allTaxonomies.sort() + for taxonomyFile in allTaxonomies: with open(taxonomyFile) as f: taxonomy = json.load(f) taxonomies.append(taxonomy) @@ -45,4 +47,4 @@ if __name__ == "__main__": taxonomies = fetchTaxonomies() manifest = generateManifest(taxonomies) saveManifest(manifest) - awesomePrint('> Manifest saved!') \ No newline at end of file + awesomePrint('> Manifest saved!') diff --git a/tools/gen_markdown.py b/tools/gen_markdown.py index b979ece..3c5df6a 100755 --- a/tools/gen_markdown.py +++ b/tools/gen_markdown.py @@ -10,7 +10,9 @@ TAXONOMY_ROOT_PATH = Path(__file__).resolve().parent.parent def fetchTaxonomies(): taxonomiesFolder = TAXONOMY_ROOT_PATH taxonomies = [] - for taxonomyFile in taxonomiesFolder.glob('./*/machinetag.json'): + allTaxonomies = list(taxonomiesFolder.glob('./*/machinetag.json')) + allTaxonomies.sort() + for taxonomyFile in allTaxonomies: with open(taxonomyFile) as f: taxonomy = json.load(f) taxonomies.append(taxonomy) @@ -46,4 +48,4 @@ if __name__ == "__main__": taxonomies = fetchTaxonomies() markdown = generateMarkdown(taxonomies) saveMarkdown(markdown) - awesomePrint('> Markdown saved!') \ No newline at end of file + awesomePrint('> Markdown saved!')