diff options
author | Sérgio Almeida <mephx.x@gmail.com> | 2009-07-28 19:42:42 +0100 |
---|---|---|
committer | Sérgio Almeida <mephx.x@gmail.com> | 2009-07-28 19:42:42 +0100 |
commit | 0041f8ab0991adc8524ea0c79a207543833e6cf7 (patch) | |
tree | 30b1fe2d814f1e53ca561d890d194f5c885172e9 /uio.py | |
parent | Added json profiles partial parsing (diff) | |
download | uselect-0041f8ab0991adc8524ea0c79a207543833e6cf7.tar.gz uselect-0041f8ab0991adc8524ea0c79a207543833e6cf7.tar.bz2 uselect-0041f8ab0991adc8524ea0c79a207543833e6cf7.zip |
uprofile with no arguments now defaults do folder
profiles are now action and module aware
added help and list options
Diffstat (limited to 'uio.py')
-rw-r--r-- | uio.py | 31 |
1 files changed, 20 insertions, 11 deletions
@@ -236,7 +236,7 @@ class PrintSystem: self.print_usage(module, action) self.print_line('') # Action - self.print_action(module, action) + self.print_action(action) self.print_line('') else: # This means Action Done @@ -300,26 +300,35 @@ class PrintSystem: + space + action_name + space + options) def print_options(self): + self.print_line(highlight + space + 'Options:' + reset) self.print_table([ \ [bold + '-v', bullet + space + 'Verbose Mode'], \ [bold + '-nc', bullet + space + 'No Colors'], \ - # [bold + '-profile', bullet + space + 'Profile Mode'], \ + [bold + '-help', bullet + space + 'See this screen'], \ + [bold + '-list', bullet + space + 'List Profiles'], \ [bold + '-version', bullet + space + 'Version Information']]) + self.print_line('') + self.print_line(highlight + space + 'Usage Examples:' + reset) + self.print_table([ \ + [bold + 'uprofile', bullet + space + 'Activates Folder Profile. Fallback to user profile.'], \ + [bold + 'uprofile <profile>', bullet + space + 'See Details on <profile>']]) class ProfilePrintSystem(PrintSystem): def print_ui(self, profile = None, profiles = None, args = None, \ - action = None): - + action = None, help = False, list = False): 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('') + if help or list: + self.print_usage(profile = profile, action = action) + self.print_line('') + if help: + self.print_options() + self.print_line('') + if list: + self.print_profiles(profiles) + self.print_line('') elif profiles == None and action == None: self.print_usage(profile = profile, action = action) self.print_line('') @@ -329,7 +338,7 @@ class ProfilePrintSystem(PrintSystem): self.print_line('') else: for line in action.output: - print line + print line def print_profiles(self, profiles): self.print_line(highlight + space + 'Profiles:' + reset) |