Skip to content

Commit b1241c4

Browse files
committed
feat: export constants &cie from lzma
1 parent c9d3230 commit b1241c4

File tree

2 files changed

+61
-0
lines changed

2 files changed

+61
-0
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ adheres to [Semantic Versioning](https://semver.org/).
1313

1414
- Allow to `seek` past the end of the fileobj
1515
- Calling `len` on a fileobj gives its length, and `bool` tells if it is empty
16+
- Export useful constants and functions from `lzma` for easy access: checks, filters,
17+
etc.
1618

1719
### :house: Internal
1820

src/xz/__init__.py

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,39 @@
1+
from lzma import (
2+
CHECK_CRC32,
3+
CHECK_CRC64,
4+
CHECK_ID_MAX,
5+
CHECK_NONE,
6+
CHECK_SHA256,
7+
CHECK_UNKNOWN,
8+
FILTER_ARM,
9+
FILTER_ARMTHUMB,
10+
FILTER_DELTA,
11+
FILTER_IA64,
12+
FILTER_LZMA1,
13+
FILTER_LZMA2,
14+
FILTER_POWERPC,
15+
FILTER_SPARC,
16+
FILTER_X86,
17+
MF_BT2,
18+
MF_BT3,
19+
MF_BT4,
20+
MF_HC3,
21+
MF_HC4,
22+
MODE_FAST,
23+
MODE_NORMAL,
24+
PRESET_DEFAULT,
25+
PRESET_EXTREME,
26+
compress,
27+
decompress,
28+
is_check_supported,
29+
)
30+
131
try:
232
from xz._version import __version__
333
except ImportError: # pragma: no cover
434
__version__ = "0.0.0.dev0-unknown"
535

36+
637
from xz.common import XZError
738
from xz.file import XZFile
839
from xz.open import xz_open
@@ -17,4 +48,32 @@
1748
"XZError",
1849
"XZFile",
1950
"open",
51+
# re-export from lzma for easy access
52+
"CHECK_CRC32",
53+
"CHECK_CRC64",
54+
"CHECK_ID_MAX",
55+
"CHECK_NONE",
56+
"CHECK_SHA256",
57+
"CHECK_UNKNOWN",
58+
"FILTER_ARM",
59+
"FILTER_ARMTHUMB",
60+
"FILTER_DELTA",
61+
"FILTER_IA64",
62+
"FILTER_LZMA1",
63+
"FILTER_LZMA2",
64+
"FILTER_POWERPC",
65+
"FILTER_SPARC",
66+
"FILTER_X86",
67+
"MF_BT2",
68+
"MF_BT3",
69+
"MF_BT4",
70+
"MF_HC3",
71+
"MF_HC4",
72+
"MODE_FAST",
73+
"MODE_NORMAL",
74+
"PRESET_DEFAULT",
75+
"PRESET_EXTREME",
76+
"compress",
77+
"decompress",
78+
"is_check_supported",
2079
)

0 commit comments

Comments
 (0)