summaryrefslogtreecommitdiffstats
path: root/simpleconfig.py
diff options
context:
space:
mode:
authorErik Troan <ewt@redhat.com>1999-08-25 23:36:11 +0000
committerErik Troan <ewt@redhat.com>1999-08-25 23:36:11 +0000
commitec5eda29cc3fd6899c9e60006e9cb83de5102675 (patch)
tree4e443e17e73d818595c46d657eee116885d69f51 /simpleconfig.py
parentce3f6d0b037062383ce14ed35cfc28fc65f576b4 (diff)
downloadanaconda-ec5eda29cc3fd6899c9e60006e9cb83de5102675.tar.gz
anaconda-ec5eda29cc3fd6899c9e60006e9cb83de5102675.tar.xz
anaconda-ec5eda29cc3fd6899c9e60006e9cb83de5102675.zip
*** empty log message ***
Diffstat (limited to 'simpleconfig.py')
-rw-r--r--simpleconfig.py33
1 files changed, 33 insertions, 0 deletions
diff --git a/simpleconfig.py b/simpleconfig.py
new file mode 100644
index 000000000..e5a320a3e
--- /dev/null
+++ b/simpleconfig.py
@@ -0,0 +1,33 @@
+import string
+
+class SimpleConfigFile:
+ def __str__ (self):
+ s = ""
+ keys = self.info.keys ()
+ keys.sort ()
+ for key in keys:
+ # FIXME - use proper escaping
+ s = s + key + "=\"" + self.info[key] + "\"\n"
+ return s
+
+ def __init__ (self):
+ self.info = {}
+
+ def set (self, *args):
+ for (key, data) in args:
+ self.info[string.upper (key)] = data
+
+ def unset (self, *keys):
+ for key in keys:
+ key = string.upper (key)
+ if self.info.has_key (key):
+ del self.info[key]
+
+ def get (self, key):
+ key = string.upper (key)
+ if self.info.has_key (key):
+ return self.info[key]
+ else:
+ return ""
+
+