From 9248be5ac01d005b03e4d7e190bff4e26a5015a2 Mon Sep 17 00:00:00 2001 From: Johannes Findeisen Date: Mon, 19 Aug 2013 02:08:17 +0200 Subject: [PATCH] nice to play with ruffs Lish! that will be more fun in the future.... --- lib/frontends/lish.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/lib/frontends/lish.py b/lib/frontends/lish.py index 575ebf1..1a23f20 100644 --- a/lib/frontends/lish.py +++ b/lib/frontends/lish.py @@ -93,12 +93,20 @@ class Exit(Cmd, object): help_EOF = help_exit +class LogCommander(Cmd, object): + def do_log(self, text): + print("executed %s" % text) + + def help_log(self): + print("manage logging") + + class ShellCommander(Cmd, object): def do_shell(self, text): os.system(text) def help_shell(self): - print("execute any shell command. Can also be archieved by a '!' postfix") + print("execute any shell command. Can also be achieved by a '!' postfix") class HostgroupCommander(Exit, object): @@ -117,7 +125,7 @@ class HostgroupCommander(Exit, object): print("gives you control over a member of the hostgroup") -class LishCommander(Exit, ShellCommander): +class LishCommander(Exit, ShellCommander, LogCommander): def __init__(self, kwargs):