From a64d712f7a61387d020ec2231e82e692e66d00f5 Mon Sep 17 00:00:00 2001 From: 7 Date: Sat, 9 Jun 2018 16:46:41 -0700 Subject: [PATCH] Remove duplicated sections under Settings (#1804) Fixes #1798 --- docs/gunicorn_ext.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/gunicorn_ext.py b/docs/gunicorn_ext.py index 932ac022..155b0102 100755 --- a/docs/gunicorn_ext.py +++ b/docs/gunicorn_ext.py @@ -36,8 +36,9 @@ PULL_REQUEST_URI = 'https://github.com/benoitc/gunicorn/pull/%s' def format_settings(app): settings_file = os.path.join(app.srcdir, "settings.rst") ret = [] - for i, s in enumerate(guncfg.KNOWN_SETTINGS): - if i == 0 or s.section != guncfg.KNOWN_SETTINGS[i - 1].section: + known_settings = sorted(guncfg.KNOWN_SETTINGS, key=lambda s: s.section) + for i, s in enumerate(known_settings): + if i == 0 or s.section != known_settings[i - 1].section: ret.append("%s\n%s\n\n" % (s.section, "-" * len(s.section))) ret.append(fmt_setting(s))