From 6eb09ced80d25e6a061c0a062dc587a517ae10f6 Mon Sep 17 00:00:00 2001 From: PJB3005 Date: Tue, 18 Sep 2018 10:15:40 +0200 Subject: [PATCH] Add --license and --copyright args. --- .editorconfig | 2 +- .gitignore | 1 + scripts/RSI.py | 11 +++++++++-- setup.py | 2 +- 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/.editorconfig b/.editorconfig index fc5ce20..abc9307 100644 --- a/.editorconfig +++ b/.editorconfig @@ -1,5 +1,5 @@ [*.py] insert_final_newline = true indent_size = 4 -indent_style = 4 +indent_style = space trim_trailing_whitespace = true diff --git a/.gitignore b/.gitignore index 6d90556..3f3111b 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,4 @@ dist/ .mypy_cache files.txt .vscode +.idea \ No newline at end of file diff --git a/scripts/RSI.py b/scripts/RSI.py index 2b13ef3..9a0b7a7 100755 --- a/scripts/RSI.py +++ b/scripts/RSI.py @@ -3,6 +3,7 @@ import argparse from pathlib import Path from rsi import Rsi +from typing import Optional def main() -> None: @@ -12,18 +13,24 @@ def main() -> None: _from_dmi = subparser.add_parser("from_dmi", help="Will create an RSI from a BYOND DMI file.") _from_dmi.add_argument("input", help="The DMI file to read from.", type=Path) _from_dmi.add_argument("output", help="The RSI to output to.", type=Path) + _from_dmi.add_argument("--license", help="Specifies the license of the new RSI file.") + _from_dmi.add_argument("--copyright", help="Specifies the copyright of the new RSI file.") args = parser.parse_args() if args.command == "from_dmi": - from_dmi(args.input, args.output) + from_dmi(args.input, args.output, args.license, args.copyright) return print("No command specified!") -def from_dmi(inputf: Path, output: Path) -> None: +def from_dmi(inputf: Path, output: Path, new_license: Optional[str], new_copyright: Optional[str]) -> None: rsi = Rsi.from_dmi(inputf) + if new_license: + rsi.license = new_license + if new_copyright: + rsi.copyright = new_copyright rsi.write(output) diff --git a/setup.py b/setup.py index 09f3179..0323359 100755 --- a/setup.py +++ b/setup.py @@ -3,7 +3,7 @@ setup( name="RSI.py", - version="1.1.4", + version="1.1.5", description="A library for manipulation of the RSI format used in Space Station 14.", url="https://github.com/space-wizards/RSI.py", author="Pieter-Jan Briers",