From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 86E12158089 for ; Thu, 5 Oct 2023 17:41:22 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id B77B02BC03B; Thu, 5 Oct 2023 17:41:21 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 9CED02BC03B for ; Thu, 5 Oct 2023 17:41:21 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 6FDFA335D16 for ; Thu, 5 Oct 2023 17:41:20 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id AC68F9C9 for ; Thu, 5 Oct 2023 17:41:18 +0000 (UTC) From: "Sebastian Pipping" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Sebastian Pipping" Message-ID: <1696526794.1d95e751bd8d0628f1b83ca667cc1d4cd18066a1.sping@gentoo> Subject: [gentoo-commits] proj/elogv:master commit in: / X-VCS-Repository: proj/elogv X-VCS-Files: elogv pyproject.toml X-VCS-Directories: / X-VCS-Committer: sping X-VCS-Committer-Name: Sebastian Pipping X-VCS-Revision: 1d95e751bd8d0628f1b83ca667cc1d4cd18066a1 X-VCS-Branch: master Date: Thu, 5 Oct 2023 17:41:18 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 7f9edd9a-e9c4-4b19-943c-64714a7a228b X-Archives-Hash: f931f3acccf0f27677590582c0dc20a9 commit: 1d95e751bd8d0628f1b83ca667cc1d4cd18066a1 Author: Alfred Wingate protonmail com> AuthorDate: Thu Oct 5 16:56:45 2023 +0000 Commit: Sebastian Pipping gentoo 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 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" ]