aboutsummaryrefslogtreecommitdiff
path: root/operationscore/SmootCoreObject.py
diff options
context:
space:
mode:
Diffstat (limited to 'operationscore/SmootCoreObject.py')
-rw-r--r--operationscore/SmootCoreObject.py23
1 files changed, 23 insertions, 0 deletions
diff --git a/operationscore/SmootCoreObject.py b/operationscore/SmootCoreObject.py
new file mode 100644
index 0000000..2901ef6
--- /dev/null
+++ b/operationscore/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.loadParamRequirementDict(argFileName))
+ def validateArgDict(self, validationDict):
+ for item in validationDict:
+ if not item in self.argDict:
+ raise Exception(validationDict[item])