From 6abcede7e88c7c6ccbb2c2581530d6fc8d699cb4 Mon Sep 17 00:00:00 2001 From: Shawn Davis Date: Sat, 29 Jan 2022 20:46:43 -0600 Subject: [PATCH] Added `load_variables()` to all. --- scripttease/lib/contexts.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/scripttease/lib/contexts.py b/scripttease/lib/contexts.py index 116ec7c..ebc8e5c 100644 --- a/scripttease/lib/contexts.py +++ b/scripttease/lib/contexts.py @@ -10,6 +10,7 @@ log = logging.getLogger(__name__) # Exports __all__ = ( + "load_variables", "Context", "Variable", ) @@ -85,6 +86,15 @@ class Context(object): return v + def append(self, variable): + """Append a variable to the context. + + :param variable: The variable to be added to the context. + :type variable: scripttease.lib.contexts.Variable + + """ + self.variables[variable.name] = variable + def mapping(self): """Get the context as a dictionary.