From ce1c2b6b05c08b669357947e61ae40efce7fc50f Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Mon, 16 Feb 2015 10:46:28 +0100 Subject: module temp --- module/cli/Handler.py | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 module/cli/Handler.py (limited to 'module/cli/Handler.py') diff --git a/module/cli/Handler.py b/module/cli/Handler.py new file mode 100644 index 000000000..4aab3f0e2 --- /dev/null +++ b/module/cli/Handler.py @@ -0,0 +1,32 @@ +# -*- coding: utf-8 -*- +# @author: RaNaN + +class Handler(object): + def __init__(self, cli): + self.cli = cli + self.init() + + client = property(lambda self: self.cli.client) + input = property(lambda self: self.cli.input) + + def init(self): + pass + + def onChar(self, char): + pass + + def onBackSpace(self): + pass + + def onEnter(self, inp): + pass + + def setInput(self, inp=""): + self.cli.setInput(inp) + + def backspace(self): + self.cli.setInput(self.input[:-1]) + + def renderBody(self, line): + """ gets the line where to render output and should return the line number below its content """ + return line + 1 -- cgit v1.2.3