[gentoo-commits] proj/elogv:master commit in: /

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

Release 0.8.3

Signed-off-by: Sebastian Pipping  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 = "lucamartur...@gmail.com"},
 ]



[gentoo-commits] proj/elogv:master commit in: /

2023-10-06 Thread Sebastian Pipping
commit: e2b9632bb66e64283436ae6670dcca680a0e7363
Author: Alfred Wingate  protonmail  com>
AuthorDate: Fri Oct  6 19:55:50 2023 +
Commit: Sebastian Pipping  gentoo  org>
CommitDate: Fri Oct  6 20:47:06 2023 +
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  posteo.org>
Thanks-To: Sam James  gentoo.org>
Thanks-To: Arfrever Frehtes Taifersar Arahesis  gmail.com>
Thanks-To: Ninpo  gap.la>
Signed-off-by: Alfred Wingate  protonmail.com>
Signed-off-by: Sebastian Pipping  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"



[gentoo-commits] proj/elogv:master commit in: /

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

Merge branch 'complete-authors'

Signed-off-by: Sebastian Pipping  gentoo.org>

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



[gentoo-commits] proj/elogv:master commit in: /

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

Merge branch 'pre-commit-github-actions'

Signed-off-by: Sebastian Pipping  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(-)



[gentoo-commits] proj/elogv:master commit in: /

2023-10-06 Thread Sebastian Pipping
commit: 1ebc57704e1536268592ad9bd25af35511da165b
Author: Sebastian Pipping  gentoo  org>
AuthorDate: Fri Oct  6 17:31:02 2023 +
Commit: Sebastian Pipping  gentoo  org>
CommitDate: Fri Oct  6 17:31:04 2023 +
URL:https://gitweb.gentoo.org/proj/elogv.git/commit/?id=1ebc5770

Merge branch 'pyproject-toml-fix-license'

Signed-off-by: Sebastian Pipping  gentoo.org>

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



[gentoo-commits] proj/elogv:master commit in: /

2023-10-06 Thread Sebastian Pipping
commit: b4ac8abd4d2d5f71fe84f65067ec959b8a088376
Author: Sebastian Pipping  gentoo  org>
AuthorDate: Fri Oct  6 13:11:38 2023 +
Commit: Sebastian Pipping  gentoo  org>
CommitDate: Fri Oct  6 13:12:48 2023 +
URL:https://gitweb.gentoo.org/proj/elogv.git/commit/?id=b4ac8abd

Add .mailmap

Signed-off-by: Sebastian Pipping  gentoo.org>

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

diff --git a/.mailmap b/.mailmap
new file mode 100644
index 000..8423dca
--- /dev/null
+++ b/.mailmap
@@ -0,0 +1,2 @@
+# This file is used by "git log"
+Sebastian Pipping  



[gentoo-commits] proj/elogv:master commit in: /

2023-10-06 Thread Sebastian Pipping
commit: a0285263e52366d7f3b9d319cf9c20dc3e2a99a3
Author: Alfred Wingate  protonmail  com>
AuthorDate: Thu Oct  5 23:04:24 2023 +
Commit: Sebastian Pipping  gentoo  org>
CommitDate: Thu Oct  5 23:04:24 2023 +
URL:https://gitweb.gentoo.org/proj/elogv.git/commit/?id=a0285263

pyproject.toml: Add black configuration

Signed-off-by: Alfred Wingate  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)"



[gentoo-commits] proj/elogv:master commit in: /

2023-10-06 Thread Sebastian Pipping
commit: 0783e2f473110526a390349c11146a7a3319523e
Author: Alfred Wingate  protonmail  com>
AuthorDate: Fri Oct  6 00:55:30 2023 +
Commit: Sebastian Pipping  gentoo  org>
CommitDate: Fri Oct  6 00:55:30 2023 +
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  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 000..b72aa08
--- /dev/null
+++ b/.git-blame-ignore-revs
@@ -0,0 +1,4 @@
+# Reformat project with black
+cf01cb49e14730c2323da4ef9f8093935ef93fb9
+# Reformat project with isort
+c08fea8ad853d1508b412f06dd9636273912f1c1



[gentoo-commits] proj/elogv:master commit in: /

2023-10-06 Thread Sebastian Pipping
commit: e53f8a8bb67bf5ab70e0a2b78eec55a6212ad80f
Author: Sebastian Pipping  gentoo  org>
AuthorDate: Fri Oct  6 12:32:52 2023 +
Commit: Sebastian Pipping  gentoo  org>
CommitDate: Fri Oct  6 12:32:56 2023 +
URL:https://gitweb.gentoo.org/proj/elogv.git/commit/?id=e53f8a8b

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

Signed-off-by: Sebastian Pipping  gentoo.org>

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



[gentoo-commits] proj/elogv:master commit in: /

2023-10-06 Thread Sebastian Pipping
commit: 8404693138445a5f5e0cd0b385815fd9eeeb7e22
Author: Alfred Wingate  protonmail  com>
AuthorDate: Fri Oct  6 00:43:38 2023 +
Commit: Sebastian Pipping  gentoo  org>
CommitDate: Fri Oct  6 00:46:00 2023 +
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  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):
 """



[gentoo-commits] proj/elogv:master commit in: /

2023-10-06 Thread Sebastian Pipping
commit: c7e5540703846d21e82b67e0e08ed5c1bb2e14a6
Author: Alfred Wingate  protonmail  com>
AuthorDate: Fri Oct  6 00:25:53 2023 +
Commit: Sebastian Pipping  gentoo  org>
CommitDate: Fri Oct  6 00:27:38 2023 +
URL:https://gitweb.gentoo.org/proj/elogv.git/commit/?id=c7e55407

pyproject.toml: Add ruff configuration

Signed-off-by: Alfred Wingate  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"]



[gentoo-commits] proj/elogv:master commit in: /

2023-10-06 Thread Sebastian Pipping
commit: 6528fb75b639ae1d50eb9580b80aa48e0a449927
Author: Alfred Wingate  protonmail  com>
AuthorDate: Thu Oct  5 23:46:55 2023 +
Commit: Sebastian Pipping  gentoo  org>
CommitDate: Thu Oct  5 23:46:55 2023 +
URL:https://gitweb.gentoo.org/proj/elogv.git/commit/?id=6528fb75

pyproject.toml: Add isort configuration

Signed-off-by: Alfred Wingate  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"]



[gentoo-commits] proj/elogv:master commit in: /

2023-10-06 Thread Sebastian Pipping
commit: c08fea8ad853d1508b412f06dd9636273912f1c1
Author: Alfred Wingate  protonmail  com>
AuthorDate: Thu Oct  5 23:47:18 2023 +
Commit: Sebastian Pipping  gentoo  org>
CommitDate: Thu Oct  5 23:47:18 2023 +
URL:https://gitweb.gentoo.org/proj/elogv.git/commit/?id=c08fea8a

Reformat with isort

Signed-off-by: Alfred Wingate  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=100019
 ## Useful to handle *.po files under distutils



[gentoo-commits] proj/elogv:master commit in: /

2023-10-06 Thread Sebastian Pipping
commit: cf01cb49e14730c2323da4ef9f8093935ef93fb9
Author: Alfred Wingate  protonmail  com>
AuthorDate: Thu Oct  5 23:04:53 2023 +
Commit: Sebastian Pipping  gentoo  org>
CommitDate: Thu Oct  5 23:04:53 2023 +
URL:https://gitweb.gentoo.org/proj/elogv.git/commit/?id=cf01cb49

Reformat with black

Signed-off-by: Alfred Wingate  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
 
 

[gentoo-commits] proj/elogv:master commit in: /

2023-10-05 Thread Sebastian Pipping
commit: 0891d79c221edbf4e0d164f518ccaa8808a16eea
Author: Sebastian Pipping  gentoo  org>
AuthorDate: Thu Oct  5 18:39:07 2023 +
Commit: Sebastian Pipping  gentoo  org>
CommitDate: Thu Oct  5 18:39:07 2023 +
URL:https://gitweb.gentoo.org/proj/elogv.git/commit/?id=0891d79c

Release 0.8.2

Signed-off-by: Sebastian Pipping  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 = "lucamartur...@gmail.com"},
 ]



[gentoo-commits] proj/elogv:master commit in: /

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

Port to lzma

Signed-off-by: Alfred Wingate  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" ]



[gentoo-commits] proj/elogv:master commit in: /

2023-10-05 Thread Sebastian Pipping
commit: af4f13a47320e30d45150b5c22eea28104573e09
Author: Alfred Wingate  protonmail  com>
AuthorDate: Thu Oct  5 16:51:18 2023 +
Commit: Sebastian Pipping  gentoo  org>
CommitDate: Thu Oct  5 17:24:46 2023 +
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  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:



[gentoo-commits] proj/elogv:master commit in: /

2023-10-05 Thread Sebastian Pipping
commit: 04b6fdbf29c6643a3c72d35091dc28a56b5defc6
Author: Sebastian Pipping  gentoo  org>
AuthorDate: Thu Oct  5 17:40:09 2023 +
Commit: Sebastian Pipping  gentoo  org>
CommitDate: Thu Oct  5 17:40:12 2023 +
URL:https://gitweb.gentoo.org/proj/elogv.git/commit/?id=04b6fdbf

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

Signed-off-by: Sebastian Pipping  gentoo.org>

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



[gentoo-commits] proj/elogv:master commit in: /

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

Release 0.8.1

Signed-off-by: Sebastian Pipping  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 = "lucamartur...@gmail.com"},
 ]



[gentoo-commits] proj/elogv:master commit in: /

2023-10-05 Thread Sebastian Pipping
commit: 657162990e7e0765486101fa2924274bb2925564
Author: Sebastian Pipping  gentoo  org>
AuthorDate: Thu Oct  5 14:53:59 2023 +
Commit: Sebastian Pipping  gentoo  org>
CommitDate: Thu Oct  5 14:54:51 2023 +
URL:https://gitweb.gentoo.org/proj/elogv.git/commit/?id=65716299

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

Signed-off-by: Sebastian Pipping  gentoo.org>

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



[gentoo-commits] proj/elogv:master commit in: /

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

pyproject.toml: add dependencies

Signed-off-by: Alfred Wingate  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" ]



[gentoo-commits] proj/elogv:master commit in: /

2023-10-05 Thread Sebastian Pipping
commit: 8234247d0d228d2311a2cb3cc9c710ca828bc759
Author: Alfred Wingate  protonmail  com>
AuthorDate: Thu Oct  5 04:23:14 2023 +
Commit: Sebastian Pipping  gentoo  org>
CommitDate: Thu Oct  5 14:35:33 2023 +
URL:https://gitweb.gentoo.org/proj/elogv.git/commit/?id=8234247d

Move metadata from setup.py to pyproject.toml

Signed-off-by: Alfred Wingate  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 = "lucamartur...@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="lucamartur...@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,



[gentoo-commits] proj/elogv:master commit in: /

2023-07-08 Thread Sebastian Pipping
commit: 30987a47256464ec0abe29e9f88fdbaabd2d8351
Author: Sebastian Pipping  gentoo  org>
AuthorDate: Sat Jul  8 14:22:04 2023 +
Commit: Sebastian Pipping  gentoo  org>
CommitDate: Sat Jul  8 14:22:04 2023 +
URL:https://gitweb.gentoo.org/proj/elogv.git/commit/?id=30987a47

Release 0.8.0

Signed-off-by: Sebastian Pipping  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="lucamartur...@gmail.com",
   license="GPL-2",



[gentoo-commits] proj/elogv:master commit in: /

2023-07-08 Thread Sebastian Pipping
commit: f5b729fbc92b1d9940b2dd9f6bbe6042f0032f7d
Author: Sebastian Pipping  gentoo  org>
AuthorDate: Sat Jul  8 14:16:51 2023 +
Commit: Sebastian Pipping  gentoo  org>
CommitDate: Sat Jul  8 14:16:51 2023 +
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  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,



[gentoo-commits] proj/elogv:master commit in: /

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

Fixed refactor, alignment, breaks, and readibility.

Signed-off-by: Sebastian Pipping  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=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'),
+

[gentoo-commits] proj/elogv:master commit in: /

2020-11-23 Thread Sebastian Pipping
commit: f276f291dfdfb3c6f28814016b103542ccf8c2c7
Author: Sebastian Pipping  gentoo  org>
AuthorDate: Mon Nov 23 10:08:57 2020 +
Commit: Sebastian Pipping  gentoo  org>
CommitDate: Mon Nov 23 10:08:57 2020 +
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  gentoo.org>

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