summaryrefslogtreecommitdiffstats
path: root/ipalib/base.py
diff options
context:
space:
mode:
authorJason Gerard DeRose <jderose@redhat.com>2008-07-18 17:51:34 +0000
committerJason Gerard DeRose <jderose@redhat.com>2008-07-18 17:51:34 +0000
commit556abfaf0becbeafa5cad50b2b2866a76e587156 (patch)
tree0ec31962f49123c6c6d65279c9c3054a86254e37 /ipalib/base.py
downloadfreeipa-556abfaf0becbeafa5cad50b2b2866a76e587156.zip
freeipa-556abfaf0becbeafa5cad50b2b2866a76e587156.tar.gz
freeipa-556abfaf0becbeafa5cad50b2b2866a76e587156.tar.xz
1: Started roughing out ipalib package
Diffstat (limited to 'ipalib/base.py')
-rw-r--r--ipalib/base.py45
1 files changed, 45 insertions, 0 deletions
diff --git a/ipalib/base.py b/ipalib/base.py
new file mode 100644
index 0000000..fabc1ac
--- /dev/null
+++ b/ipalib/base.py
@@ -0,0 +1,45 @@
+class Command(object):
+ def normalize(self, kw):
+ raise NotImplementedError
+
+ def validate(self, kw):
+ raise NotImplementedError
+
+ def execute(self, kw):
+ raise NotImplementedError
+
+ def __call__(self, **kw):
+ kw = self.normalize(kw)
+ invalid = self.validate(kw)
+ if invalid:
+ return invalid
+ return self.execute(kw)
+
+
+
+class Argument(object):
+ pass
+
+
+class NameSpace(object):
+ def __init__(self):
+ pass
+
+
+
+
+class API(object):
+ def __init__(self):
+ self.__c = object()
+ self.__o = object()
+
+ def __get_c(self):
+ return self.__c
+ c = property(__get_c)
+
+ def __get_o(self):
+ return self.__o
+ o = property(__get_o)
+
+ def register_command(self, name, callback, override=False):
+ pass