diff options
author | Alfred Wingate <parona@protonmail.com> | 2023-10-06 03:43:38 +0300 |
---|---|---|
committer | Alfred Wingate <parona@protonmail.com> | 2023-10-06 03:46:00 +0300 |
commit | 8404693138445a5f5e0cd0b385815fd9eeeb7e22 (patch) | |
tree | d3077ffa088531d52bb11a8465cdcd9bd6ea379f | |
parent | pyproject.toml: Add ruff configuration (diff) | |
download | elogv-8404693138445a5f5e0cd0b385815fd9eeeb7e22.tar.gz elogv-8404693138445a5f5e0cd0b385815fd9eeeb7e22.tar.bz2 elogv-8404693138445a5f5e0cd0b385815fd9eeeb7e22.zip |
elogv: Address linter issues
* Remove unused variables.
* Rename l to output_line and wrapped_line to wrapped_lines for clarity.
Signed-off-by: Alfred Wingate <parona@protonmail.com>
-rwxr-xr-x | elogv | 9 |
1 files changed, 4 insertions, 5 deletions
@@ -92,7 +92,7 @@ for category, variable in _LOCALE_CATEGORY_PAIRS: try: locale.getlocale(category) - except ValueError as e: + except ValueError: value = os.environ[variable] if value in reported_bad_locales: continue @@ -569,7 +569,6 @@ class ElogViewer: """ Takes a file-like object and wraps long lines. Returns a list iterator. """ - result = [] self.logf.seek(0) for line in self.logf.readlines(): if not line.strip(): @@ -577,9 +576,9 @@ class ElogViewer: yield "\n" else: # Returns a list of new lines minus the line ending \n - wrapped_line = textwrap.wrap(line, width=self.width - 2) - for l in wrapped_line: - yield l + "\n" + wrapped_lines = textwrap.wrap(line, width=self.width - 2) + for output_line in wrapped_lines: + yield output_line + "\n" def show_log(self): """ |