From 931aa37e1a8e7cc81b0ed53bc5587ad549300f90 Mon Sep 17 00:00:00 2001 From: Griatch Date: Tue, 15 Oct 2019 19:23:37 +0200 Subject: [PATCH] Add $space() inlinefunc to default set. --- evennia/utils/inlinefuncs.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/evennia/utils/inlinefuncs.py b/evennia/utils/inlinefuncs.py index 716c8469f..87e18a8d2 100644 --- a/evennia/utils/inlinefuncs.py +++ b/evennia/utils/inlinefuncs.py @@ -129,6 +129,22 @@ def crop(*args, **kwargs): return utils.crop(text, width=width, suffix=suffix) +def space(*args, **kwargs): + """ + Inlinefunc. Inserts an arbitrary number of spaces. Defaults to 4 spaces. + + Args: + spaces (int, optional): The number of spaces to insert. + Kwargs: + session (Session): Session performing the crop. + + """ + width = 4 + if args: + width = abs(int(args[0])) if args[0].strip().isdigit() else 4 + return " " * width + + def clr(*args, **kwargs): """ Inlinefunc. Colorizes nested text.