0 | |
From: renaud gaudin <reg@rskg.org>
|
1 | |
Date: Mon, 11 Jul 2022 16:07:13 +0000
|
2 | |
Subject: Fixed #150: removed lzma compression option
|
3 | |
|
4 | |
Origin: https://github.com/openzim/python-libzim/commit/a6d704fb334409ee9a24325f3ebc3c598a124ec9
|
5 | |
---
|
6 | |
libzim/libwrapper.cpp | 2 --
|
7 | |
libzim/libzim.pyx | 3 +--
|
8 | |
libzim/zim.pxd | 1 -
|
9 | |
tests/test_libzim_creator.py | 4 ++--
|
10 | |
4 files changed, 3 insertions(+), 7 deletions(-)
|
11 | |
|
12 | |
diff --git a/libzim/libwrapper.cpp b/libzim/libwrapper.cpp
|
13 | |
index d0447b2..83e1971 100644
|
14 | |
--- a/libzim/libwrapper.cpp
|
15 | |
+++ b/libzim/libwrapper.cpp
|
16 | |
@@ -172,8 +172,6 @@ zim::Compression comp_from_int(int compValue)
|
17 | |
case 0:
|
18 | |
return zim::Compression::None;
|
19 | |
case 1:
|
20 | |
- return zim::Compression::Lzma;
|
21 | |
- case 2:
|
22 | |
return zim::Compression::Zstd;
|
23 | |
default:
|
24 | |
// Should we raise an error ?
|
25 | |
diff --git a/libzim/libzim.pyx b/libzim/libzim.pyx
|
26 | |
index 8fe60d5..c00b5ce 100644
|
27 | |
--- a/libzim/libzim.pyx
|
28 | |
+++ b/libzim/libzim.pyx
|
29 | |
@@ -190,8 +190,7 @@ class Compression(enum.Enum):
|
30 | |
# We don't care of the exact value. The function comp_from_int will do the right
|
31 | |
# conversion to zim::Compression
|
32 | |
none = 0
|
33 | |
- lzma = 1
|
34 | |
- zstd = 2
|
35 | |
+ zstd = 1
|
36 | |
|
37 | |
|
38 | |
class Hint(enum.Enum):
|
39 | |
diff --git a/libzim/zim.pxd b/libzim/zim.pxd
|
40 | |
index 2ebc4ab..dd32c37 100644
|
41 | |
--- a/libzim/zim.pxd
|
42 | |
+++ b/libzim/zim.pxd
|
43 | |
@@ -35,7 +35,6 @@ cdef extern from "zim/zim.h" namespace "zim":
|
44 | |
# We need to declare something here to be syntaxically correct
|
45 | |
# but we don't use those values (even if they are valid).
|
46 | |
None "zim::Compression::None"
|
47 | |
- Lzma "zim::Compression::Lzma"
|
48 | |
Zstd "zim::Compression::Zstd"
|
49 | |
|
50 | |
|
51 | |
diff --git a/tests/test_libzim_creator.py b/tests/test_libzim_creator.py
|
52 | |
index 325a79d..b4f1d48 100644
|
53 | |
--- a/tests/test_libzim_creator.py
|
54 | |
+++ b/tests/test_libzim_creator.py
|
55 | |
@@ -254,7 +254,7 @@ def test_creator_nbworkers(fpath, lipsum_item, nb_workers):
|
56 | |
|
57 | |
def test_creator_combine_config(fpath, lipsum_item):
|
58 | |
with Creator(fpath).config_verbose(True).config_compression(
|
59 | |
- "lzma"
|
60 | |
+ "zstd"
|
61 | |
).config_clustersize(1024).config_indexing(True, "eng").config_nbworkers(2) as c:
|
62 | |
c.add_item(lipsum_item)
|
63 | |
|
64 | |
@@ -263,7 +263,7 @@ def test_creator_combine_config(fpath, lipsum_item):
|
65 | |
"name, args",
|
66 | |
[
|
67 | |
("verbose", (True,)),
|
68 | |
- ("compression", ("lzma",)),
|
69 | |
+ ("compression", ("zstd",)),
|
70 | |
("clustersize", (1024,)),
|
71 | |
("indexing", (True, "eng")),
|
72 | |
("nbworkers", (2,)),
|