From b34e6c27aa640e4bd4bde91d684e1e59095ba8b1 Mon Sep 17 00:00:00 2001 From: Santo Cariotti Date: Thu, 20 Jul 2017 14:24:08 +0200 Subject: Moved files Moved all files of lib into a lib dir --- lib/listcommands.py | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 lib/listcommands.py (limited to 'lib/listcommands.py') diff --git a/lib/listcommands.py b/lib/listcommands.py new file mode 100644 index 0000000..8313d26 --- /dev/null +++ b/lib/listcommands.py @@ -0,0 +1,27 @@ +import sys +from classes import Colors + +class ListCommands(object): + + info = { + 'info' : 'this is stout', + 'set' : ['set a value', 3], + } + + commands = { + 'quit' : None, + 'clear' : None, + 'set' : ['user'], + 'get' : ['user', 'user?', 'host', 'port'] + } + + @staticmethod + def err(err, info = ''): + if err == 'keyword': + sys.stderr.write(Colors.red + 'keyword inesistente\n' + Colors.black) + elif err == 'wrong': + sys.stderr.write(Colors.red + 'sintassi comando errata\n' + Colors.black) + elif err == 'personal': + sys.stderr.write(Colors.red + str(info) + '\n' + Colors.black) + else: + pass -- cgit v1.2.3-18-g5258