From 904c77fc299a9ea61089525e2c814a8d24d56f01 Mon Sep 17 00:00:00 2001 From: Siarhei Siniak Date: Thu, 4 Dec 2025 11:29:12 +0300 Subject: [PATCH] [+] update textwrap 1. do as in the source code, either COLUMNS env variable, otherwise 99999 for no wrap, instead of default 80 width; --- python/online/fxreader/pr34/commands_typed/status.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/python/online/fxreader/pr34/commands_typed/status.py b/python/online/fxreader/pr34/commands_typed/status.py index f3043e4..1d136c2 100644 --- a/python/online/fxreader/pr34/commands_typed/status.py +++ b/python/online/fxreader/pr34/commands_typed/status.py @@ -1,4 +1,5 @@ import sys +import os import io import json import subprocess @@ -21,8 +22,8 @@ def run(argv: list[str]): class c1(optparse.IndentedHelpFormatter): def format_option(self, *args: Any, **kwargs: Any) -> Any: - def f1(text: str, width: Optional[int]) -> list[str]: - width = None + def f1(text: str, width: int) -> list[str]: + # width = None return '\n'.join( [ textwrap.fill('\t' + o, width, replace_whitespace=False) @@ -45,7 +46,7 @@ def run(argv: list[str]): parser = optparse.OptionParser( formatter=c1( - width=None, + width=int(os.environ.get('COLUMNS', '9999999')), ), )