diff options
| author | Ulf Magnusson <ulfalizer@gmail.com> | 2017-11-26 14:37:46 +0100 |
|---|---|---|
| committer | Ulf Magnusson <ulfalizer@gmail.com> | 2017-11-26 14:43:02 +0100 |
| commit | 882f58c7d1dfc935b22a4a9b2ae144d238d5f093 (patch) | |
| tree | 608f60f703200f8618e8356e59bcd77590c70ae5 /examples/print_tree.py | |
| parent | 1a0cfea9b6e070540c14d7121f88612b0fb94c19 (diff) | |
print_tree.py: Style nits
- Remove redundant parentheses in indent_print().
- Use unnumbered replacement fields with format().
Diffstat (limited to 'examples/print_tree.py')
| -rw-r--r-- | examples/print_tree.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/examples/print_tree.py b/examples/print_tree.py index 1a53a3a..09883d7 100644 --- a/examples/print_tree.py +++ b/examples/print_tree.py @@ -42,7 +42,7 @@ from kconfiglib import Kconfig, Symbol, Choice, MENU, COMMENT import sys def indent_print(s, indent): - print((" " * indent) + s) + print(" "*indent + s) def print_items(node, indent): while node: @@ -53,10 +53,11 @@ def print_items(node, indent): indent_print("choice", indent) elif node.item == MENU: - indent_print('menu "{0}"'.format(node.prompt[0]), indent) + indent_print('menu "{}"'.format(node.prompt[0]), indent) elif node.item == COMMENT: - indent_print('comment "{0}"'.format(node.prompt[0]), indent) + indent_print('comment "{}"'.format(node.prompt[0]), indent) + if node.list: print_items(node.list, indent + 2) |
