roar/assets/tools/AnsiToMiRCART.py
Lucio Andrés Illanes Albornoz 0c66f94797 Cleanup, bugfixes & C++ backend implementation.
1) {About,Melp?} window: switch to green on black.
2) Assets window: scroll assets list on selected item update w/ <Cursor> or on deletion.
3) Canvas window: change default brush colours to [3, -1].
4) Canvas window: copy canvas cells given transparent cells from tools.
5) Canvas window: don't disable {re,un}do during object tool usage.
6) Canvas window: don't hide cursor during {re,un}do.
7) Canvas window: draw new cells using current brush background colour on resize.
8) Canvas window: fix memory leak on cell size updating.
9) Text tool: process [\r\n] in text pasted from clipboard.

assets/audio/roar{vap0r[1-8],viking[1-5]}.wav: added.
assets/text/README.txt: updated.
assets/tools/AnsiToMiRCART.py: added (for spoke.)
assets/tools/deploy-python.sh: updated.
2019-10-24 21:14:00 +02:00

32 lines
1.1 KiB
Python
Executable File

#!/usr/bin/env python3
#
# AnsiToMiRCART.py -- convert ANSI to mIRC art file (for spoke)
# Copyright (c) 2019 Lucio Andrés Illanes Albornoz <lucio@lucioillanes.de>
# This project is licensed under the terms of the MIT licence.
#
import os, sys
[sys.path.append(os.path.join(os.getcwd(), "..", "..", path)) for path in ["libcanvas", "librtl"]]
from CanvasExportStore import CanvasExportStore
from CanvasImportStore import CanvasImportStore
#
# Entry point
def main(*argv):
if (len(sys.argv) - 1) != 2:
print("usage: {} <ANSI input file pathname> <mIRC art output file pathname>".format(sys.argv[0]), file=sys.stderr)
else:
canvasImportStore = CanvasImportStore()
rc, error = canvasImportStore.importAnsiFile(argv[1])
if rc:
canvasExportStore = CanvasExportStore()
with open(argv[2], "w", encoding="utf-8") as outFile:
canvasExportStore.exportTextFile(canvasImportStore.outMap, canvasImportStore.inSize, outFile)
else:
print("error: {}".format(error), file=sys.stderr)
if __name__ == "__main__":
main(*sys.argv)
# vim:expandtab foldmethod=marker sw=4 ts=4 tw=120