Don't wrap option values

This commit is contained in:
Florian Bruhin 2014-03-21 16:50:37 +01:00
parent 43d529876e
commit 108fd2c43b
2 changed files with 1 additions and 9 deletions

1
TODO
View File

@ -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

View File

@ -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')