From 18aa667e4024a15a7c9479374cde399d30d14a74 Mon Sep 17 00:00:00 2001 From: Dimitris Zlatanidis Date: Wed, 8 Jul 2015 00:43:39 +0300 Subject: [PATCH] Update print out --- slpkg/auto_pkg.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/slpkg/auto_pkg.py b/slpkg/auto_pkg.py index c9d0db95..bec58e57 100644 --- a/slpkg/auto_pkg.py +++ b/slpkg/auto_pkg.py @@ -22,6 +22,8 @@ # along with this program. If not, see . +import sys + from messages import Msg from pkg.manager import PackageManager from __metadata__ import MetaData as _meta_ @@ -53,7 +55,16 @@ class Auto(object): self.meta.color["GREEN"], self.commands[com], self.meta.color["ENDC"])) Msg().template(78) - self.choice = raw_input(" > ") + try: + self.choice = raw_input(" > ") + if self.choice in self.commands.keys(): + sys.stdout.write(" \x1b[1A{0}{1}{2}\n\n".format( + self.meta.color["CYAN"], self.commands[self.choice], + self.meta.color["ENDC"])) + sys.stdout.flush() + except KeyboardInterrupt: + print("") + sys.exit(0) self.execute() def execute(self):