From d77ac06a475731ad535a7ad2d2b912ffd1d74520 Mon Sep 17 00:00:00 2001 From: Andrew Bastien Date: Thu, 11 May 2023 20:46:15 -0400 Subject: [PATCH] Made some slight adjustments to CmdPy so that it can signify the output options ought to be highlighted. This'll come in handy later with the Rich Integration. --- evennia/commands/default/system.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/evennia/commands/default/system.py b/evennia/commands/default/system.py index 574eb24289..1d631b43bd 100644 --- a/evennia/commands/default/system.py +++ b/evennia/commands/default/system.py @@ -179,7 +179,6 @@ def _run_code_snippet( """ # Try to retrieve the session - session = caller if hasattr(caller, "sessions"): sessions = caller.sessions.all() @@ -187,7 +186,7 @@ def _run_code_snippet( if show_input: for session in sessions: - data = {"text": (f">>> {pycode}", {"type": "py_input"}), "options": {"raw": True}} + data = {"text": (f">>> {pycode}", {"type": "py_input"}), "options": {"raw": True, "highlight": True}} try: caller.msg(session=session, **data) except TypeError: @@ -244,9 +243,10 @@ def _run_code_snippet( for session in sessions: try: - caller.msg((ret, {"type": "py_output"}), session=session, options={"raw": True, "client_raw": client_raw}) + caller.msg((ret, {"type": "py_output"}), session=session, options={"raw": True, "client_raw": client_raw, + "highlight": True}) except TypeError: - caller.msg((ret, {"type": "py_output"}), options={"raw": True, "client_raw": client_raw}) + caller.msg((ret, {"type": "py_output"}), options={"raw": True, "client_raw": client_raw, "highlight": True}) def evennia_local_vars(caller):