Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compatibility with cstruct v4 #26

Merged
merged 2 commits into from
Jun 4, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions dissect/fat/c_exfat.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from dissect import cstruct
from dissect.cstruct import cstruct

c_exfat_def = """
exfat_def = """
enum entry_types : uint8 {
allocation_bitmap = 0x81,
upcase_table = 0x82,
Expand Down Expand Up @@ -139,8 +139,7 @@
"""

# default endianess is LE so we keep it that way.
c_exfat = cstruct.cstruct()
c_exfat.load(c_exfat_def)
c_exfat = cstruct().load(exfat_def)

EOC = 0xFFFFFFFF # indicates end of cluster chain
FID = 0xFFFFFFF8 # indicates start of FAT
Expand Down
7 changes: 3 additions & 4 deletions dissect/fat/c_fat.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from dissect import cstruct
from dissect.cstruct import cstruct

# https://ogris.de/fatrepair/fat.c
c_fat_def = """
fat_def = """
#define ATTR_READ_ONLY 0x01
#define ATTR_HIDDEN 0x02
#define ATTR_SYSTEM 0x04
Expand Down Expand Up @@ -90,8 +90,7 @@
};
""" # noqa: E501

c_fat = cstruct.cstruct()
c_fat.load(c_fat_def)
c_fat = cstruct().load(fat_def)

Fattype = c_fat.Fattype

Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ classifiers = [
"Topic :: Utilities",
]
dependencies = [
"dissect.cstruct>=3.0.dev,<4.0.dev",
"dissect.util>=3.0.dev,<4.0.dev",
"dissect.cstruct>3,<5",
"dissect.util>2,<4",
]
dynamic = ["version"]

Expand Down
7 changes: 7 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,13 @@ deps =
pytest
pytest-cov
coverage
# Unfortunately, tox does not allow separate installation flags for the project
# dependencies and the test dependencies. When running tox, we want to install the
# project dependencies with the --pre flag, so that we get the latest version of all
# dependencies. We do the installation step ourselves for this reason.
skip_install = true
commands_pre =
pip install --pre -e .
commands =
pytest --basetemp="{envtmpdir}" {posargs:--color=yes --cov=dissect --cov-report=term-missing -v tests}
coverage report
Expand Down