Commit cf02ac61 authored by Greg Ward's avatar Greg Ward

Allow the standalone wrap() and fill() functions to take arbitrary

keyword args, which are passed directly to the TextWrapper constructor.
parent d34c9591
......@@ -244,8 +244,10 @@ class TextWrapper:
# Convenience interface
def wrap(text, width):
return TextWrapper(width=width).wrap(text)
def wrap(text, width=70, **kwargs):
w = TextWrapper(width=width, **kwargs)
return w.wrap(text)
def fill(text, width, initial_tab="", subsequent_tab=""):
return TextWrapper(width=width).fill(text, initial_tab, subsequent_tab)
def fill(text, width=70, initial_tab="", subsequent_tab="", **kwargs):
w = TextWrapper(width=width, **kwargs)
return w.fill(text, initial_tab, subsequent_tab)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment