-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Select between native and Python implementations of lz4 and lzo
Two new extra's "lz4" and "lzo" are defined which will install the needed Python packages to do naitve lz4 and lzo decompression. When installed the dissect.util.compression.lz4 and dissect.util.compression.lzo modules will point to these native versions. Otherwise they will point to the pure Python implementations in this project. The native (when available) and Python modules can be accessed explicitly through: - dissect.util.compression.lz4_native - dissect.util.compression.lz4_python - dissect.util.compression.lzo_native - dissect.util.compression.lzo_python
- Loading branch information
Showing
3 changed files
with
46 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
from dissect.util.compression import lz4 as lz4_python | ||
from dissect.util.compression import lzo as lzo_python | ||
|
||
try: | ||
import lz4.block as lz4 | ||
import lz4.block as lz4_native | ||
except ImportError: | ||
lz4 = lz4_python | ||
lz4_native = None | ||
|
||
try: | ||
import lzo | ||
import lzo as lzo_native | ||
except ImportError: | ||
lzo = lzo_python | ||
lzo_native = None | ||
|
||
__all__ = [ | ||
"lz4", | ||
"lz4_native", | ||
"lz4_python", | ||
"lznt1", | ||
"lzo", | ||
"lzo_native", | ||
"lzo_python", | ||
"lzxpress", | ||
"lzxpress_huffman", | ||
"sevenbit", | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters