mirror of
https://github.com/drewcassidy/Pillow-mbm.git
synced 2024-09-01 14:44:04 +00:00
Documentation and packaging changes
This commit is contained in:
parent
15dd00b62e
commit
5f6a49618e
41
README.md
41
README.md
@ -1,2 +1,39 @@
|
||||
# pillow-mbm-plugin
|
||||
Pillow plugin for KSP MBM texture files
|
||||
# Pillow-mbm
|
||||
Pillow-mbm is a plugin for [pillow](https://pillow.readthedocs.io/en/stable/)
|
||||
that adds support for KSP's proprietary MBM texture format.
|
||||
|
||||
## Installation
|
||||
|
||||
To install from Pypi, run:
|
||||
|
||||
```shell
|
||||
python -m pip install pillow-mbm
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
To decode MBM files, use the `convert-mbm` command, along with a glob or a
|
||||
list of files to decode. By default, it will convert to png in place.
|
||||
|
||||
```
|
||||
Usage: convert-mbm [OPTIONS] [FILENAMES]...
|
||||
|
||||
Decode Kerbal Space Program MBM files
|
||||
|
||||
Options:
|
||||
-f, --flip / -F, --no-flip Vertically flip image after converting.
|
||||
-r, --remove Remove input images after converting.
|
||||
-s, --suffix TEXT Suffix to append to output file(s). Ignored if
|
||||
output is a single file.
|
||||
|
||||
-x, --extension TEXT Extension to use for output. Ignored if output
|
||||
is a single file. Output filetype is deduced
|
||||
from this [default: .png]
|
||||
|
||||
-o, --output PATH Output file or directory. If outputting to a
|
||||
file, input filenames must be only a single
|
||||
item. By default, files are decoded in place.
|
||||
|
||||
--version Show the version and exit.
|
||||
--help Show this message and exit.
|
||||
```
|
@ -3,6 +3,7 @@ import os
|
||||
import click
|
||||
from typing import List
|
||||
from PIL import Image
|
||||
import pillow_mbm
|
||||
|
||||
|
||||
def get_decoded_extensions(feature: str = 'open') -> List[str]:
|
||||
@ -66,6 +67,7 @@ def path_pairs(inputs, output, suffix, extension):
|
||||
type=click.Path(writable=True), default=None,
|
||||
help="Output file or directory. If outputting to a file, input filenames must be only a single item. By default, files are decoded in place.")
|
||||
@click.argument('filenames', nargs=-1, type=click.Path(exists=True, readable=True, dir_okay=False))
|
||||
@click.version_option(version=pillow_mbm.__version__)
|
||||
def decode(flip, remove, suffix, extension, output, filenames):
|
||||
"""Decode Kerbal Space Program MBM files"""
|
||||
|
||||
|
5
setup.py
5
setup.py
@ -16,10 +16,9 @@ setup(
|
||||
long_description=readme,
|
||||
long_description_content_type='text/markdown',
|
||||
python_requires=">=3.7",
|
||||
install_requires=['Pillow'],
|
||||
extras_require={'CLI': ['click']},
|
||||
install_requires=['Pillow', 'click'],
|
||||
entry_points={
|
||||
'console_scripts': ['convert-mbm = pillow_mbm.__main__:decode [CLI]']
|
||||
'console_scripts': ['convert-mbm = pillow_mbm.__main__:decode']
|
||||
},
|
||||
package_dir={'': '.'},
|
||||
packages=['pillow_mbm'],
|
||||
|
Loading…
Reference in New Issue
Block a user