mirror of
https://github.com/evennia/evennia.git
synced 2026-04-06 16:44:08 +02:00
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.
This commit is contained in:
parent
4b41edca46
commit
9bcfb01102
1 changed files with 4 additions and 4 deletions
|
|
@ -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):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue