summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'uprofile.py')
-rwxr-xr-xuprofile.py20
1 files changed, 9 insertions, 11 deletions
diff --git a/uprofile.py b/uprofile.py
index 3c1ca98..8a290d5 100755
--- a/uprofile.py
+++ b/uprofile.py
@@ -32,9 +32,6 @@ class Profile(Module):
str += line
profile = json.loads(str)
- print 'profile = json.loads(str)'
-
- print profile
self.profile = profile
@@ -43,24 +40,25 @@ class Profile(Module):
self.author = profile['profile']['author']
self.version = profile['profile']['version']
self.description = profile['profile']['description']
+ modules = profile['profile']['modules']
+
- for module in profile['profile']['modules']:
+ for module in modules:
actions = []
- for action in profile['profile']['modules'][module]['actions']:
- actions.append(action)
+ for action in modules[module]['actions']:
+ actions.append([action, modules[module]['actions'][action]])
+
module = self.get_module(module)
+
self.modules.append([module, actions])
- #for module in self.modules:
- # print module[0]
- # print module[0].actions
-
self.actions.append(Action(name = 'activate', \
description = 'Set this profile for this folder.', \
type = 'profile'))
self.actions.append(Action(name = 'default', \
description = 'Set this profile the default profile.', \
type = 'profile'))
+
def get_module(self, name):
import modules
@@ -122,7 +120,7 @@ class UniversalProfileTool:
profile = self.get_profile('folder')
action = profile.get_action('activate')
action.build()
- action.do_action(['activate'])
+ action.do_action(['activate'], profile.modules)
elif len(args) == 1:
try:
profile = self.get_profile(args[0])