From 33fa9542e04b26598a4e096f455c0667bc80c120 Mon Sep 17 00:00:00 2001 From: Fabian Dill Date: Sun, 6 Jun 2021 22:49:37 +0200 Subject: [PATCH] move FactorioJSONtoTextParser --- FactorioClient.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/FactorioClient.py b/FactorioClient.py index b3ae13de..5b4c5734 100644 --- a/FactorioClient.py +++ b/FactorioClient.py @@ -247,14 +247,6 @@ async def main(): await input_task -if __name__ == '__main__': - colorama.init() - loop = asyncio.get_event_loop() - loop.run_until_complete(main()) - loop.close() - colorama.deinit() - - class FactorioJSONtoTextParser(JSONtoTextParser): def _handle_color(self, node: JSONMessagePart): colors = node["color"].split(";") @@ -267,3 +259,11 @@ class FactorioJSONtoTextParser(JSONtoTextParser): node["text"] = f"[color=pink]{node['text']}[/color]" return self._handle_text(node) return self._handle_text(node) + + +if __name__ == '__main__': + colorama.init() + loop = asyncio.get_event_loop() + loop.run_until_complete(main()) + loop.close() + colorama.deinit()