aboutsummaryrefslogtreecommitdiff
path: root/SmootCoreObject.py
diff options
context:
space:
mode:
Diffstat (limited to 'SmootCoreObject.py')
-rw-r--r--SmootCoreObject.py23
1 files changed, 23 insertions, 0 deletions
diff --git a/SmootCoreObject.py b/SmootCoreObject.py
new file mode 100644
index 0000000..74e1a9a
--- /dev/null
+++ b/SmootCoreObject.py
@@ -0,0 +1,23 @@
+import Util
+import pdb
+class SmootCoreObject:
+ def __init__(self, argDict):
+ self.argDict = argDict
+ self.init() #call init of inheriting class
+ def init(self):
+ pass
+ def __setitem__(self,k, item):
+ self.argDict[k] = item
+ def __getitem__(self, item):
+ if item in self.argDict:
+ return self.argDict[item]
+ else:
+ return None
+ def __getiter__(self):
+ return self.argDict.__getiter__()
+ def validateArgs(self, argFileName):
+ self.validateArgDict(Util.fileToDict(argFileName))
+ def validateArgDict(self, validationDict):
+ for item in validationDict:
+ if not item in self.argDict:
+ raise Exception(validationDict[item])