diff options
author | Sérgio Almeida <mephx.x@gmail.com> | 2009-07-28 04:44:28 +0100 |
---|---|---|
committer | Sérgio Almeida <mephx.x@gmail.com> | 2009-07-28 04:44:28 +0100 |
commit | 4c05971e84cd1056e748bab07593454326c6a6d8 (patch) | |
tree | 12ba35a9ce314283fd09642f69020d7bc2838e86 /uprofile.py | |
parent | Open uprofile branch (diff) | |
download | uselect-4c05971e84cd1056e748bab07593454326c6a6d8.tar.gz uselect-4c05971e84cd1056e748bab07593454326c6a6d8.tar.bz2 uselect-4c05971e84cd1056e748bab07593454326c6a6d8.zip |
uprofile structure done
improved filesystem/printsystem sharing
Diffstat (limited to 'uprofile.py')
-rwxr-xr-x | uprofile.py | 27 |
1 files changed, 23 insertions, 4 deletions
diff --git a/uprofile.py b/uprofile.py index ad96eed..3945ebf 100755 --- a/uprofile.py +++ b/uprofile.py @@ -13,13 +13,27 @@ import string import traceback from umodule import * -from uio import * +from uio import filesystem +from uio import printsystem + + +verbose = False +printsystem.set_type('profile') class Profile: def __init__(self, name): self.name = name + self.author = 'unnamed' + self.version = '0.1' self.description = 'Empty' + self.actions = [] + self.actions.append(Action(name = 'set', \ + description = 'Set this profile for this folder.', \ + type = 'profile')) + self.actions.append(Action(name = 'default', \ + description = 'Set this profile the default profile.', \ + type = 'profile')) return class UniversalProfileTool: @@ -28,6 +42,10 @@ class UniversalProfileTool: self.profiles = [] return + def get_profile(self, name): + profile = Profile(name) + return profile + def get_profiles(self): """ Returns the list of available uprofiles """ for profile in filesystem.list_dir('.uprofile/'): @@ -51,7 +69,8 @@ class UniversalProfileTool: if len(args) < 1: self.get_profiles() profiles = self.profiles - + elif len(args) == 1: + profile = self.get_profile(args[0]) if len(args) == 2: args = None else: @@ -65,14 +84,14 @@ def main(): try: list = uprofile.parse_argv(sys.argv[1:]) - printsystem.print_uprofile_ui(profile = list[0], \ + printsystem.print_ui(profile = list[0], \ profiles = list[1], args = list[2]) except UserWarning, warning: printsystem.print_exception(warning, True) except Exception, exception: printsystem.print_exception(exception) - if not verbose: + if verbose: traceback.print_exc() printsystem.print_line('') exit(1) |