diff options
author | Sérgio Almeida <mephx.x@gmail.com> | 2009-07-27 20:30:11 +0100 |
---|---|---|
committer | Sérgio Almeida <mephx.x@gmail.com> | 2009-07-27 20:30:11 +0100 |
commit | 7344569e0efd98064ce305cd6f0db933327a9400 (patch) | |
tree | 427bfd4ee5eae95a4bfc1596b749f25d29f9a5ca /uio.py | |
parent | Fixed syntax typo on umodule.py (diff) | |
download | uselect-7344569e0efd98064ce305cd6f0db933327a9400.tar.gz uselect-7344569e0efd98064ce305cd6f0db933327a9400.tar.bz2 uselect-7344569e0efd98064ce305cd6f0db933327a9400.zip |
Open uprofile branch
Diffstat (limited to 'uio.py')
-rw-r--r-- | uio.py | 24 |
1 files changed, 20 insertions, 4 deletions
@@ -34,9 +34,10 @@ class FileSystem: self.environment = self.home + '/.uselect/' if not os.path.exists(self.environment): os.mkdir(self.environment) - self.environment += 'bin/' - if not os.path.exists(self.environment): - os.mkdir(self.environment) + if not os.path.exists(self.environment + 'bin/'): + os.mkdir(self.environment + 'bin/') + if not os.path.exists(self.environment + 'env.d/'): + os.mkdir(self.environment + 'env.d/') def get_env(self): env = [] @@ -100,8 +101,10 @@ class FileSystem: return else: return os.listdir(path) + def path_exists(self, path): return os.path.exists(path) + def real_path(self, path): return os.path.realpath(path) @@ -232,7 +235,20 @@ class PrintSystem: for line in action.output: print(line) return - + + def print_uprofile_ui(self, profile = None, profiles = None, args = None): + if profile == None: + self.print_profiles(profiles) + + def print_profiles(self, profiles): + self.print_line(bold + lime + 'Profiles:' + reset) + table = [] + for profile in profiles: + table.append([bold + profile.name, profile.description]) + + self.print_table(table) + + def print_module(self, module): self.print_line(bold + lime + 'Module' + space + reset \ + bold +module.name + lime + ':' + reset) |