From f263ea2aaaac06d1511fc4e60c33e5756482ec3f Mon Sep 17 00:00:00 2001 From: Tehom Date: Fri, 10 Feb 2017 07:15:12 -0500 Subject: [PATCH] Allow additional ansi mappings to be passed from settings for easier customization. --- evennia/settings_default.py | 5 ++++- evennia/utils/ansi.py | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/evennia/settings_default.py b/evennia/settings_default.py index 3159eb9122..12284ddf4f 100644 --- a/evennia/settings_default.py +++ b/evennia/settings_default.py @@ -319,7 +319,10 @@ PROTOTYPE_MODULES = ["world.prototypes"] # Module holding settings/actions for the dummyrunner program (see the # dummyrunner for more information) DUMMYRUNNER_SETTINGS_MODULE = "evennia.server.profiling.dummyrunner_settings" - +# Additional mappings used to extend the existing Evennia ANSI mappings. +# All mappings should be a tuple of a string to one of the constants provided +# in ansi.py. For example, (r'%r', "\r\n") +ADDITIONAL_ANSI_MAPPINGS = [] ###################################################################### # Default command sets ###################################################################### diff --git a/evennia/utils/ansi.py b/evennia/utils/ansi.py index cb89babb0a..688b6aeda9 100644 --- a/evennia/utils/ansi.py +++ b/evennia/utils/ansi.py @@ -414,6 +414,7 @@ class ANSIParser(object): (r'|[W', ANSI_BACK_WHITE), # light grey background (r'|[X', ANSI_BACK_BLACK) # pure black background ] + ext_ansi_map += settings.ADDITIONAL_ANSI_MAPPINGS ansi_bright_bgs = [ # "bright" ANSI backgrounds using xterm256 since ANSI