From 33dd686e28f1eca4cc0990b9e8f72b6859b70dd4 Mon Sep 17 00:00:00 2001 From: Julien Fortin Date: Wed, 27 Dec 2023 17:56:56 +0100 Subject: [PATCH] IceCreamDebugger: configureOutput: allow custom lineWrapWidth value Today lineWrapWidth is set to 70, which can be annoying in some situation. This patch exposes lineWrapWidth through the configureOutput method. Usage: ic.configureOutput(lineWrapWidth=42) Signed-off-by: Julien Fortin --- icecream/icecream.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/icecream/icecream.py b/icecream/icecream.py index 435518f..e7bf5ef 100644 --- a/icecream/icecream.py +++ b/icecream/icecream.py @@ -349,7 +349,7 @@ def disable(self): def configureOutput(self, prefix=_absent, outputFunction=_absent, argToStringFunction=_absent, includeContext=_absent, - contextAbsPath=_absent): + contextAbsPath=_absent, lineWrapWidth=_absent): noParameterProvided = all( v is _absent for k,v in locals().items() if k != 'self') if noParameterProvided: @@ -370,5 +370,8 @@ def configureOutput(self, prefix=_absent, outputFunction=_absent, if contextAbsPath is not _absent: self.contextAbsPath = contextAbsPath + if lineWrapWidth is not _absent: + self.lineWrapWidth = lineWrapWidth + ic = IceCreamDebugger()