diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index 61b1c60..e4deaa4 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -5,7 +5,7 @@ name: Upload Python Package on: release: # Only use the types keyword to narrow down the activity types that will trigger your workflow. - types: [published, created, edited] + types: [published] jobs: deploy: diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..14491d2 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,11 @@ +# Changelog +All notable changes to this project will be documented in this file + + +## 0.1.3 - 2021-04-13 +### Added +- new `--verbose` command line option that prints the input and output path for each file + +## 0.1.2 - 2021-04-12 +### Added +- First stable release \ No newline at end of file diff --git a/pillow_mbm/__main__.py b/pillow_mbm/__main__.py index a34f298..5d656ca 100644 --- a/pillow_mbm/__main__.py +++ b/pillow_mbm/__main__.py @@ -66,14 +66,18 @@ def path_pairs(inputs, output, suffix, extension): @click.option('-o', '--output', 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.option('-v', '--verbose', is_flag=True, help="print more information") @click.argument('filenames', nargs=-1, type=click.Path(exists=True, readable=True, dir_okay=False)) @click.version_option(version=pillow_mbm.__version__) -def convert_mbm(flip, remove, suffix, extension, output, filenames): +def convert_mbm(flip, remove, suffix, extension, output, verbose, filenames): """Decode Kerbal Space Program MBM files""" pairs = path_pairs(filenames, output, suffix, extension) - with click.progressbar(pairs, show_eta=False, show_pos=True, item_show_func=lambda x: str(x[0]) if x else '') as bar: + with click.progressbar(pairs, show_eta=False, show_pos=True, item_show_func=lambda x: f'{x[0]}->{x[1]}' if x else '') as bar: + if verbose: + bar.is_hidden = True + for inpath, outpath in bar: image = Image.open(inpath) @@ -85,6 +89,12 @@ def convert_mbm(flip, remove, suffix, extension, output, filenames): if remove: os.remove(inpath) + if verbose: + print(f'Converting: {inpath} -> {outpath}') + + if verbose: + print(f'Done: converted {len(pairs)} files') + if __name__ == '__main__': convert_mbm() diff --git a/pillow_mbm/version.py b/pillow_mbm/version.py index 10939f0..8ce9b36 100644 --- a/pillow_mbm/version.py +++ b/pillow_mbm/version.py @@ -1 +1 @@ -__version__ = '0.1.2' +__version__ = '0.1.3' diff --git a/setup.py b/setup.py index df7a10d..e51268a 100644 --- a/setup.py +++ b/setup.py @@ -13,7 +13,6 @@ setup( name='pillow-mbm', description="A pillow plugin that adds support for KSP's MBM textures", version=__version__, - license='AGPL', url='https://github.com/drewcassidy/Pillow-mbm', author='Andrew Cassidy', long_description=readme,