Add init and setData functions to oedata.
authorChris Larson <clarson@kergoth.com>
Sat, 14 Jun 2003 02:44:20 +0000 (02:44 +0000)
committerChris Larson <clarson@kergoth.com>
Sat, 14 Jun 2003 02:44:20 +0000 (02:44 +0000)
bin/oedata.py

index 363be8e..44e4fb6 100644 (file)
@@ -5,6 +5,9 @@
 
 _data = {}
 
+def init(d = _data):
+       d = {}
+
 def initVar(var, d = _data):
        """Non-destructive var init for data structure"""
        if not d.has_key(var):
@@ -63,6 +66,10 @@ def getData(d = _data):
        """Returns the data object used"""
        return d
 
+def setData(newData, d = _data):
+       """Sets the data object to the supplied value"""
+       d = newData
+
 import re
 
 __expand_var_regexp__ = re.compile(r"\${[^{}]+}")