From f641649be7f1b8b8914fb0e3ef5d6cf27748e9c0 Mon Sep 17 00:00:00 2001 From: Yahya SayadArbabi Date: Wed, 23 Jan 2019 23:02:35 +0330 Subject: [PATCH] Sort "sites.md" --- site_list.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/site_list.py b/site_list.py index ff22320..8006f88 100644 --- a/site_list.py +++ b/site_list.py @@ -3,6 +3,7 @@ This module generates the listing of supported sites. """ import json +from collections import OrderedDict with open("data.json", "r", encoding="utf-8") as data_file: data = json.load(data_file) @@ -16,7 +17,7 @@ with open("sites.md", "w") as site_file: site_file.write(f'## List Of Supported Sites ({len(data)} Sites In Total!)\n') index = 1 - for social_network in data: + for social_network in OrderedDict(sorted(data.items())): url_main = data.get(social_network).get("urlMain") site_file.write(f'{index}. [{social_network}]({url_main})\n') index = index + 1