diff options
author | Xi Ruoyao <xry111@xry111.site> | 2023-08-01 09:17:05 +0800 |
---|---|---|
committer | Xi Ruoyao <xry111@xry111.site> | 2023-08-01 09:17:05 +0800 |
commit | 57499d5909d515e8e4d9bfab91c90350816e148c (patch) | |
tree | 7b65a3e8f4e655e25cd848725a2c29f0ce0a8dd3 /chapter10/kernel/kernel-config.py | |
parent | 70bf5512d96389ea1c068cd20a48093a10d6a963 (diff) |
kernel: Separate toplevel menus in rendering
Diffstat (limited to 'chapter10/kernel/kernel-config.py')
-rwxr-xr-x | chapter10/kernel/kernel-config.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/chapter10/kernel/kernel-config.py b/chapter10/kernel/kernel-config.py index 93b203a46..fc9bcc0d2 100755 --- a/chapter10/kernel/kernel-config.py +++ b/chapter10/kernel/kernel-config.py @@ -243,6 +243,8 @@ for i in known_config: if i not in done: raise Exception("%s seems not exist" % i) +sep = known_config.get('separate_toplevel_menu') + for i0, val, i1, title, arrow, key, menu, comment in r: rem = max_line @@ -275,7 +277,10 @@ for i0, val, i1, title, arrow, key, menu, comment in r: comment = [comment] if comment: comment = '\n'.join([' ' * i0 + '# ' + line for line in comment]) - line = escape(comment) + ':\n' + line + buf += escape(comment) + ':' + + if not menu and buf: + buf += [''] buf += [line.rstrip()] |