1
0
mirror of https://github.com/mon/ifstools.git synced 2024-11-12 04:30:50 +01:00

pip installable and globally runnable

This commit is contained in:
Will Toohey 2018-01-05 02:14:17 +10:00
parent 1767a83033
commit 34a400d022
17 changed files with 37 additions and 5 deletions

3
.gitignore vendored
View File

@ -2,3 +2,6 @@ __pycache__/
*.ifs
*_ifs
*.pyc
build/
dist/
ifstools.egg-info/

View File

@ -12,11 +12,11 @@ Extractor for Konmai IFS files.
- Dumps the ifs manifest so you can explore the format
## Install
`pip install -r requirements.txt`
`pip install git+https://github.com/mon/kbinxml/ git+https://github.com/mon/ifstools/`
## Usage
```
usage: ifstools.py [-h] [-y] [-o OUT_DIR] [--tex-only] [--nocache] [-s] [-r]
usage: ifstools [-h] [-y] [-o OUT_DIR] [--tex-only] [--nocache] [-s] [-r]
file.ifs|folder_ifs [file.ifs|folder_ifs ...]
Unpack/pack IFS files and textures

View File

@ -1 +0,0 @@
from .ifs import IFS

2
ifstools/__init__.py Normal file
View File

@ -0,0 +1,2 @@
from .ifstools import main
from .ifs import IFS

View File

@ -7,7 +7,7 @@ except NameError:
# py 3
pass
from ifs import IFS
from .ifs import IFS
def get_choice(prompt):
while True:
@ -21,7 +21,7 @@ def get_choice(prompt):
else:
print('Please answer y/n')
if __name__ == '__main__':
def main():
parser = argparse.ArgumentParser(description='Unpack/pack IFS files and textures')
parser.add_argument('files', metavar='file.ifs|folder_ifs', type=str, nargs='+',
help='files/folders to process. Files will be unpacked, folders will be repacked')
@ -55,3 +55,7 @@ if __name__ == '__main__':
i.extract(args.progress, args.use_cache, args.recurse, args.tex_only, path)
else:
i.repack(args.progress, args.use_cache, path)
if __name__ == '__main__':
main()

24
setup.py Normal file
View File

@ -0,0 +1,24 @@
from setuptools import setup
import sys
requires = [
'lxml',
'tqdm',
'pillow',
]
if sys.version_info < (3,0):
requires.append('future')
setup(
name='ifstools',
version='1.0',
entry_points = {
'console_scripts': ['ifstools=ifstools:main'],
},
packages=['ifstools', 'ifstools.handlers'],
url='https://github.com/mon/ifstools/',
author='mon',
author_email='me@mon.im',
install_requires=requires,
)