summaryrefslogtreecommitdiffstats
path: root/ipalib/plugins.py
diff options
context:
space:
mode:
authorJason Gerard DeRose <jderose@redhat.com>2008-07-21 01:44:59 +0000
committerJason Gerard DeRose <jderose@redhat.com>2008-07-21 01:44:59 +0000
commit7273d48169a6c0dabc1bfb0f42bafb06515fdac9 (patch)
tree024a1ecf671d046a5330ba98b2f7e7327fd956e3 /ipalib/plugins.py
parent48c7da47c78c5b5f97dc01a7593313943aef7b6e (diff)
downloadfreeipa-7273d48169a6c0dabc1bfb0f42bafb06515fdac9.tar.gz
freeipa-7273d48169a6c0dabc1bfb0f42bafb06515fdac9.tar.xz
freeipa-7273d48169a6c0dabc1bfb0f42bafb06515fdac9.zip
26: Added AbstractCommand.get_doc() method to return the gettext translated summary of command; added get_doc() method to all example
Diffstat (limited to 'ipalib/plugins.py')
-rw-r--r--ipalib/plugins.py61
1 files changed, 44 insertions, 17 deletions
diff --git a/ipalib/plugins.py b/ipalib/plugins.py
index 7c1dcf910..85f3a9f46 100644
--- a/ipalib/plugins.py
+++ b/ipalib/plugins.py
@@ -26,21 +26,37 @@ import base
from run import api
+# Hypothetical functional commands (not associated with any object):
+class krbtest(base.Command):
+ def get_doc(self, _):
+ return _('test your Kerberos ticket')
+api.register(krbtest)
+
+class discover(base.Command):
+ def get_doc(self, _):
+ return _('discover IPA servers on network')
+api.register(discover)
+
+
# Register some methods for the 'user' object:
class user__add(crud.Add):
- pass
+ def get_doc(self, _):
+ return _('add new user')
api.register(user__add)
class user__del(crud.Del):
- pass
+ def get_doc(self, _):
+ return _('delete existing user')
api.register(user__del)
class user__mod(crud.Mod):
- pass
+ def get_doc(self, _):
+ return _('edit existing user')
api.register(user__mod)
class user__find(crud.Find):
- pass
+ def get_doc(self, _):
+ return _('search for users')
api.register(user__find)
@@ -53,57 +69,68 @@ class user__lastname(base.Property):
pass
api.register(user__lastname)
-class user__lastname(base.Property):
+class user__login(base.Property):
pass
-api.register(user__lastname)
+api.register(user__login)
# Register some methods for the 'group' object:
class group__add(crud.Add):
- pass
+ def get_doc(self, _):
+ return _('add new group')
api.register(group__add)
class group__del(crud.Del):
- pass
+ def get_doc(self, _):
+ return _('delete existing group')
api.register(group__del)
class group__mod(crud.Mod):
- pass
+ def get_doc(self, _):
+ return _('exit existing group')
api.register(group__mod)
class group__find(crud.Find):
- pass
+ def get_doc(self, _):
+ return _('search for groups')
api.register(group__find)
# Register some methods for the 'service' object
class service__add(crud.Add):
- pass
+ def get_doc(self, _):
+ return _('add new service')
api.register(service__add)
class service__del(crud.Del):
- pass
+ def get_doc(self, _):
+ return _('delete existing service')
api.register(service__del)
class service__mod(crud.Mod):
- pass
+ def get_doc(self, _):
+ return _('edit existing service')
api.register(service__mod)
class service__find(crud.Find):
- pass
+ def get_doc(self, _):
+ return _('search for services')
api.register(service__find)
# And to emphasis that the registration order doesn't matter,
# we'll register the objects last:
class group(base.Object):
- pass
+ def get_doc(self, _):
+ return _('')
api.register(group)
class service(base.Object):
- pass
+ def get_doc(self, _):
+ return _('')
api.register(service)
class user(base.Object):
- pass
+ def get_doc(self, _):
+ return _('')
api.register(user)