mirror of
https://github.com/MarioSpore/Grinch-AP.git
synced 2025-10-21 20:21:32 -06:00
move FactorioJSONtoTextParser
This commit is contained in:
@@ -247,14 +247,6 @@ async def main():
|
|||||||
await input_task
|
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):
|
class FactorioJSONtoTextParser(JSONtoTextParser):
|
||||||
def _handle_color(self, node: JSONMessagePart):
|
def _handle_color(self, node: JSONMessagePart):
|
||||||
colors = node["color"].split(";")
|
colors = node["color"].split(";")
|
||||||
@@ -267,3 +259,11 @@ class FactorioJSONtoTextParser(JSONtoTextParser):
|
|||||||
node["text"] = f"[color=pink]{node['text']}[/color]"
|
node["text"] = f"[color=pink]{node['text']}[/color]"
|
||||||
return self._handle_text(node)
|
return self._handle_text(node)
|
||||||
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()
|
||||||
|
Reference in New Issue
Block a user