public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] proj/elogv:master commit in: /
@ 2020-11-23 10:09 Sebastian Pipping
  0 siblings, 0 replies; 30+ messages in thread
From: Sebastian Pipping @ 2020-11-23 10:09 UTC (permalink / raw
  To: gentoo-commits

commit:     f276f291dfdfb3c6f28814016b103542ccf8c2c7
Author:     Sebastian Pipping <sping <AT> gentoo <DOT> org>
AuthorDate: Mon Nov 23 10:08:57 2020 +0000
Commit:     Sebastian Pipping <sping <AT> gentoo <DOT> org>
CommitDate: Mon Nov 23 10:08:57 2020 +0000
URL:        https://gitweb.gentoo.org/proj/elogv.git/commit/?id=f276f291

Merge branch 'fix-gentoo-bug-756019'

Closes: https://bugs.gentoo.org/756019
Signed-off-by: Sebastian Pipping <sping <AT> gentoo.org>

 ChangeLog | 3 +++
 elogv     | 6 +-----
 setup.py  | 4 ++--
 3 files changed, 6 insertions(+), 7 deletions(-)


^ permalink raw reply	[flat|nested] 30+ messages in thread

* [gentoo-commits] proj/elogv:master commit in: /
@ 2022-01-15 22:00 Sebastian Pipping
  0 siblings, 0 replies; 30+ messages in thread
From: Sebastian Pipping @ 2022-01-15 22:00 UTC (permalink / raw
  To: gentoo-commits

commit:     f055922742ef18f7adfef3b7caa0c908de843539
Author:     Montana Mendy <montana <AT> getprowl <DOT> com>
AuthorDate: Sat Jan 15 00:57:14 2022 +0000
Commit:     Sebastian Pipping <sping <AT> gentoo <DOT> org>
CommitDate: Sat Jan 15 22:00:19 2022 +0000
URL:        https://gitweb.gentoo.org/proj/elogv.git/commit/?id=f0559227

Fixed refactor, alignment, breaks, and readibility.

Signed-off-by: Sebastian Pipping <sping <AT> gentoo.org>

 setup.py | 111 ++++++++++++++++++++++++++++++++++-----------------------------
 1 file changed, 60 insertions(+), 51 deletions(-)

diff --git a/setup.py b/setup.py
index b3a24bd..048b584 100644
--- a/setup.py
+++ b/setup.py
@@ -7,14 +7,14 @@ from distutils.command.build import build as _build
 from distutils.command.install import install as _install
 from distutils.command.clean import clean as _clean
 
-
 import os
 from glob import glob
 
-## Snippet of code found on 
+## Snippet of code found on
 ## http://developer.berlios.de/snippet/detail.php?type=snippet&id=100019
 ## Useful to handle *.po files under distutils
 
+
 class messages(Command):
 
     description = 'Extract messages from source files'
@@ -40,6 +40,7 @@ class messages(Command):
         if self.merge:
             self.run_command('merge')
 
+
 class merge(Command):
     description = 'Merge message catalogs with template'
 
@@ -75,14 +76,14 @@ class merge(Command):
 class build_messages(Command):
 
     description = 'Compile message catalogs'
-    user_options = [('build-dir=', 'd', 'directory to build message catalogs in')]
+    user_options = [('build-dir=', 'd',
+                     'directory to build message catalogs in')]
 
     def initialize_options(self):
         self.build_dir = None
 
     def finalize_options(self):
-        self.set_undefined_options('build',
-                                  ('build_messages', 'build_dir'))
+        self.set_undefined_options('build', ('build_messages', 'build_dir'))
 
     def run(self):
         self.mkpath(self.build_dir)
@@ -96,6 +97,7 @@ class build_messages(Command):
             cmd = 'msgfmt -o "%s" %s' % (out_file, f)
             os.system(cmd)
 
+
 class build(_build):
     # integrate build_message
     def has_messages(self):
@@ -108,20 +110,20 @@ class build(_build):
     def finalize_options(self):
         _build.finalize_options(self)
         if self.build_messages is None:
-            self.build_messages = os.path.join(self.build_base,
-                                               'po')
+            self.build_messages = os.path.join(self.build_base, 'po')
 
-    _build.user_options.append(('build-messages=', None,
-         "build directory for messages"))
+    _build.user_options.append(
+        ('build-messages=', None, "build directory for messages"))
     _build.sub_commands.append(('build_messages', has_messages))
 
+
 class install_messages(Command):
 
     description = 'Installs message catalogs'
 
     user_options = [
         ('install-dir=', 'd', "directory to install scripts to"),
-        ('build-dir=','b', "build directory (where to install from)"),
+        ('build-dir=', 'b', "build directory (where to install from)"),
         ('skip-build', None, "skip the build steps"),
     ]
 
@@ -134,11 +136,12 @@ class install_messages(Command):
 
     def finalize_options(self):
         self.set_undefined_options('build', ('build_messages', 'build_dir'))
-        self.set_undefined_options('install',
-                                   ('install_data', 'install_dir'),
-                                   ('force', 'force'),
-                                   ('skip_build', 'skip_build'),
-                                  )
+        self.set_undefined_options(
+            'install',
+            ('install_data', 'install_dir'),
+            ('force', 'force'),
+            ('skip_build', 'skip_build'),
+        )
         self.install_dir = os.path.join(self.install_dir, 'share', 'locale')
 
     def run(self):
@@ -150,41 +153,40 @@ class install_messages(Command):
             base = os.path.splitext(base)[0]
             out_dir = os.path.join(self.install_dir, base, 'LC_MESSAGES')
             self.mkpath(out_dir)
-            out_file = os.path.join(out_dir, '%s.mo' % self.distribution.get_name())
+            out_file = os.path.join(out_dir,
+                                    '%s.mo' % self.distribution.get_name())
             copy_file(c, out_file)
 
+
 class clean(_clean):
-    _clean.user_options.append(('build-messages=', None,
-                                "build directory for messages (default: 'build.build-messages')"))
+    _clean.user_options.append(
+        ('build-messages=', None,
+         "build directory for messages (default: 'build.build-messages')"))
 
     def initialize_options(self):
         _clean.initialize_options(self)
         self.build_messages = None
 
     def finalize_options(self):
-        self.set_undefined_options('build',
-                                   ('build_base', 'build_base'),
+        self.set_undefined_options('build', ('build_base', 'build_base'),
                                    ('build_lib', 'build_lib'),
                                    ('build_scripts', 'build_scripts'),
                                    ('build_temp', 'build_temp'),
                                    ('build_messages', 'build_messages'))
-        self.set_undefined_options('bdist',
-                                   ('bdist_base', 'bdist_base'))
+        self.set_undefined_options('bdist', ('bdist_base', 'bdist_base'))
+
     def run(self):
         # remove the build/temp.<plat> directory (unless it's already
         # gone)
         if os.path.exists(self.build_temp):
             remove_tree(self.build_temp, dry_run=self.dry_run)
         else:
-            log.debug("'%s' does not exist -- can't clean it",
-                      self.build_temp)
+            log.debug("'%s' does not exist -- can't clean it", self.build_temp)
 
         if self.all:
             # remove build directories
-            for directory in (self.build_lib,
-                              self.bdist_base,
-                              self.build_scripts,
-                              self.build_messages):
+            for directory in (self.build_lib, self.bdist_base,
+                              self.build_scripts, self.build_messages):
                 if os.path.exists(directory):
                     remove_tree(directory, dry_run=self.dry_run)
                 else:
@@ -200,6 +202,7 @@ class clean(_clean):
             except OSError:
                 pass
 
+
 ## Class modified to add manpages command
 class install(_install):
     def has_messages(self):
@@ -207,42 +210,47 @@ class install(_install):
 
     def has_manpages(self):
         return True
-        
+
     _install.sub_commands.append(('install_messages', has_messages))
-    _install.sub_commands.append(('install_manpages', has_manpages))  
+    _install.sub_commands.append(('install_manpages', has_manpages))
+
 
 ### End of snippet ###
 
+
 class install_manpages(Command):
 
     description = "Install man pages"
-    
+
     user_options = []
-    
+
     def initialize_options(self):
         self.man_pages = man_pages
         self.install_dir = None
         self.root = None
-    
+
     def finalize_options(self):
-        self.set_undefined_options('install',
-                                   ('install_data', 'install_dir'),
-                                   ('root', 'root'),
-                                  )
+        self.set_undefined_options(
+            'install',
+            ('install_data', 'install_dir'),
+            ('root', 'root'),
+        )
+
     def run(self):
         for f in self.man_pages:
             attrs = f.split(".")
-            dest = os.path.join(self.install_dir,"share","man")
+            dest = os.path.join(self.install_dir, "share", "man")
             try:
-                dest = os.path.join(dest,attrs[2])
+                dest = os.path.join(dest, attrs[2])
             except IndexError:
                 pass
-            dest = os.path.join(dest,"man" + attrs[1])
+            dest = os.path.join(dest, "man" + attrs[1])
             self.mkpath(dest)
             self.copy_file(f, dest)
 
-man_pages=glob("man/*")
-      
+
+man_pages = glob("man/*")
+
 setup(name="elogv",
       version="0.7.9",
       author="Luca Marturana",
@@ -251,12 +259,13 @@ setup(name="elogv",
       description="Curses based utility to view elogs created by Portage",
       url="https://gitweb.gentoo.org/proj/elogv.git/",
       scripts=['elogv'],
-      cmdclass={'extract_messages': messages,
-                'merge': merge,
-                'build_messages': build_messages,
-                'build': build,
-                'install_messages': install_messages,
-                'install_manpages': install_manpages,
-                'install': install,
-                'clean': clean}
-)
+      cmdclass={
+          'extract_messages': messages,
+          'merge': merge,
+          'build_messages': build_messages,
+          'build': build,
+          'install_messages': install_messages,
+          'install_manpages': install_manpages,
+          'install': install,
+          'clean': clean
+      })


^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [gentoo-commits] proj/elogv:master commit in: /
@ 2023-07-08 14:19 Sebastian Pipping
  0 siblings, 0 replies; 30+ messages in thread
From: Sebastian Pipping @ 2023-07-08 14:19 UTC (permalink / raw
  To: gentoo-commits

commit:     f5b729fbc92b1d9940b2dd9f6bbe6042f0032f7d
Author:     Sebastian Pipping <sping <AT> gentoo <DOT> org>
AuthorDate: Sat Jul  8 14:16:51 2023 +0000
Commit:     Sebastian Pipping <sping <AT> gentoo <DOT> org>
CommitDate: Sat Jul  8 14:16:51 2023 +0000
URL:        https://gitweb.gentoo.org/proj/elogv.git/commit/?id=f5b729fb

setup.py: Specify packages=[] to fix the build

Error was:
> [..] Multiple top-level packages discovered in a flat-layout [..]

Signed-off-by: Sebastian Pipping <sping <AT> gentoo.org>

 setup.py | 1 +
 1 file changed, 1 insertion(+)

diff --git a/setup.py b/setup.py
index 048b584..e832772 100644
--- a/setup.py
+++ b/setup.py
@@ -258,6 +258,7 @@ setup(name="elogv",
       license="GPL-2",
       description="Curses based utility to view elogs created by Portage",
       url="https://gitweb.gentoo.org/proj/elogv.git/",
+      packages=[],
       scripts=['elogv'],
       cmdclass={
           'extract_messages': messages,


^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [gentoo-commits] proj/elogv:master commit in: /
@ 2023-07-08 14:23 Sebastian Pipping
  0 siblings, 0 replies; 30+ messages in thread
From: Sebastian Pipping @ 2023-07-08 14:23 UTC (permalink / raw
  To: gentoo-commits

commit:     30987a47256464ec0abe29e9f88fdbaabd2d8351
Author:     Sebastian Pipping <sping <AT> gentoo <DOT> org>
AuthorDate: Sat Jul  8 14:22:04 2023 +0000
Commit:     Sebastian Pipping <sping <AT> gentoo <DOT> org>
CommitDate: Sat Jul  8 14:22:04 2023 +0000
URL:        https://gitweb.gentoo.org/proj/elogv.git/commit/?id=30987a47

Release 0.8.0

Signed-off-by: Sebastian Pipping <sping <AT> gentoo.org>

 ChangeLog | 3 +++
 setup.py  | 2 +-
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog
index 17bbb0d..512c4c5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 # ChangeLog for elogv
 
+0.8.0
+  * Set "packages=[]" in setup.py to fix the build
+
 0.7.9
   * Address deprecation warnings for Python >=3.8 (Gentoo bug #756019)
 

diff --git a/setup.py b/setup.py
index e832772..4aca7e6 100644
--- a/setup.py
+++ b/setup.py
@@ -252,7 +252,7 @@ class install_manpages(Command):
 man_pages = glob("man/*")
 
 setup(name="elogv",
-      version="0.7.9",
+      version="0.8.0",
       author="Luca Marturana",
       author_email="lucamarturana@gmail.com",
       license="GPL-2",


^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [gentoo-commits] proj/elogv:master commit in: /
@ 2023-10-05 14:55 Sebastian Pipping
  0 siblings, 0 replies; 30+ messages in thread
From: Sebastian Pipping @ 2023-10-05 14:55 UTC (permalink / raw
  To: gentoo-commits

commit:     e633480ad9b72fdca50f08c6ef9283147ded8f7d
Author:     Alfred Wingate <parona <AT> protonmail <DOT> com>
AuthorDate: Thu Oct  5 04:30:10 2023 +0000
Commit:     Sebastian Pipping <sping <AT> gentoo <DOT> org>
CommitDate: Thu Oct  5 14:35:55 2023 +0000
URL:        https://gitweb.gentoo.org/proj/elogv.git/commit/?id=e633480a

pyproject.toml: add dependencies

Signed-off-by: Alfred Wingate <parona <AT> protonmail.com>

 pyproject.toml | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/pyproject.toml b/pyproject.toml
index 09f77b9..15e7ca1 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -10,6 +10,10 @@ authors = [
 ]
 license = {text = "GPL-2"}
 description = "Curses based utility to view elogs created by Portage"
+dependencies = ["portage"]
 
 [project.urls]
 homepage = "https://gitweb.gentoo.org/proj/elogv.git/"
+
+[project.optional-dependencies]
+lzma = [ "pyliblzma" ]


^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [gentoo-commits] proj/elogv:master commit in: /
@ 2023-10-05 14:55 Sebastian Pipping
  0 siblings, 0 replies; 30+ messages in thread
From: Sebastian Pipping @ 2023-10-05 14:55 UTC (permalink / raw
  To: gentoo-commits

commit:     8234247d0d228d2311a2cb3cc9c710ca828bc759
Author:     Alfred Wingate <parona <AT> protonmail <DOT> com>
AuthorDate: Thu Oct  5 04:23:14 2023 +0000
Commit:     Sebastian Pipping <sping <AT> gentoo <DOT> org>
CommitDate: Thu Oct  5 14:35:33 2023 +0000
URL:        https://gitweb.gentoo.org/proj/elogv.git/commit/?id=8234247d

Move metadata from setup.py to pyproject.toml

Signed-off-by: Alfred Wingate <parona <AT> protonmail.com>

 pyproject.toml | 12 ++++++++++++
 setup.py       |  9 +--------
 2 files changed, 13 insertions(+), 8 deletions(-)

diff --git a/pyproject.toml b/pyproject.toml
index fed528d..09f77b9 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,3 +1,15 @@
 [build-system]
 requires = ["setuptools"]
 build-backend = "setuptools.build_meta"
+
+[project]
+name = "elogv"
+version = "0.8.0"
+authors = [
+    {name = "Luca Marturana", email = "lucamarturana@gmail.com"},
+]
+license = {text = "GPL-2"}
+description = "Curses based utility to view elogs created by Portage"
+
+[project.urls]
+homepage = "https://gitweb.gentoo.org/proj/elogv.git/"

diff --git a/setup.py b/setup.py
index 682254f..631a6c7 100644
--- a/setup.py
+++ b/setup.py
@@ -204,14 +204,7 @@ class install_manpages(Command):
 
 man_pages = glob("man/*")
 
-setup(name="elogv",
-      version="0.8.0",
-      author="Luca Marturana",
-      author_email="lucamarturana@gmail.com",
-      license="GPL-2",
-      description="Curses based utility to view elogs created by Portage",
-      url="https://gitweb.gentoo.org/proj/elogv.git/",
-      packages=[],
+setup(packages=[],
       scripts=['elogv'],
       cmdclass={
           'extract_messages': messages,


^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [gentoo-commits] proj/elogv:master commit in: /
@ 2023-10-05 14:55 Sebastian Pipping
  0 siblings, 0 replies; 30+ messages in thread
From: Sebastian Pipping @ 2023-10-05 14:55 UTC (permalink / raw
  To: gentoo-commits

commit:     657162990e7e0765486101fa2924274bb2925564
Author:     Sebastian Pipping <sping <AT> gentoo <DOT> org>
AuthorDate: Thu Oct  5 14:53:59 2023 +0000
Commit:     Sebastian Pipping <sping <AT> gentoo <DOT> org>
CommitDate: Thu Oct  5 14:54:51 2023 +0000
URL:        https://gitweb.gentoo.org/proj/elogv.git/commit/?id=65716299

Merge branch 'pull-14-parona-source-setuptools-3'

Signed-off-by: Sebastian Pipping <sping <AT> gentoo.org>

 pyproject.toml | 19 ++++++++++++++
 setup.py       | 79 +++++++++-------------------------------------------------
 2 files changed, 31 insertions(+), 67 deletions(-)


^ permalink raw reply	[flat|nested] 30+ messages in thread

* [gentoo-commits] proj/elogv:master commit in: /
@ 2023-10-05 15:00 Sebastian Pipping
  0 siblings, 0 replies; 30+ messages in thread
From: Sebastian Pipping @ 2023-10-05 15:00 UTC (permalink / raw
  To: gentoo-commits

commit:     3d44154e3e24205de91ccf90f0124c7c6f167d7b
Author:     Sebastian Pipping <sping <AT> gentoo <DOT> org>
AuthorDate: Thu Oct  5 14:58:43 2023 +0000
Commit:     Sebastian Pipping <sping <AT> gentoo <DOT> org>
CommitDate: Thu Oct  5 15:00:47 2023 +0000
URL:        https://gitweb.gentoo.org/proj/elogv.git/commit/?id=3d44154e

Release 0.8.1

Signed-off-by: Sebastian Pipping <sping <AT> gentoo.org>

 ChangeLog      | 3 +++
 pyproject.toml | 2 +-
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog
index 512c4c5..3a230f2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 # ChangeLog for elogv
 
+0.8.1
+  * Port to setuptools and PEP517 (Gentoo bug #841134)
+
 0.8.0
   * Set "packages=[]" in setup.py to fix the build
 

diff --git a/pyproject.toml b/pyproject.toml
index 15e7ca1..88ad65f 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
 
 [project]
 name = "elogv"
-version = "0.8.0"
+version = "0.8.1"
 authors = [
     {name = "Luca Marturana", email = "lucamarturana@gmail.com"},
 ]


^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [gentoo-commits] proj/elogv:master commit in: /
@ 2023-10-05 17:41 Sebastian Pipping
  0 siblings, 0 replies; 30+ messages in thread
From: Sebastian Pipping @ 2023-10-05 17:41 UTC (permalink / raw
  To: gentoo-commits

commit:     04b6fdbf29c6643a3c72d35091dc28a56b5defc6
Author:     Sebastian Pipping <sping <AT> gentoo <DOT> org>
AuthorDate: Thu Oct  5 17:40:09 2023 +0000
Commit:     Sebastian Pipping <sping <AT> gentoo <DOT> org>
CommitDate: Thu Oct  5 17:40:12 2023 +0000
URL:        https://gitweb.gentoo.org/proj/elogv.git/commit/?id=04b6fdbf

Merge branch 'pull-15-parona-source-lzma'

Signed-off-by: Sebastian Pipping <sping <AT> gentoo.org>

 elogv          | 32 ++++++++++++++------------------
 pyproject.toml |  3 ---
 2 files changed, 14 insertions(+), 21 deletions(-)


^ permalink raw reply	[flat|nested] 30+ messages in thread

* [gentoo-commits] proj/elogv:master commit in: /
@ 2023-10-05 17:41 Sebastian Pipping
  0 siblings, 0 replies; 30+ messages in thread
From: Sebastian Pipping @ 2023-10-05 17:41 UTC (permalink / raw
  To: gentoo-commits

commit:     1d95e751bd8d0628f1b83ca667cc1d4cd18066a1
Author:     Alfred Wingate <parona <AT> protonmail <DOT> com>
AuthorDate: Thu Oct  5 16:56:45 2023 +0000
Commit:     Sebastian Pipping <sping <AT> gentoo <DOT> org>
CommitDate: Thu Oct  5 17:26:34 2023 +0000
URL:        https://gitweb.gentoo.org/proj/elogv.git/commit/?id=1d95e751

Port to lzma

Signed-off-by: Alfred Wingate <parona <AT> protonmail.com>

 elogv          | 12 ++----------
 pyproject.toml |  3 ---
 2 files changed, 2 insertions(+), 13 deletions(-)

diff --git a/elogv b/elogv
index b3455c7..94d466a 100755
--- a/elogv
+++ b/elogv
@@ -33,6 +33,7 @@ import gettext
 import locale
 import gzip
 import bz2
+import lzma
 import signal
 
 _LOCALE_CATEGORY_PAIRS = (
@@ -46,12 +47,6 @@ _LOCALE_CATEGORY_PAIRS = (
 		(locale.LC_ALL, 'LC_ALL'),
 )
 
-no_liblzma = False
-try:
-    import liblzma
-except ImportError:
-    no_liblzma = True
-
 
 def report_bad_locale(variable, value):
     py_version = '%s.%s.%s' % sys.version_info[:3]
@@ -421,10 +416,7 @@ class ElogViewer:
     @staticmethod
     def open(file, mode='rt'):
         if file.endswith('.xz'):
-            if not no_liblzma:
-                return liblzma.LZMAFile(file)
-            else:
-                sys.exit('You need pyliblzma library to be able to read xz compressed elog files.\nhttp://pypi.python.org/pypi/pyliblzma')
+            return lzma.open(file, mode=mode)
         elif file.endswith('.gz'):
             return gzip.open(file, mode=mode)
         elif file.endswith('.bz2'):

diff --git a/pyproject.toml b/pyproject.toml
index 88ad65f..0476844 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -14,6 +14,3 @@ dependencies = ["portage"]
 
 [project.urls]
 homepage = "https://gitweb.gentoo.org/proj/elogv.git/"
-
-[project.optional-dependencies]
-lzma = [ "pyliblzma" ]


^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [gentoo-commits] proj/elogv:master commit in: /
@ 2023-10-05 17:41 Sebastian Pipping
  0 siblings, 0 replies; 30+ messages in thread
From: Sebastian Pipping @ 2023-10-05 17:41 UTC (permalink / raw
  To: gentoo-commits

commit:     af4f13a47320e30d45150b5c22eea28104573e09
Author:     Alfred Wingate <parona <AT> protonmail <DOT> com>
AuthorDate: Thu Oct  5 16:51:18 2023 +0000
Commit:     Sebastian Pipping <sping <AT> gentoo <DOT> org>
CommitDate: Thu Oct  5 17:24:46 2023 +0000
URL:        https://gitweb.gentoo.org/proj/elogv.git/commit/?id=af4f13a4

Open files with same function to allow decompression to work seamlessly

* liblzma left mostly untouched, next commit will port it to lzma.
* BZ2File -> open to allow plaintext reading, which is expected
  elsewhere in elogv.

Signed-off-by: Alfred Wingate <parona <AT> protonmail.com>

 elogv | 22 +++++++++++++---------
 1 file changed, 13 insertions(+), 9 deletions(-)

diff --git a/elogv b/elogv
index 7e1e37f..b3455c7 100755
--- a/elogv
+++ b/elogv
@@ -418,18 +418,22 @@ class ElogViewer:
         self.logf_wrap = self.wrap_logf_lines()
         self.show_log()
 
-    def openfile(self, myfile):
-        if myfile.endswith('.xz'):
+    @staticmethod
+    def open(file, mode='rt'):
+        if file.endswith('.xz'):
             if not no_liblzma:
-                self.logf = liblzma.LZMAFile(myfile)
+                return liblzma.LZMAFile(file)
             else:
                 sys.exit('You need pyliblzma library to be able to read xz compressed elog files.\nhttp://pypi.python.org/pypi/pyliblzma')
-        elif myfile.endswith('.gz'):
-            self.logf = gzip.open(myfile)
-        elif myfile.endswith('.bz2'):
-            self.logf = bz2.BZ2File(myfile)
+        elif file.endswith('.gz'):
+            return gzip.open(file, mode=mode)
+        elif file.endswith('.bz2'):
+            return bz2.open(file, mode=mode)
         else:
-            self.logf = open(myfile)
+            return open(file, mode=mode)
+
+    def openfile(self, file):
+        self.logf = self.open(file)
 
     def refresh_file_pad(self):
         """
@@ -528,7 +532,7 @@ class ElogViewer:
         """
         Get the highest elog class in a file
         """
-        with open(filepath) as f:
+        with self.open(filepath) as f:
             classes = re.findall("LOG:|INFO:|WARN:|ERROR:", f.read())
 
         if "ERROR:" in classes:


^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [gentoo-commits] proj/elogv:master commit in: /
@ 2023-10-05 18:39 Sebastian Pipping
  0 siblings, 0 replies; 30+ messages in thread
From: Sebastian Pipping @ 2023-10-05 18:39 UTC (permalink / raw
  To: gentoo-commits

commit:     0891d79c221edbf4e0d164f518ccaa8808a16eea
Author:     Sebastian Pipping <sping <AT> gentoo <DOT> org>
AuthorDate: Thu Oct  5 18:39:07 2023 +0000
Commit:     Sebastian Pipping <sping <AT> gentoo <DOT> org>
CommitDate: Thu Oct  5 18:39:07 2023 +0000
URL:        https://gitweb.gentoo.org/proj/elogv.git/commit/?id=0891d79c

Release 0.8.2

Signed-off-by: Sebastian Pipping <sping <AT> gentoo.org>

 ChangeLog      | 3 +++
 pyproject.toml | 2 +-
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog
index 3a230f2..8735658 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 # ChangeLog for elogv
 
+0.8.2
+  * Fix decompression and port to standard library lzma
+
 0.8.1
   * Port to setuptools and PEP517 (Gentoo bug #841134)
 

diff --git a/pyproject.toml b/pyproject.toml
index 0476844..2edc922 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
 
 [project]
 name = "elogv"
-version = "0.8.1"
+version = "0.8.2"
 authors = [
     {name = "Luca Marturana", email = "lucamarturana@gmail.com"},
 ]


^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [gentoo-commits] proj/elogv:master commit in: /
@ 2023-10-06 12:34 Sebastian Pipping
  0 siblings, 0 replies; 30+ messages in thread
From: Sebastian Pipping @ 2023-10-06 12:34 UTC (permalink / raw
  To: gentoo-commits

commit:     c7e5540703846d21e82b67e0e08ed5c1bb2e14a6
Author:     Alfred Wingate <parona <AT> protonmail <DOT> com>
AuthorDate: Fri Oct  6 00:25:53 2023 +0000
Commit:     Sebastian Pipping <sping <AT> gentoo <DOT> org>
CommitDate: Fri Oct  6 00:27:38 2023 +0000
URL:        https://gitweb.gentoo.org/proj/elogv.git/commit/?id=c7e55407

pyproject.toml: Add ruff configuration

Signed-off-by: Alfred Wingate <parona <AT> protonmail.com>

 pyproject.toml | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/pyproject.toml b/pyproject.toml
index 755d294..25bc44c 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -22,3 +22,8 @@ extend_exclude = "(man|po|.*.egg-info)"
 [tool.isort]
 profile = "black"
 src_paths = ["elogv"]
+
+[tool.ruff]
+include = ["elogv", "setup.py"]
+# Ignore long line violations
+ignore = ["E501"]


^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [gentoo-commits] proj/elogv:master commit in: /
@ 2023-10-06 12:34 Sebastian Pipping
  0 siblings, 0 replies; 30+ messages in thread
From: Sebastian Pipping @ 2023-10-06 12:34 UTC (permalink / raw
  To: gentoo-commits

commit:     6528fb75b639ae1d50eb9580b80aa48e0a449927
Author:     Alfred Wingate <parona <AT> protonmail <DOT> com>
AuthorDate: Thu Oct  5 23:46:55 2023 +0000
Commit:     Sebastian Pipping <sping <AT> gentoo <DOT> org>
CommitDate: Thu Oct  5 23:46:55 2023 +0000
URL:        https://gitweb.gentoo.org/proj/elogv.git/commit/?id=6528fb75

pyproject.toml: Add isort configuration

Signed-off-by: Alfred Wingate <parona <AT> protonmail.com>

 pyproject.toml | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/pyproject.toml b/pyproject.toml
index 89d35e5..755d294 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -18,3 +18,7 @@ homepage = "https://gitweb.gentoo.org/proj/elogv.git/"
 [tool.black]
 include = "(elogv|setup.py)"
 extend_exclude = "(man|po|.*.egg-info)"
+
+[tool.isort]
+profile = "black"
+src_paths = ["elogv"]


^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [gentoo-commits] proj/elogv:master commit in: /
@ 2023-10-06 12:34 Sebastian Pipping
  0 siblings, 0 replies; 30+ messages in thread
From: Sebastian Pipping @ 2023-10-06 12:34 UTC (permalink / raw
  To: gentoo-commits

commit:     a0285263e52366d7f3b9d319cf9c20dc3e2a99a3
Author:     Alfred Wingate <parona <AT> protonmail <DOT> com>
AuthorDate: Thu Oct  5 23:04:24 2023 +0000
Commit:     Sebastian Pipping <sping <AT> gentoo <DOT> org>
CommitDate: Thu Oct  5 23:04:24 2023 +0000
URL:        https://gitweb.gentoo.org/proj/elogv.git/commit/?id=a0285263

pyproject.toml: Add black configuration

Signed-off-by: Alfred Wingate <parona <AT> protonmail.com>

 pyproject.toml | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/pyproject.toml b/pyproject.toml
index 2edc922..89d35e5 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -14,3 +14,7 @@ dependencies = ["portage"]
 
 [project.urls]
 homepage = "https://gitweb.gentoo.org/proj/elogv.git/"
+
+[tool.black]
+include = "(elogv|setup.py)"
+extend_exclude = "(man|po|.*.egg-info)"


^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [gentoo-commits] proj/elogv:master commit in: /
@ 2023-10-06 12:34 Sebastian Pipping
  0 siblings, 0 replies; 30+ messages in thread
From: Sebastian Pipping @ 2023-10-06 12:34 UTC (permalink / raw
  To: gentoo-commits

commit:     8404693138445a5f5e0cd0b385815fd9eeeb7e22
Author:     Alfred Wingate <parona <AT> protonmail <DOT> com>
AuthorDate: Fri Oct  6 00:43:38 2023 +0000
Commit:     Sebastian Pipping <sping <AT> gentoo <DOT> org>
CommitDate: Fri Oct  6 00:46:00 2023 +0000
URL:        https://gitweb.gentoo.org/proj/elogv.git/commit/?id=84046931

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 <AT> protonmail.com>

 elogv | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/elogv b/elogv
index eb3a2d2..70346e9 100755
--- a/elogv
+++ b/elogv
@@ -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):
         """


^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [gentoo-commits] proj/elogv:master commit in: /
@ 2023-10-06 12:34 Sebastian Pipping
  0 siblings, 0 replies; 30+ messages in thread
From: Sebastian Pipping @ 2023-10-06 12:34 UTC (permalink / raw
  To: gentoo-commits

commit:     c08fea8ad853d1508b412f06dd9636273912f1c1
Author:     Alfred Wingate <parona <AT> protonmail <DOT> com>
AuthorDate: Thu Oct  5 23:47:18 2023 +0000
Commit:     Sebastian Pipping <sping <AT> gentoo <DOT> org>
CommitDate: Thu Oct  5 23:47:18 2023 +0000
URL:        https://gitweb.gentoo.org/proj/elogv.git/commit/?id=c08fea8a

Reformat with isort

Signed-off-by: Alfred Wingate <parona <AT> protonmail.com>

 elogv    | 19 ++++++++++---------
 setup.py | 10 ++++------
 2 files changed, 14 insertions(+), 15 deletions(-)

diff --git a/elogv b/elogv
index 4b4f85f..eb3a2d2 100755
--- a/elogv
+++ b/elogv
@@ -20,21 +20,22 @@
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 
-import os
-import sys
-import re
-from datetime import datetime
+import bz2
 import curses
 import curses.ascii
-import textwrap
-from portage import settings as port_settings
-from glob import glob
 import gettext
-import locale
 import gzip
-import bz2
+import locale
 import lzma
+import os
+import re
 import signal
+import sys
+import textwrap
+from datetime import datetime
+from glob import glob
+
+from portage import settings as port_settings
 
 _LOCALE_CATEGORY_PAIRS = (
     (locale.LC_COLLATE, "LC_COLLATE"),

diff --git a/setup.py b/setup.py
index d182056..c499edb 100644
--- a/setup.py
+++ b/setup.py
@@ -1,13 +1,11 @@
-from setuptools import setup
-from setuptools import Command
-from setuptools.command.build import build as _build
-from setuptools.command.install import install as _install
-
 import logging
-
 import os
 from glob import glob
 
+from setuptools import Command, setup
+from setuptools.command.build import build as _build
+from setuptools.command.install import install as _install
+
 ## Snippet of code found on
 ## http://developer.berlios.de/snippet/detail.php?type=snippet&id=100019
 ## Useful to handle *.po files under distutils


^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [gentoo-commits] proj/elogv:master commit in: /
@ 2023-10-06 12:34 Sebastian Pipping
  0 siblings, 0 replies; 30+ messages in thread
From: Sebastian Pipping @ 2023-10-06 12:34 UTC (permalink / raw
  To: gentoo-commits

commit:     e53f8a8bb67bf5ab70e0a2b78eec55a6212ad80f
Author:     Sebastian Pipping <sping <AT> gentoo <DOT> org>
AuthorDate: Fri Oct  6 12:32:52 2023 +0000
Commit:     Sebastian Pipping <sping <AT> gentoo <DOT> org>
CommitDate: Fri Oct  6 12:32:56 2023 +0000
URL:        https://gitweb.gentoo.org/proj/elogv.git/commit/?id=e53f8a8b

Merge branch 'pull-16-parona-source-black'

Signed-off-by: Sebastian Pipping <sping <AT> gentoo.org>

 .git-blame-ignore-revs |   4 +
 elogv                  | 291 ++++++++++++++++++++++++++++---------------------
 pyproject.toml         |  13 +++
 setup.py               | 132 +++++++++++-----------
 4 files changed, 249 insertions(+), 191 deletions(-)


^ permalink raw reply	[flat|nested] 30+ messages in thread

* [gentoo-commits] proj/elogv:master commit in: /
@ 2023-10-06 12:34 Sebastian Pipping
  0 siblings, 0 replies; 30+ messages in thread
From: Sebastian Pipping @ 2023-10-06 12:34 UTC (permalink / raw
  To: gentoo-commits

commit:     0783e2f473110526a390349c11146a7a3319523e
Author:     Alfred Wingate <parona <AT> protonmail <DOT> com>
AuthorDate: Fri Oct  6 00:55:30 2023 +0000
Commit:     Sebastian Pipping <sping <AT> gentoo <DOT> org>
CommitDate: Fri Oct  6 00:55:30 2023 +0000
URL:        https://gitweb.gentoo.org/proj/elogv.git/commit/?id=0783e2f4

.git-blame-ignore-revs: Ignore reformat commits in blame

Signed-off-by: Alfred Wingate <parona <AT> protonmail.com>

 .git-blame-ignore-revs | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs
new file mode 100644
index 0000000..b72aa08
--- /dev/null
+++ b/.git-blame-ignore-revs
@@ -0,0 +1,4 @@
+# Reformat project with black
+cf01cb49e14730c2323da4ef9f8093935ef93fb9
+# Reformat project with isort
+c08fea8ad853d1508b412f06dd9636273912f1c1


^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [gentoo-commits] proj/elogv:master commit in: /
@ 2023-10-06 12:34 Sebastian Pipping
  0 siblings, 0 replies; 30+ messages in thread
From: Sebastian Pipping @ 2023-10-06 12:34 UTC (permalink / raw
  To: gentoo-commits

commit:     cf01cb49e14730c2323da4ef9f8093935ef93fb9
Author:     Alfred Wingate <parona <AT> protonmail <DOT> com>
AuthorDate: Thu Oct  5 23:04:53 2023 +0000
Commit:     Sebastian Pipping <sping <AT> gentoo <DOT> org>
CommitDate: Thu Oct  5 23:04:53 2023 +0000
URL:        https://gitweb.gentoo.org/proj/elogv.git/commit/?id=cf01cb49

Reformat with black

Signed-off-by: Alfred Wingate <parona <AT> protonmail.com>

 elogv    | 265 +++++++++++++++++++++++++++++++++++++--------------------------
 setup.py | 122 +++++++++++++++--------------
 2 files changed, 215 insertions(+), 172 deletions(-)

diff --git a/elogv b/elogv
index 94d466a..4b4f85f 100755
--- a/elogv
+++ b/elogv
@@ -37,31 +37,39 @@ import lzma
 import signal
 
 _LOCALE_CATEGORY_PAIRS = (
-		(locale.LC_COLLATE, 'LC_COLLATE'),
-		(locale.LC_CTYPE, 'LC_CTYPE'),
-		(locale.LC_MESSAGES, 'LC_MESSAGES'),
-		(locale.LC_MONETARY, 'LC_MONETARY'),
-		(locale.LC_NUMERIC, 'LC_NUMERIC'),
-		(locale.LC_TIME, 'LC_TIME'),
-
-		(locale.LC_ALL, 'LC_ALL'),
+    (locale.LC_COLLATE, "LC_COLLATE"),
+    (locale.LC_CTYPE, "LC_CTYPE"),
+    (locale.LC_MESSAGES, "LC_MESSAGES"),
+    (locale.LC_MONETARY, "LC_MONETARY"),
+    (locale.LC_NUMERIC, "LC_NUMERIC"),
+    (locale.LC_TIME, "LC_TIME"),
+    (locale.LC_ALL, "LC_ALL"),
 )
 
 
 def report_bad_locale(variable, value):
-    py_version = '%s.%s.%s' % sys.version_info[:3]
+    py_version = "%s.%s.%s" % sys.version_info[:3]
     print('ERROR: Locale "%s" does not seem to be supported.' % value, file=sys.stderr)
     if value not in locale.locale_alias:
-        print('  Note: Locale "%s" is not a known alias to Python %s (check locale.locale_alias).' % (value, py_version), file=sys.stderr)
-    if not ('.' in value or '@' in value):
-        print('  Hint: Try specifying the encoding (e.g. %s=%s.UTF-8).' % (variable, value), file=sys.stderr)
+        print(
+            '  Note: Locale "%s" is not a known alias to Python %s (check locale.locale_alias).'
+            % (value, py_version),
+            file=sys.stderr,
+        )
+    if not ("." in value or "@" in value):
+        print(
+            "  Hint: Try specifying the encoding (e.g. %s=%s.UTF-8)."
+            % (variable, value),
+            file=sys.stderr,
+        )
+
 
 reported_bad_locales = set()
 
 
 # Enable support for user locale
 try:
-    locale.setlocale(locale.LC_ALL, '')
+    locale.setlocale(locale.LC_ALL, "")
 except locale.Error:
     # Find guilty value and variable
     for category, variable in _LOCALE_CATEGORY_PAIRS:
@@ -95,11 +103,12 @@ if reported_bad_locales:
 
 
 # Setup gettext.
-gettext.textdomain('elogv')
+gettext.textdomain("elogv")
 _ = gettext.gettext
 
 # This text is used on the in-line help
-helptext = _("""
+helptext = _(
+    """
 Elogv is a portage elog viewer based on curses and python,
 you can use these keys to control the behavior of the program:
 
@@ -127,7 +136,8 @@ you can use these keys to control the behavior of the program:
  - / -> starts a search prompt, write a string and will be showed the next
         package that contains your string, use ESC to exit
  - q -> quit
-""")
+"""
+)
 
 (normal, selected, einfo, elog, ewarn, eerror) = range(6)
 (PATH, CAT, PN, DATE, CLASS) = range(5)
@@ -137,6 +147,7 @@ class_char = "*"
 list_format = "%s/%s - %s"
 date_format = "%x"
 
+
 # Exceptions classes
 class TermTooSmall(Exception):
     """Terminal too small."""
@@ -165,11 +176,11 @@ def date2str(d):
     b = d.strftime(date_format)
 
     for encoding in (
-            locale.getlocale(locale.LC_TIME)[1],
-            locale.getlocale()[1],
-            sys.getdefaultencoding(),
-            'utf-8',
-            ):
+        locale.getlocale(locale.LC_TIME)[1],
+        locale.getlocale()[1],
+        sys.getdefaultencoding(),
+        "utf-8",
+    ):
         if encoding is None:
             continue
 
@@ -182,24 +193,25 @@ def date2str(d):
         except UnicodeDecodeError:
             pass
     else:
-        raise ValueError('Cannot decode byte stream')
+        raise ValueError("Cannot decode byte stream")
 
     try:
         if not isinstance(b, str):
-            b = u.encode('ascii')
+            b = u.encode("ascii")
         else:
             b = u
     except UnicodeEncodeError:
         # Prevent crash locales like ja_JP.UTF-8, e.g. "2014年10月24日"
         # https://bugs.gentoo.org/show_bug.cgi?id=464962
-        b = u.encode('ascii', errors='replace')
+        b = u.encode("ascii", errors="replace")
 
     return b
 
+
 # Main class (called with curses.wrapper later)
 class ElogViewer:
     def __init__(self, screen):
-        #curses.curs_set(0)
+        # curses.curs_set(0)
         self.screen = screen
 
         # Our color pairs
@@ -214,20 +226,20 @@ class ElogViewer:
             pass
 
         # This attributes are used to manage the scrolling of the list
-        # of files    
+        # of files
         self.pposy = 0
         self.usel = 0
 
         # Method used to order the list: use DATE for order by date, CAT to
         # order by category name, PN to order by package name, CLASS to order
         # by class second value set if the list should be reversed (True o False)
-        self.sort_method = [ DATE, False]
+        self.sort_method = [DATE, False]
 
         # Initialize screen
         self.init_screen()
 
         c = self.screen.getch()
-        while c not in ( ord("q"), curses.ascii.ESC):
+        while c not in (ord("q"), curses.ascii.ESC):
             ## Scrolling keys ##
             if c in (curses.KEY_DOWN, ord("j")):
                 self.change_usel(1)
@@ -237,12 +249,12 @@ class ElogViewer:
 
             elif c in (curses.KEY_NPAGE, ord("f")):
                 self.change_usel(10)
-                
+
             elif c in (curses.KEY_PPAGE, ord("b")):
                 self.change_usel(-10)
 
             elif c in (curses.KEY_END, ord("G")):
-                self.change_usel(len(self.packages)-1, False)
+                self.change_usel(len(self.packages) - 1, False)
 
             elif c in (curses.KEY_HOME, ord("g")):
                 self.change_usel(0, False)
@@ -317,12 +329,12 @@ class ElogViewer:
 
             elif c == ord("/"):
                 word = ""
-                self.screen.move(self.height-1,2)
+                self.screen.move(self.height - 1, 2)
                 self.screen.addstr("/")
                 subc = self.screen.getch()
                 while subc != curses.ascii.ESC:
                     if subc == ord("\n"):
-                        self.search(word,1)
+                        self.search(word, 1)
                     elif subc == curses.ascii.BS:
                         word = word[:-1]
                         self.screen.delch()
@@ -330,10 +342,10 @@ class ElogViewer:
                     elif curses.ascii.isalpha(subc):
                         word += chr(subc)
                         self.screen.addstr(chr(subc))
-                        self.search(word)  
+                        self.search(word)
                     subc = self.screen.getch()
-                self.screen.hline(self.height-1,2,curses.ACS_HLINE,(len(word)+1))
-                self.screen.addstr(self.height-2,2," "*20)
+                self.screen.hline(self.height - 1, 2, curses.ACS_HLINE, (len(word) + 1))
+                self.screen.addstr(self.height - 2, 2, " " * 20)
 
             # Get another key from the user
             c = self.screen.getch()
@@ -351,14 +363,15 @@ class ElogViewer:
 
         # Screen Look&Feel
         self.screen.border()
-        self.screen.hline(self.height//2,1, "_", self.width-2)
+        self.screen.hline(self.height // 2, 1, "_", self.width - 2)
         m = _(" Press F1 or h to show the help screen ")
-        self.screen.addstr(self.height-1, self.width-len(m)-1, m)
+        self.screen.addstr(self.height - 1, self.width - len(m) - 1, m)
         self.screen.refresh()
 
         # Initialize log file window
-        self.log_win = curses.newwin(self.height//2-2, self.width-2,
-                                     self.height//2+1, 1)
+        self.log_win = curses.newwin(
+            self.height // 2 - 2, self.width - 2, self.height // 2 + 1, 1
+        )
 
         # Draw other window of the screen
         self.fill_file_pad()
@@ -367,31 +380,37 @@ class ElogViewer:
         self.logf_wrap = self.wrap_logf_lines()
         self.show_log()
 
-    def change_usel(self,n,relative=True):
+    def change_usel(self, n, relative=True):
         prev_usel = self.usel
         if not relative:
             self.usel = n
-        elif n < 0 and self.usel+n < 0:
+        elif n < 0 and self.usel + n < 0:
             self.usel = 0
-        elif n > 0 and self.usel+n > len(self.packages)-1:
-            self.usel = len(self.packages)-1
+        elif n > 0 and self.usel + n > len(self.packages) - 1:
+            self.usel = len(self.packages) - 1
         else:
             self.usel += n
 
         prev_pkg = self.packages[prev_usel]
         pkg = self.packages[self.usel]
-        self.file_pad.addstr(prev_usel,1,
-                                 class_char,
-                                 curses.A_BOLD + curses.color_pair(prev_pkg[CLASS]))
-        self.file_pad.addstr(prev_usel,3,
-                                 list_format % (prev_pkg[CAT], prev_pkg[PN], date2str(prev_pkg[DATE]) ),
-                                 curses.color_pair(normal))
-        self.file_pad.addstr(self.usel,1,
-                                 class_char,
-                                 curses.A_BOLD + curses.color_pair(pkg[CLASS]))
-        self.file_pad.addstr(self.usel,3,
-                                 list_format % (pkg[CAT], pkg[PN], date2str(pkg[DATE]) ),
-                                 curses.color_pair(selected))
+        self.file_pad.addstr(
+            prev_usel, 1, class_char, curses.A_BOLD + curses.color_pair(prev_pkg[CLASS])
+        )
+        self.file_pad.addstr(
+            prev_usel,
+            3,
+            list_format % (prev_pkg[CAT], prev_pkg[PN], date2str(prev_pkg[DATE])),
+            curses.color_pair(normal),
+        )
+        self.file_pad.addstr(
+            self.usel, 1, class_char, curses.A_BOLD + curses.color_pair(pkg[CLASS])
+        )
+        self.file_pad.addstr(
+            self.usel,
+            3,
+            list_format % (pkg[CAT], pkg[PN], date2str(pkg[DATE])),
+            curses.color_pair(selected),
+        )
 
         first = self.pposy
         last = (self.height // 2 - 2) + first
@@ -414,12 +433,12 @@ class ElogViewer:
         self.show_log()
 
     @staticmethod
-    def open(file, mode='rt'):
-        if file.endswith('.xz'):
+    def open(file, mode="rt"):
+        if file.endswith(".xz"):
             return lzma.open(file, mode=mode)
-        elif file.endswith('.gz'):
+        elif file.endswith(".gz"):
             return gzip.open(file, mode=mode)
-        elif file.endswith('.bz2'):
+        elif file.endswith(".bz2"):
             return bz2.open(file, mode=mode)
         else:
             return open(file, mode=mode)
@@ -432,7 +451,7 @@ class ElogViewer:
         Redraws file pad, first half of the screen.
         Can be used to scroll or simply update
         """
-        self.file_pad.refresh(self.pposy,0,1,1,self.height//2-1,self.width-2)
+        self.file_pad.refresh(self.pposy, 0, 1, 1, self.height // 2 - 1, self.width - 2)
 
     def get_packages_key(self, k):
         return k[self.sort_method[0]]
@@ -444,7 +463,9 @@ class ElogViewer:
         """
         # Get the list of files
         try:
-            file_list = glob(os.path.join(elogdir,"*:*:*.log*")) + glob(os.path.join(elogdir,"*","*:*.log*"))
+            file_list = glob(os.path.join(elogdir, "*:*:*.log*")) + glob(
+                os.path.join(elogdir, "*", "*:*.log*")
+            )
         except OSError:
             raise CannotOpenElogdir()
 
@@ -465,13 +486,15 @@ class ElogViewer:
             # then we split the string using as pattern / or : to obtain in any
             # case
             # ( "x11-themes", "haematite-xcursors", "1.0:20091018-195827.log")
-            tmpfilepath = re.sub('\\.log[^/]*$', '.log', filepath)
-            split_up = re.split(":|" + os.path.sep, tmpfilepath.replace(elogdir + os.path.sep, ""))
+            tmpfilepath = re.sub("\\.log[^/]*$", ".log", filepath)
+            split_up = re.split(
+                ":|" + os.path.sep, tmpfilepath.replace(elogdir + os.path.sep, "")
+            )
             if len(split_up) < 3:
                 continue
             (cat, pn, other) = split_up[-3:]
             date = datetime.strptime(other, "%Y%m%d-%H%M%S.log")
-            self.packages.append( (filepath, cat, pn, date, self.get_class(filepath)) )
+            self.packages.append((filepath, cat, pn, date, self.get_class(filepath)))
 
         if not self.packages:
             raise NoLogFiles()
@@ -479,24 +502,26 @@ class ElogViewer:
         # Maybe that after removing files self.usel points to a wrong index,
         # so this will prevent a crash
         if self.usel >= len(self.packages):
-            self.usel = len(self.packages)-1
+            self.usel = len(self.packages) - 1
             # We also have to update self.pposy
             if self.pposy > self.usel:
-                self.pposy = max(0, self.usel-10)
+                self.pposy = max(0, self.usel - 10)
 
         # Sort the list
         if self.sort_method[0] in (DATE, CLASS):
-            self.packages.sort(key=self.get_packages_key,reverse=not self.sort_method[1])
+            self.packages.sort(
+                key=self.get_packages_key, reverse=not self.sort_method[1]
+            )
         else:
             self.packages.sort(key=self.get_packages_key, reverse=self.sort_method[1])
 
         # Curses' newpad fails for nlines >32767 so we truncate the list
         # of log files to not exceed that limit (issue #10)
-        MAX_ENTRIES = 2 ** 15 - 1
+        MAX_ENTRIES = 2**15 - 1
         if len(self.packages) > MAX_ENTRIES:
             self.packages = self.packages[:MAX_ENTRIES]
 
-        self.file_pad = curses.newpad(len(self.packages),self.width)
+        self.file_pad = curses.newpad(len(self.packages), self.width)
         self.file_pad.erase()
 
         for i, pkg in enumerate(self.packages):
@@ -513,14 +538,17 @@ class ElogViewer:
             else:
                 cp = normal
 
-            self.file_pad.addstr(i,1,
-                                 class_char,
-                                 curses.A_BOLD + curses.color_pair(pkg[CLASS]))
-            self.file_pad.addstr(i,3,
-                                 list_format % (pkg[CAT], pkg[PN], date2str(pkg[DATE]) ),
-                                 curses.color_pair(cp))
-
-    def get_class(self,filepath):
+            self.file_pad.addstr(
+                i, 1, class_char, curses.A_BOLD + curses.color_pair(pkg[CLASS])
+            )
+            self.file_pad.addstr(
+                i,
+                3,
+                list_format % (pkg[CAT], pkg[PN], date2str(pkg[DATE])),
+                curses.color_pair(cp),
+            )
+
+    def get_class(self, filepath):
         """
         Get the highest elog class in a file
         """
@@ -548,7 +576,7 @@ 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)
+                wrapped_line = textwrap.wrap(line, width=self.width - 2)
                 for l in wrapped_line:
                     yield l + "\n"
 
@@ -561,7 +589,7 @@ class ElogViewer:
         self.log_win.erase()
         shown_all = False
 
-        for i in range(0,self.height//2-4):
+        for i in range(0, self.height // 2 - 4):
             try:
                 x = next(self.logf_wrap)
             except StopIteration:
@@ -571,27 +599,31 @@ class ElogViewer:
                 break
 
             try:
-                if x.startswith('INFO:'):
-                    self.log_win.addstr(x[:self.width-2],curses.color_pair(einfo))
-                elif x.startswith('WARN:'):
-                    self.log_win.addstr(x[:self.width-2],curses.color_pair(ewarn))
-                elif x.startswith('ERROR:'):
-                    self.log_win.addstr(x[:self.width-2],curses.color_pair(eerror))
-                elif x.startswith('LOG:'):
-                    self.log_win.addstr(x[:self.width-2],curses.color_pair(elog))
+                if x.startswith("INFO:"):
+                    self.log_win.addstr(x[: self.width - 2], curses.color_pair(einfo))
+                elif x.startswith("WARN:"):
+                    self.log_win.addstr(x[: self.width - 2], curses.color_pair(ewarn))
+                elif x.startswith("ERROR:"):
+                    self.log_win.addstr(x[: self.width - 2], curses.color_pair(eerror))
+                elif x.startswith("LOG:"):
+                    self.log_win.addstr(x[: self.width - 2], curses.color_pair(elog))
                 else:
-                    self.log_win.addstr(x[:self.width-2],curses.color_pair(normal))
+                    self.log_win.addstr(x[: self.width - 2], curses.color_pair(normal))
             except curses.error:
                 pass
 
-        if not shown_all: 
+        if not shown_all:
             s = _("Continue...")
-            self.log_win.addstr(self.height//2-3, self.width-len(s)-4, s,
-                                curses.color_pair(normal))
+            self.log_win.addstr(
+                self.height // 2 - 3,
+                self.width - len(s) - 4,
+                s,
+                curses.color_pair(normal),
+            )
 
         self.log_win.refresh()
 
-    def remove_file(self,n):
+    def remove_file(self, n):
         """
         Delete from the filesystem a slice of elog files
         n can be:
@@ -614,24 +646,25 @@ class ElogViewer:
             end = self.usel + int(n)
 
         for item in self.packages[start:end]:
-            os.remove(os.path.join(elogdir,item[0]))
+            os.remove(os.path.join(elogdir, item[0]))
 
     def show_help(self):
         # Setup help window
         helpwin_height = self.height // 3 * 2
         helpwin_corner = (self.height // 6, self.width // 2 - 40)
-        helpwin = curses.newwin(helpwin_height, 80,
-                                     helpwin_corner[0], helpwin_corner[1])
+        helpwin = curses.newwin(
+            helpwin_height, 80, helpwin_corner[0], helpwin_corner[1]
+        )
         helplines = helptext.splitlines()
 
         # Setup help pad
         row = 0
         maxrow = len(helplines)
-        helppad = curses.newpad(maxrow,80)
+        helppad = curses.newpad(maxrow, 80)
 
         # Insert helptext on the pad
         for i in range(maxrow):
-            helppad.addstr(i,0,helplines[i])
+            helppad.addstr(i, 0, helplines[i])
 
         # Loop to manage user actions
         c = None
@@ -640,31 +673,39 @@ class ElogViewer:
             helpwin.border()
             helpwin.refresh()
 
-            helppad.refresh(row,0,helpwin_corner[0]+1,helpwin_corner[1]+1,
-                             helpwin_height+helpwin_corner[0]-2,80+helpwin_corner[1]-2)
+            helppad.refresh(
+                row,
+                0,
+                helpwin_corner[0] + 1,
+                helpwin_corner[1] + 1,
+                helpwin_height + helpwin_corner[0] - 2,
+                80 + helpwin_corner[1] - 2,
+            )
 
             c = self.screen.getch()
             if c == curses.KEY_NPAGE:
-                if row+10 <= maxrow:
+                if row + 10 <= maxrow:
                     row += 10
             elif c == curses.KEY_PPAGE:
-                if row-10 >= 0:
+                if row - 10 >= 0:
                     row -= 10
             elif c in (curses.KEY_DOWN, ord("j")):
-                if row+1 < maxrow:
+                if row + 1 < maxrow:
                     row += 1
             elif c in (curses.KEY_UP, ord("k")):
                 if row > 0:
                     row -= 1
 
     def search(self, word, div=0):
-        for x in self.packages[self.usel+div:]:
+        for x in self.packages[self.usel + div :]:
             if re.search(word, "%s/%s" % x[1:3]):
-                self.change_usel(self.packages.index(x),False)
+                self.change_usel(self.packages.index(x), False)
                 break
         else:
-            self.screen.addstr(self.height-2,2,_("Not Found!"),
-                curses.color_pair(eerror))
+            self.screen.addstr(
+                self.height - 2, 2, _("Not Found!"), curses.color_pair(eerror)
+            )
+
 
 if __name__ == "__main__":
     if "--help" in sys.argv:
@@ -672,10 +713,12 @@ if __name__ == "__main__":
         sys.exit()
 
     # Get the path of the elogdir
-    if port_settings['PORT_LOGDIR']:
-        elogdir = os.path.join(port_settings['PORT_LOGDIR'],"elog")
+    if port_settings["PORT_LOGDIR"]:
+        elogdir = os.path.join(port_settings["PORT_LOGDIR"], "elog")
     else:
-        elogdir = os.path.join(os.sep,port_settings['EPREFIX'],"var","log","portage","elog")
+        elogdir = os.path.join(
+            os.sep, port_settings["EPREFIX"], "var", "log", "portage", "elog"
+        )
 
     signal.signal(signal.SIGTSTP, handle_sig_tstp)
     signal.signal(signal.SIGCONT, handle_sig_cont)
@@ -691,7 +734,9 @@ if __name__ == "__main__":
         sys.exit(1)
     except CannotOpenElogdir:
         print(_("Cannot open"), elogdir)
-        print(_("Please check if the directory exists and if it's readable by your user."))
+        print(
+            _("Please check if the directory exists and if it's readable by your user.")
+        )
         sys.exit(1)
     except KeyboardInterrupt:
         pass

diff --git a/setup.py b/setup.py
index 631a6c7..d182056 100644
--- a/setup.py
+++ b/setup.py
@@ -14,13 +14,13 @@ from glob import glob
 
 
 class messages(Command):
+    description = "Extract messages from source files"
 
-    description = 'Extract messages from source files'
-
-    user_options = [('merge', 'm', 'Merge message catalogs after '
-                     'extracting template')]
+    user_options = [
+        ("merge", "m", "Merge message catalogs after " "extracting template")
+    ]
 
-    boolean_options = ['merge']
+    boolean_options = ["merge"]
 
     def initialize_options(self):
         self.merge = False
@@ -31,18 +31,18 @@ class messages(Command):
     def run(self):
         wd = os.getcwd()
         name = self.distribution.get_name()
-        logging.info('Extracting messages from %s' % name)
-        os.chdir('po')
-        os.system('pygettext -k i18n -o %s.pot ../%s' % (name, name))
+        logging.info("Extracting messages from %s" % name)
+        os.chdir("po")
+        os.system("pygettext -k i18n -o %s.pot ../%s" % (name, name))
         os.chdir(wd)
         if self.merge:
-            self.run_command('merge')
+            self.run_command("merge")
 
 
 class merge(Command):
-    description = 'Merge message catalogs with template'
+    description = "Merge message catalogs with template"
 
-    user_options = [('lang=', 'l', 'Only merge specified language')]
+    user_options = [("lang=", "l", "Only merge specified language")]
 
     def initialize_options(self):
         self.lang = None
@@ -52,46 +52,44 @@ class merge(Command):
 
     def run(self):
         wd = os.getcwd()
-        os.chdir('po')
+        os.chdir("po")
         if self.lang is not None:
-            filename = '%s.po' % self.lang
+            filename = "%s.po" % self.lang
             if os.path.exists(filename):
                 self.merge(filename)
             else:
-                logging.error('No catalog found for language %s' % self.lang)
+                logging.error("No catalog found for language %s" % self.lang)
         else:
-            files = glob('*.po')
+            files = glob("*.po")
             for f in files:
                 self.merge(f)
         os.chdir(wd)
 
     def merge(self, f):
         name = self.distribution.get_name()
-        logging.info('Merging catalog %s' % f)
-        os.system('msgmerge %s %s.pot -o %s' % (f, name, f))
+        logging.info("Merging catalog %s" % f)
+        os.system("msgmerge %s %s.pot -o %s" % (f, name, f))
 
 
 class build_messages(Command):
-
-    description = 'Compile message catalogs'
-    user_options = [('build-dir=', 'd',
-                     'directory to build message catalogs in')]
+    description = "Compile message catalogs"
+    user_options = [("build-dir=", "d", "directory to build message catalogs in")]
 
     def initialize_options(self):
         self.build_dir = None
 
     def finalize_options(self):
-        self.set_undefined_options('build', ('build_messages', 'build_dir'))
+        self.set_undefined_options("build", ("build_messages", "build_dir"))
 
     def run(self):
         self.mkpath(self.build_dir)
-        po_files = os.path.join('po', '*.po')
+        po_files = os.path.join("po", "*.po")
         po_files = glob(po_files)
         for f in po_files:
             base = os.path.basename(f)
             base = os.path.splitext(base)[0]
-            out_file = os.path.join(self.build_dir, '%s.gmo' % base)
-            logging.info('Building catalog %s > %s' % (f, out_file))
+            out_file = os.path.join(self.build_dir, "%s.gmo" % base)
+            logging.info("Building catalog %s > %s" % (f, out_file))
             cmd = 'msgfmt -o "%s" %s' % (out_file, f)
             os.system(cmd)
 
@@ -108,24 +106,24 @@ class build(_build):
     def finalize_options(self):
         _build.finalize_options(self)
         if self.build_messages is None:
-            self.build_messages = os.path.join(self.build_base, 'po')
+            self.build_messages = os.path.join(self.build_base, "po")
 
     _build.user_options.append(
-        ('build-messages=', None, "build directory for messages"))
-    _build.sub_commands.append(('build_messages', has_messages))
+        ("build-messages=", None, "build directory for messages")
+    )
+    _build.sub_commands.append(("build_messages", has_messages))
 
 
 class install_messages(Command):
-
-    description = 'Installs message catalogs'
+    description = "Installs message catalogs"
 
     user_options = [
-        ('install-dir=', 'd', "directory to install scripts to"),
-        ('build-dir=', 'b', "build directory (where to install from)"),
-        ('skip-build', None, "skip the build steps"),
+        ("install-dir=", "d", "directory to install scripts to"),
+        ("build-dir=", "b", "build directory (where to install from)"),
+        ("skip-build", None, "skip the build steps"),
     ]
 
-    boolean_options = ['skip-build']
+    boolean_options = ["skip-build"]
 
     def initialize_options(self):
         self.install_dir = None
@@ -133,26 +131,25 @@ class install_messages(Command):
         self.skip_build = None
 
     def finalize_options(self):
-        self.set_undefined_options('build', ('build_messages', 'build_dir'))
+        self.set_undefined_options("build", ("build_messages", "build_dir"))
         self.set_undefined_options(
-            'install',
-            ('install_data', 'install_dir'),
-            ('force', 'force'),
-            ('skip_build', 'skip_build'),
+            "install",
+            ("install_data", "install_dir"),
+            ("force", "force"),
+            ("skip_build", "skip_build"),
         )
-        self.install_dir = os.path.join(self.install_dir, 'share', 'locale')
+        self.install_dir = os.path.join(self.install_dir, "share", "locale")
 
     def run(self):
         if not self.skip_build:
-            self.run_command('build_messages')
-        catalogs = glob(os.path.join(self.build_dir, '*.gmo'))
+            self.run_command("build_messages")
+        catalogs = glob(os.path.join(self.build_dir, "*.gmo"))
         for c in catalogs:
             base = os.path.basename(c)
             base = os.path.splitext(base)[0]
-            out_dir = os.path.join(self.install_dir, base, 'LC_MESSAGES')
+            out_dir = os.path.join(self.install_dir, base, "LC_MESSAGES")
             self.mkpath(out_dir)
-            out_file = os.path.join(out_dir,
-                                    '%s.mo' % self.distribution.get_name())
+            out_file = os.path.join(out_dir, "%s.mo" % self.distribution.get_name())
             self.copy_file(c, out_file)
 
 
@@ -164,15 +161,14 @@ class install(_install):
     def has_manpages(self):
         return True
 
-    _install.sub_commands.append(('install_messages', has_messages))
-    _install.sub_commands.append(('install_manpages', has_manpages))
+    _install.sub_commands.append(("install_messages", has_messages))
+    _install.sub_commands.append(("install_manpages", has_manpages))
 
 
 ### End of snippet ###
 
 
 class install_manpages(Command):
-
     description = "Install man pages"
 
     user_options = []
@@ -184,9 +180,9 @@ class install_manpages(Command):
 
     def finalize_options(self):
         self.set_undefined_options(
-            'install',
-            ('install_data', 'install_dir'),
-            ('root', 'root'),
+            "install",
+            ("install_data", "install_dir"),
+            ("root", "root"),
         )
 
     def run(self):
@@ -204,14 +200,16 @@ class install_manpages(Command):
 
 man_pages = glob("man/*")
 
-setup(packages=[],
-      scripts=['elogv'],
-      cmdclass={
-          'extract_messages': messages,
-          'merge': merge,
-          'build_messages': build_messages,
-          'build': build,
-          'install_messages': install_messages,
-          'install_manpages': install_manpages,
-          'install': install,
-      })
+setup(
+    packages=[],
+    scripts=["elogv"],
+    cmdclass={
+        "extract_messages": messages,
+        "merge": merge,
+        "build_messages": build_messages,
+        "build": build,
+        "install_messages": install_messages,
+        "install_manpages": install_manpages,
+        "install": install,
+    },
+)


^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [gentoo-commits] proj/elogv:master commit in: /
@ 2023-10-06 13:13 Sebastian Pipping
  0 siblings, 0 replies; 30+ messages in thread
From: Sebastian Pipping @ 2023-10-06 13:13 UTC (permalink / raw
  To: gentoo-commits

commit:     b4ac8abd4d2d5f71fe84f65067ec959b8a088376
Author:     Sebastian Pipping <sping <AT> gentoo <DOT> org>
AuthorDate: Fri Oct  6 13:11:38 2023 +0000
Commit:     Sebastian Pipping <sping <AT> gentoo <DOT> org>
CommitDate: Fri Oct  6 13:12:48 2023 +0000
URL:        https://gitweb.gentoo.org/proj/elogv.git/commit/?id=b4ac8abd

Add .mailmap

Signed-off-by: Sebastian Pipping <sping <AT> gentoo.org>

 .mailmap | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/.mailmap b/.mailmap
new file mode 100644
index 0000000..8423dca
--- /dev/null
+++ b/.mailmap
@@ -0,0 +1,2 @@
+# This file is used by "git log"
+Sebastian Pipping <sebastian@pipping.org> <sping@gentoo.org>


^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [gentoo-commits] proj/elogv:master commit in: /
@ 2023-10-06 17:35 Sebastian Pipping
  0 siblings, 0 replies; 30+ messages in thread
From: Sebastian Pipping @ 2023-10-06 17:35 UTC (permalink / raw
  To: gentoo-commits

commit:     1ebc57704e1536268592ad9bd25af35511da165b
Author:     Sebastian Pipping <sping <AT> gentoo <DOT> org>
AuthorDate: Fri Oct  6 17:31:02 2023 +0000
Commit:     Sebastian Pipping <sping <AT> gentoo <DOT> org>
CommitDate: Fri Oct  6 17:31:04 2023 +0000
URL:        https://gitweb.gentoo.org/proj/elogv.git/commit/?id=1ebc5770

Merge branch 'pyproject-toml-fix-license'

Signed-off-by: Sebastian Pipping <sping <AT> gentoo.org>

 LICENSE        | 339 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 pyproject.toml |   2 +-
 2 files changed, 340 insertions(+), 1 deletion(-)


^ permalink raw reply	[flat|nested] 30+ messages in thread

* [gentoo-commits] proj/elogv:master commit in: /
@ 2023-10-06 17:46 Sebastian Pipping
  0 siblings, 0 replies; 30+ messages in thread
From: Sebastian Pipping @ 2023-10-06 17:46 UTC (permalink / raw
  To: gentoo-commits

commit:     a1938e4d5e7184b448b812fb4db97151ce79db15
Author:     Sebastian Pipping <sping <AT> gentoo <DOT> org>
AuthorDate: Fri Oct  6 17:45:10 2023 +0000
Commit:     Sebastian Pipping <sping <AT> gentoo <DOT> org>
CommitDate: Fri Oct  6 17:45:14 2023 +0000
URL:        https://gitweb.gentoo.org/proj/elogv.git/commit/?id=a1938e4d

Merge branch 'pre-commit-github-actions'

Signed-off-by: Sebastian Pipping <sping <AT> gentoo.org>

 .git-blame-ignore-revs               |  4 +++
 .github/workflows/pre-commit-run.yml | 58 ++++++++++++++++++++++++++++++++++++
 .pre-commit-config.yaml              | 42 ++++++++++++++++++++++++++
 ChangeLog                            |  8 ++---
 po/elogv.pot                         |  1 -
 po/es.po                             |  1 -
 6 files changed, 108 insertions(+), 6 deletions(-)


^ permalink raw reply	[flat|nested] 30+ messages in thread

* [gentoo-commits] proj/elogv:master commit in: /
@ 2023-10-06 20:10 Sebastian Pipping
  0 siblings, 0 replies; 30+ messages in thread
From: Sebastian Pipping @ 2023-10-06 20:10 UTC (permalink / raw
  To: gentoo-commits

commit:     488942e93c968485b302251b40bce15fad8df370
Author:     Sebastian Pipping <sping <AT> gentoo <DOT> org>
AuthorDate: Fri Oct  6 20:10:12 2023 +0000
Commit:     Sebastian Pipping <sping <AT> gentoo <DOT> org>
CommitDate: Fri Oct  6 20:10:17 2023 +0000
URL:        https://gitweb.gentoo.org/proj/elogv.git/commit/?id=488942e9

Merge branch 'complete-authors'

Signed-off-by: Sebastian Pipping <sping <AT> gentoo.org>

 elogv | 1 +
 1 file changed, 1 insertion(+)


^ permalink raw reply	[flat|nested] 30+ messages in thread

* [gentoo-commits] proj/elogv:master commit in: /
@ 2023-10-06 20:47 Sebastian Pipping
  0 siblings, 0 replies; 30+ messages in thread
From: Sebastian Pipping @ 2023-10-06 20:47 UTC (permalink / raw
  To: gentoo-commits

commit:     e2b9632bb66e64283436ae6670dcca680a0e7363
Author:     Alfred Wingate <parona <AT> protonmail <DOT> com>
AuthorDate: Fri Oct  6 19:55:50 2023 +0000
Commit:     Sebastian Pipping <sping <AT> gentoo <DOT> org>
CommitDate: Fri Oct  6 20:47:06 2023 +0000
URL:        https://gitweb.gentoo.org/proj/elogv.git/commit/?id=e2b9632b

elogv: accept PORTAGE_LOGDIR

Bug: https://bugs.gentoo.org/668538
Closes: https://bugs.gentoo.org/901961
Co-authored-by: josef.95 <josef64 <AT> posteo.org>
Thanks-To: Sam James <sam <AT> gentoo.org>
Thanks-To: Arfrever Frehtes Taifersar Arahesis <arfrever.fta <AT> gmail.com>
Thanks-To: Ninpo <ninpo <AT> gap.la>
Signed-off-by: Alfred Wingate <parona <AT> protonmail.com>
Signed-off-by: Sebastian Pipping <sping <AT> gentoo.org>

 elogv | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/elogv b/elogv
index d28e4bc..e927da2 100755
--- a/elogv
+++ b/elogv
@@ -714,8 +714,10 @@ if __name__ == "__main__":
         sys.exit()
 
     # Get the path of the elogdir
-    if port_settings["PORT_LOGDIR"]:
-        elogdir = os.path.join(port_settings["PORT_LOGDIR"], "elog")
+    for logdir_var in ["PORTAGE_LOGDIR", "PORT_LOGDIR"]:
+        if logdir_var in port_settings:
+            elogdir = os.path.join(port_settings[logdir_var], "elog")
+            break
     else:
         elogdir = os.path.join(
             os.sep, port_settings["EPREFIX"], "var", "log", "portage", "elog"


^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [gentoo-commits] proj/elogv:master commit in: /
@ 2023-10-06 22:06 Sebastian Pipping
  0 siblings, 0 replies; 30+ messages in thread
From: Sebastian Pipping @ 2023-10-06 22:06 UTC (permalink / raw
  To: gentoo-commits

commit:     b090c248e948a908775f34fa80638d7a304f1bc0
Author:     Sebastian Pipping <sping <AT> gentoo <DOT> org>
AuthorDate: Fri Oct  6 22:05:10 2023 +0000
Commit:     Sebastian Pipping <sping <AT> gentoo <DOT> org>
CommitDate: Fri Oct  6 22:06:48 2023 +0000
URL:        https://gitweb.gentoo.org/proj/elogv.git/commit/?id=b090c248

Release 0.8.3

Signed-off-by: Sebastian Pipping <sping <AT> gentoo.org>

 ChangeLog      | 10 ++++++++--
 pyproject.toml |  2 +-
 2 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 8bf7b0a..b04ab04 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,10 +1,16 @@
 # ChangeLog for elogv
 
+0.8.3
+  * Support variable PORTAGE_LOGDIR (#21)
+  * Correct/clarify code license to be "GPL v2 or later" in packaging (#19)
+  * Start using GitHub Actions and pre-commit for CI (#18)
+  * Start using QA tools black, isort, ruff (#16)
+
 0.8.2
-  * Fix decompression and port to standard library lzma
+  * Fix decompression and port to standard library lzma (#15)
 
 0.8.1
-  * Port to setuptools and PEP517 (Gentoo bug #841134)
+  * Port to setuptools and PEP517 (#14, Gentoo bug #841134)
 
 0.8.0
   * Set "packages=[]" in setup.py to fix the build

diff --git a/pyproject.toml b/pyproject.toml
index 441f5ce..1fc8f61 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
 
 [project]
 name = "elogv"
-version = "0.8.2"
+version = "0.8.3"
 authors = [
     {name = "Luca Marturana", email = "lucamarturana@gmail.com"},
 ]


^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [gentoo-commits] proj/elogv:master commit in: /
@ 2025-02-08 22:54 Sebastian Pipping
  0 siblings, 0 replies; 30+ messages in thread
From: Sebastian Pipping @ 2025-02-08 22:54 UTC (permalink / raw
  To: gentoo-commits

commit:     0193e1980dda46ee8a6811822f41a3baadb90a50
Author:     Alfred Wingate <parona <AT> protonmail <DOT> com>
AuthorDate: Sat Feb  1 04:59:35 2025 +0000
Commit:     Sebastian Pipping <sping <AT> gentoo <DOT> org>
CommitDate: Sat Feb  8 22:08:22 2025 +0000
URL:        https://gitweb.gentoo.org/proj/elogv.git/commit/?id=0193e198

elogv: match QA class of logs and give it an appropriate colour

Signed-off-by: Alfred Wingate <parona <AT> protonmail.com>

 elogv | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/elogv b/elogv
index ca0ddf0..3853505 100755
--- a/elogv
+++ b/elogv
@@ -141,7 +141,7 @@ you can use these keys to control the behavior of the program:
 """
 )
 
-(normal, selected, einfo, elog, ewarn, eerror) = range(6)
+(normal, selected, einfo, elog, ewarn, eerror, eqawarn) = range(7)
 (PATH, CAT, PN, DATE, CLASS) = range(5)
 
 # Character used to print the class of an elog
@@ -224,6 +224,8 @@ class ElogViewer:
             curses.init_pair(ewarn, curses.COLOR_YELLOW, curses.COLOR_BLACK)
             curses.init_pair(eerror, curses.COLOR_RED, curses.COLOR_BLACK)
             curses.init_pair(elog, curses.COLOR_MAGENTA, curses.COLOR_BLACK)
+            # Normally eqawarn color would be orange/brown but this isnt an option in curses.
+            curses.init_pair(eqawarn, curses.COLOR_YELLOW, curses.COLOR_BLACK)
         except curses.error:  # e.g. with "TERM=vt100 elogv" invokation
             pass
 
@@ -555,7 +557,7 @@ class ElogViewer:
         Get the highest elog class in a file
         """
         with self.open(filepath) as f:
-            classes = re.findall("LOG:|INFO:|WARN:|ERROR:", f.read())
+            classes = re.findall("LOG:|INFO:|WARN:|ERROR:|QA:", f.read())
 
         if "ERROR:" in classes:
             return eerror
@@ -563,6 +565,8 @@ class ElogViewer:
             return ewarn
         elif "LOG:" in classes:
             return elog
+        elif "QA:" in classes:
+            return eqawarn
         else:
             return einfo
 
@@ -611,6 +615,8 @@ class ElogViewer:
                     self.log_win.addstr(x[: self.width - 2], curses.color_pair(eerror))
                 elif x.startswith("LOG:"):
                     self.log_win.addstr(x[: self.width - 2], curses.color_pair(elog))
+                elif x.startswith("QA:"):
+                    self.log_win.addstr(x[: self.width - 2], curses.color_pair(eqawarn))
                 else:
                     # Strip embedded color codes
                     x = re.sub(ansi_code, "", x)


^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [gentoo-commits] proj/elogv:master commit in: /
@ 2025-02-08 22:54 Sebastian Pipping
  0 siblings, 0 replies; 30+ messages in thread
From: Sebastian Pipping @ 2025-02-08 22:54 UTC (permalink / raw
  To: gentoo-commits

commit:     6a3ab956fd07936d77292275b7658123bd387670
Author:     Alfred Wingate <parona <AT> protonmail <DOT> com>
AuthorDate: Sat Feb  1 04:49:26 2025 +0000
Commit:     Sebastian Pipping <sping <AT> gentoo <DOT> org>
CommitDate: Sat Feb  8 22:08:22 2025 +0000
URL:        https://gitweb.gentoo.org/proj/elogv.git/commit/?id=6a3ab956

elogv: strip ansi color codes

User installed QA scripts such as iwdevtools may include their own color
output in their logs, but curses cannot handle these without proper
explicit handling.

Strip the codes instead of complicating printing.

Signed-off-by: Alfred Wingate <parona <AT> protonmail.com>

 elogv | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/elogv b/elogv
index e927da2..ca0ddf0 100755
--- a/elogv
+++ b/elogv
@@ -590,6 +590,9 @@ class ElogViewer:
         self.log_win.erase()
         shown_all = False
 
+        # Good enough to catch stray color codes generated by iwdevtools etc.
+        ansi_code = re.compile(r"\033\[[0-9;:]*m")
+
         for i in range(0, self.height // 2 - 4):
             try:
                 x = next(self.logf_wrap)
@@ -609,6 +612,8 @@ class ElogViewer:
                 elif x.startswith("LOG:"):
                     self.log_win.addstr(x[: self.width - 2], curses.color_pair(elog))
                 else:
+                    # Strip embedded color codes
+                    x = re.sub(ansi_code, "", x)
                     self.log_win.addstr(x[: self.width - 2], curses.color_pair(normal))
             except curses.error:
                 pass


^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [gentoo-commits] proj/elogv:master commit in: /
@ 2025-02-08 22:54 Sebastian Pipping
  0 siblings, 0 replies; 30+ messages in thread
From: Sebastian Pipping @ 2025-02-08 22:54 UTC (permalink / raw
  To: gentoo-commits

commit:     fef519b824daad303b37e0a7f58e5bcd7d93fc42
Author:     Sebastian Pipping <sping <AT> gentoo <DOT> org>
AuthorDate: Sat Feb  8 22:53:37 2025 +0000
Commit:     Sebastian Pipping <sping <AT> gentoo <DOT> org>
CommitDate: Sat Feb  8 22:54:28 2025 +0000
URL:        https://gitweb.gentoo.org/proj/elogv.git/commit/?id=fef519b8

Merge remote-tracking branch 'parona-source-readonly/qa_log'

Signed-off-by: Sebastian Pipping <sping <AT> gentoo.org>

 elogv | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)


^ permalink raw reply	[flat|nested] 30+ messages in thread

* [gentoo-commits] proj/elogv:master commit in: /
@ 2025-02-08 22:58 Sebastian Pipping
  0 siblings, 0 replies; 30+ messages in thread
From: Sebastian Pipping @ 2025-02-08 22:58 UTC (permalink / raw
  To: gentoo-commits

commit:     3de0a708c9e63617cfad6b824d54aefbe073153e
Author:     Sebastian Pipping <sping <AT> gentoo <DOT> org>
AuthorDate: Sat Feb  8 22:57:09 2025 +0000
Commit:     Sebastian Pipping <sping <AT> gentoo <DOT> org>
CommitDate: Sat Feb  8 22:57:58 2025 +0000
URL:        https://gitweb.gentoo.org/proj/elogv.git/commit/?id=3de0a708

Release 0.8.4

Signed-off-by: Sebastian Pipping <sping <AT> gentoo.org>

 ChangeLog      | 3 +++
 pyproject.toml | 2 +-
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog
index b04ab04..d308db1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 # ChangeLog for elogv
 
+0.8.4
+  * Better handling for QA logs (#22)
+
 0.8.3
   * Support variable PORTAGE_LOGDIR (#21)
   * Correct/clarify code license to be "GPL v2 or later" in packaging (#19)

diff --git a/pyproject.toml b/pyproject.toml
index 1fc8f61..1c93069 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
 
 [project]
 name = "elogv"
-version = "0.8.3"
+version = "0.8.4"
 authors = [
     {name = "Luca Marturana", email = "lucamarturana@gmail.com"},
 ]


^ permalink raw reply related	[flat|nested] 30+ messages in thread

end of thread, other threads:[~2025-02-08 22:58 UTC | newest]

Thread overview: 30+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-10-06 12:34 [gentoo-commits] proj/elogv:master commit in: / Sebastian Pipping
  -- strict thread matches above, loose matches on Subject: below --
2025-02-08 22:58 Sebastian Pipping
2025-02-08 22:54 Sebastian Pipping
2025-02-08 22:54 Sebastian Pipping
2025-02-08 22:54 Sebastian Pipping
2023-10-06 22:06 Sebastian Pipping
2023-10-06 20:47 Sebastian Pipping
2023-10-06 20:10 Sebastian Pipping
2023-10-06 17:46 Sebastian Pipping
2023-10-06 17:35 Sebastian Pipping
2023-10-06 13:13 Sebastian Pipping
2023-10-06 12:34 Sebastian Pipping
2023-10-06 12:34 Sebastian Pipping
2023-10-06 12:34 Sebastian Pipping
2023-10-06 12:34 Sebastian Pipping
2023-10-06 12:34 Sebastian Pipping
2023-10-06 12:34 Sebastian Pipping
2023-10-06 12:34 Sebastian Pipping
2023-10-05 18:39 Sebastian Pipping
2023-10-05 17:41 Sebastian Pipping
2023-10-05 17:41 Sebastian Pipping
2023-10-05 17:41 Sebastian Pipping
2023-10-05 15:00 Sebastian Pipping
2023-10-05 14:55 Sebastian Pipping
2023-10-05 14:55 Sebastian Pipping
2023-10-05 14:55 Sebastian Pipping
2023-07-08 14:23 Sebastian Pipping
2023-07-08 14:19 Sebastian Pipping
2022-01-15 22:00 Sebastian Pipping
2020-11-23 10:09 Sebastian Pipping

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox