summaryrefslogtreecommitdiff
path: root/docs/source/generate_configs.py
diff options
context:
space:
mode:
authorPatrick Totzke <patricktotzke@gmail.com>2012-02-24 09:01:11 +0000
committerPatrick Totzke <patricktotzke@gmail.com>2012-02-24 09:06:13 +0000
commite323733aa62d92cdcb232ad155f45399f6fc5a61 (patch)
treed7b42a77cfea5a1c365751409ae53c328cdab71a /docs/source/generate_configs.py
parentd63bf4dc08c88003a0145278165c28d65d35f23b (diff)
sort generated config options alphabetically
Diffstat (limited to 'docs/source/generate_configs.py')
-rwxr-xr-xdocs/source/generate_configs.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/docs/source/generate_configs.py b/docs/source/generate_configs.py
index 90cf0cf9..7c9c42b2 100755
--- a/docs/source/generate_configs.py
+++ b/docs/source/generate_configs.py
@@ -6,8 +6,10 @@ from alot.commands import COMMANDS
from configobj import ConfigObj
import re
-def rewrite_scalarcomments(config, path):
+def rewrite_scalarcomments(config, path, sort=False):
file = open(path, 'w')
+ if sort:
+ config.scalars.sort()
for entry in config.scalars:
description = '\n.. describe:: %s\n\n' % entry
comments = [config.inline_comments[entry]] + config.comments[entry]
@@ -22,7 +24,7 @@ if __name__ == "__main__":
config = ConfigObj(specpath)
alotrc_table_file = os.path.join(HERE, 'configuration', 'alotrc_table.rst')
- rewrite_scalarcomments(config, alotrc_table_file)
+ rewrite_scalarcomments(config, alotrc_table_file, sort=True)
rewrite_scalarcomments(config['accounts']['__many__'],
os.path.join(HERE, 'configuration',