summaryrefslogtreecommitdiffstats
path: root/ipalib/public.py
diff options
context:
space:
mode:
authorJason Gerard DeRose <jderose@redhat.com>2008-08-12 18:02:49 +0000
committerJason Gerard DeRose <jderose@redhat.com>2008-08-12 18:02:49 +0000
commit4acb7567c424d2d2525ff23f0cede3e4467d0ba1 (patch)
tree0c05504c6a74818792c173dc1a121cb8dd221f14 /ipalib/public.py
parent7bbeb2db69ffec5a0372e614a3b7eb5194e3b773 (diff)
downloadfreeipa.git-4acb7567c424d2d2525ff23f0cede3e4467d0ba1.tar.gz
freeipa.git-4acb7567c424d2d2525ff23f0cede3e4467d0ba1.tar.xz
freeipa.git-4acb7567c424d2d2525ff23f0cede3e4467d0ba1.zip
117: Improved readability of cmd.print_call()
Diffstat (limited to 'ipalib/public.py')
-rw-r--r--ipalib/public.py14
1 files changed, 8 insertions, 6 deletions
diff --git a/ipalib/public.py b/ipalib/public.py
index 86323822..0dcf71d6 100644
--- a/ipalib/public.py
+++ b/ipalib/public.py
@@ -184,7 +184,7 @@ class cmd(plugable.Plugin):
yield (key, value)
def normalize(self, **kw):
- self.print_call('normalize', kw)
+ self.print_call('normalize', kw, 1)
return dict(self.normalize_iter(kw))
def default_iter(self, kw):
@@ -195,27 +195,29 @@ class cmd(plugable.Plugin):
yield(option.name, value)
def default(self, **kw):
- self.print_call('default', kw)
+ self.print_call('default', kw, 1)
return dict(self.default_iter(kw))
def validate(self, **kw):
- self.print_call('validate', kw)
+ self.print_call('validate', kw, 1)
for (key, value) in kw.items():
if key in self.options:
self.options[key].validate(value)
def execute(self, **kw):
- self.print_call('execute', kw)
+ self.print_call('execute', kw, 1)
pass
- def print_call(self, method, kw):
- print '%s.%s(%s)' % (
+ def print_call(self, method, kw, tab=0):
+ print '%s%s.%s(%s)\n' % (
+ ' ' * (tab *2),
self.name,
method,
', '.join('%s=%r' % (k, v) for (k, v) in kw.items()),
)
def __call__(self, **kw):
+ print ''
self.print_call('__call__', kw)
kw = self.normalize(**kw)
kw.update(self.default(**kw))