This repository has been archived by the owner on Nov 6, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
69 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,3 +4,4 @@ build/ | |
dist/ | ||
|
||
.mypy_cache | ||
files.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import argparse | ||
from pathlib import Path | ||
from rsi import Rsi | ||
|
||
|
||
def main() -> int: | ||
""" | ||
Entry point for the command line rsi utility script. | ||
""" | ||
parser = argparse.ArgumentParser() | ||
subparser = parser.add_subparsers(dest="command") | ||
|
||
_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) | ||
|
||
args = parser.parse_args() | ||
|
||
if args.command == "from_dmi": | ||
from_dmi(args.input, args.output) | ||
return 0 | ||
|
||
print("No command specified!") | ||
return 1 | ||
|
||
|
||
def from_dmi(inputf: Path, output: Path) -> None: | ||
rsi = Rsi.from_dmi(inputf) | ||
rsi.write(output) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#!/usr/bin/env python3 | ||
|
||
import argparse | ||
from pathlib import Path | ||
from rsi import Rsi | ||
|
||
|
||
def main() -> None: | ||
parser = argparse.ArgumentParser() | ||
subparser = parser.add_subparsers(dest="command") | ||
|
||
_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) | ||
|
||
args = parser.parse_args() | ||
|
||
if args.command == "from_dmi": | ||
from_dmi(args.input, args.output) | ||
return | ||
|
||
print("No command specified!") | ||
|
||
|
||
def from_dmi(inputf: Path, output: Path) -> None: | ||
rsi = Rsi.from_dmi(inputf) | ||
rsi.write(output) | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters