From d2a989526ef7b6b1e6c51d60577cf483e8ad32db Mon Sep 17 00:00:00 2001 From: Sérgio Almeida Date: Tue, 28 Jul 2009 05:45:25 +0100 Subject: Added output to profile actions --- uio.py | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) (limited to 'uio.py') diff --git a/uio.py b/uio.py index d99d958..610ebca 100644 --- a/uio.py +++ b/uio.py @@ -272,7 +272,7 @@ class PrintSystem: self.print_table([[bold + action.name + reset, \ action.description]]) - def print_action(self, module, action): + def print_action(self, action): self.print_table([[bold + action.description + reset, '']]) self.print_line('') self.print_table(self.format_action(action)) @@ -312,18 +312,24 @@ class ProfilePrintSystem(PrintSystem): def print_ui(self, profile = None, profiles = None, args = None, \ action = None): - self.print_usage(profile = profile, action = action) - self.print_line('') + if profile == None: + self.print_usage(profile = profile, action = action) + self.print_line('') self.print_options() self.print_line('') self.print_profiles(profiles) self.print_line('') - elif profiles == None: + elif profiles == None and action == None: + self.print_usage(profile = profile, action = action) + self.print_line('') self.print_profile(profile) self.print_line('') self.print_actions(profile) self.print_line('') + else: + for line in action.output: + print line def print_profiles(self, profiles): self.print_line(highlight + space + 'Profiles:' + reset) @@ -338,13 +344,6 @@ class ProfilePrintSystem(PrintSystem): self.print_line(space * 4 + bold + 'Author:' + reset + space + \ profile.author + space + bold + 'Version:' + reset + space \ + profile.version) - - - - def print_action(self, module, action): - self.print_table([[bold + action.description + reset, '']]) - self.print_line('') - self.print_table(self.format_action(action)) def print_version(self, version): self.print_line(bold + 'Universal Profile Tool - ' \ -- cgit v1.2.3-65-gdbad