Don't wrap option values
This commit is contained in:
parent
43d529876e
commit
108fd2c43b
1
TODO
1
TODO
@ -1,7 +1,6 @@
|
||||
New config TODO
|
||||
===============
|
||||
|
||||
- Writing _monospace doesn't work correctly (indented too much?)
|
||||
- How to handle interpolation correctly? Maybe we really should handle interpolation ourselves?
|
||||
Main problem: When re-writing the value, we don't know about the interpolation anymore, so we write the wrong value.
|
||||
- Tabbing through setting completion does not work
|
||||
|
@ -144,17 +144,10 @@ class Config:
|
||||
|
||||
def _str_items(self, section):
|
||||
"""Get the option items as string for section."""
|
||||
keyval_wrapper = textwrap.TextWrapper(initial_indent='',
|
||||
subsequent_indent=' ' * 4,
|
||||
drop_whitespace=False,
|
||||
**self._wrapper_args)
|
||||
lines = []
|
||||
for optname, option in section.items():
|
||||
keyval = '{} = {}'.format(optname, option)
|
||||
if 'http://' in keyval:
|
||||
lines.append(keyval)
|
||||
else:
|
||||
lines += keyval_wrapper.wrap(keyval)
|
||||
lines.append(keyval)
|
||||
return lines
|
||||
|
||||
@cmdutils.register(instance='config')
|
||||
|
Loading…
Reference in New Issue
Block a user