Consistancy with yaclog

dev
Andrew Cassidy 3 years ago
parent d1dd6ce24b
commit 1861f7a4b6

@ -1,7 +1,7 @@
# This workflow will upload a Python Package using Twine when a release is created # This workflow will upload a Python Package using Twine when a release is created
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries # For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
name: Upload Python Package name: build
on: [ push, pull_request ] on: [ push, pull_request ]
jobs: jobs:

@ -7,6 +7,8 @@ All notable changes to this project will be documented in this file.
### Changed ### Changed
- Updated API for yaclog to 1.0.0 - Updated API for yaclog to 1.0.0
- Renamed '--input' option to '--path' for consistency with yaclog, and added an environment variable for its value
## 0.2.0 - 2021-05-06 ## 0.2.0 - 2021-05-06
@ -16,6 +18,7 @@ All notable changes to this project will be documented in this file.
- Tweaks and fixes to project metadata in setup.cfg. - Tweaks and fixes to project metadata in setup.cfg.
- Marked version compatibility with yaclog. - Marked version compatibility with yaclog.
## 0.1.1 - 2021-04-16 ## 0.1.1 - 2021-04-16
yaclog-ksp is [now available on PyPi!](https://pypi.org/project/yaclog-ksp/) yaclog-ksp is [now available on PyPi!](https://pypi.org/project/yaclog-ksp/)
@ -24,6 +27,7 @@ yaclog-ksp is [now available on PyPi!](https://pypi.org/project/yaclog-ksp/)
- Generator will now use change values instead of nodes when possible for more concise output files. - Generator will now use change values instead of nodes when possible for more concise output files.
## 0.1.0 - 2021-04-16 ## 0.1.0 - 2021-04-16
First release First release

@ -1,5 +1,7 @@
# yaclog-ksp # yaclog-ksp
[![PyPI version](https://badge.fury.io/py/yaclog-ksp.svg)](https://badge.fury.io/py/yaclog-ksp)
A command line tool based on [yaclog] for converting markdown changelogs to [KerbalChangelog] config files. A command line tool based on [yaclog] for converting markdown changelogs to [KerbalChangelog] config files.
![a yak who is a log](https://github.com/drewcassidy/yaclog/raw/main/logo.png) ![a yak who is a log](https://github.com/drewcassidy/yaclog/raw/main/logo.png)

@ -10,7 +10,7 @@ long_description_content_type = text/markdown
keywords = changelog, commandline, markdown, KSP keywords = changelog, commandline, markdown, KSP
classifiers = classifiers =
Development Status :: 4 - Beta Development Status :: 5 - Production/Stable
Intended Audience :: Developers Intended Audience :: Developers
License :: OSI Approved :: GNU Affero General Public License v3 License :: OSI Approved :: GNU Affero General Public License v3
Operating System :: OS Independent Operating System :: OS Independent

@ -23,17 +23,16 @@ from yaclog_ksp.cfgnode import ConfigNode
@click.command() @click.command()
@click.option('-i', '--input', 'inpath', @click.option('--path', envvar='YACLOG_PATH', default='CHANGELOG.md', show_default=True,
default='CHANGELOG.md', show_default=True, type=click.Path(dir_okay=False, writable=True, readable=True),
type=click.Path(readable=True, exists=True, dir_okay=False), help='Location of the changelog file.')
help="Input markdown file to read from.")
@click.option('-o', '--output', 'outpath', @click.option('-o', '--output', 'outpath',
default=None, default=None,
type=click.Path(writable=True, dir_okay=False), type=click.Path(writable=True, dir_okay=False),
help="Output file to write to. Uses 'GameData/{name}/Versioning/{name}ChangeLog.cfg' by default.") help="Output file to write to. Uses 'GameData/{name}/Versioning/{name}ChangeLog.cfg' by default.")
@click.option('-n', '--name', help="The name of the mod. Derived from the current directory by default.") @click.option('-n', '--name', help="The name of the mod. Derived from the current directory by default.")
@click.version_option() @click.version_option()
def main(inpath, outpath, name): def main(path, outpath, name):
""" Converts markdown changelogs to KSP changelog configs.""" """ Converts markdown changelogs to KSP changelog configs."""
if not name: if not name:
# try to guess name from current directory # try to guess name from current directory
@ -48,7 +47,7 @@ def main(inpath, outpath, name):
# default is in GameData/{name}/Versioning/{name}ChangeLog.cfg # default is in GameData/{name}/Versioning/{name}ChangeLog.cfg
outpath = pathlib.Path('GameData', modslug, 'Versioning', modslug + 'ChangeLog.cfg') outpath = pathlib.Path('GameData', modslug, 'Versioning', modslug + 'ChangeLog.cfg')
log = yaclog.read(inpath) log = yaclog.read(path)
node = ConfigNode() node = ConfigNode()
# find metadata table rows # find metadata table rows

Loading…
Cancel
Save