Skip to content

Commit

Permalink
Used kaitaiStructCompile for automatical retriving the formats repo a…
Browse files Browse the repository at this point in the history
…nd generating the parsers
  • Loading branch information
KOLANICH committed Feb 8, 2018
1 parent ceeffba commit 68b75ee
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 3 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -97,3 +97,6 @@ ENV/

# mypy
.mypy_cache/

# Kaitai Struct formats library downloaded by kaitaiStructCompile
/kaitai_struct_formats
5 changes: 3 additions & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ kaitaifs = kaitaifs.cli:main
zip_safe = True
include_package_data = True
packages = find:
setup_requires = setuptools_scm;
setup_requires = setuptools_scm; kaitaiStructCompile;
dependency_links = ["git+https://github.com/KOLANICH/kaitaiStructCompile.py.git"]

[build-system]
requires = ["setuptools", "setuptools_scm", "wheel"]
requires = ["setuptools", "setuptools_scm", "wheel", "kaitaiStructCompile"]
20 changes: 19 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,26 @@
from setuptools.config import read_configuration
from pathlib import Path

cfg = read_configuration(str(Path(__file__).parent / 'setup.cfg'))
thisDir = Path(__file__).parent
formatsPath = thisDir / "kaitai_struct_formats"
cfg = read_configuration(str(thisDir / 'setup.cfg'))

#print(cfg)
cfg["options"].update(cfg["metadata"])
cfg = cfg["options"]
cfg["kaitai"] = {
"formatsRepo": {
"localPath" : str(formatsPath),
"update": True,
},
"formats": {
"heroes_of_might_and_magic_agg.py": {"path": "game/heroes_of_might_and_magic_agg.ksy"},
"quake_pak.py": {"path": "game/quake_pak.ksy"},
"iso9660.py": {"path": "filesystem/iso9660.ksy"},
"rar.py": {"path": "archive/rar.ksy"},
},
"outputDir": thisDir / "kaitaifs" / "parser",
"inputDir": formatsPath,
}

setup(**cfg)

0 comments on commit 68b75ee

Please sign in to comment.