summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'uprofile.py')
-rwxr-xr-xuprofile.py27
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)