Example #1
0
    def get_actions(self):

        selected_actions = self.get_action().split(';')
        action_path = utils.get_actions_path()
       # action_path = os.path.join(os.path.dirname(os.path.abspath(os.curdir)), 'db/actions')
        files = os.listdir(action_path)
        action_list = {}

        for filename in files:
            regexp = re.compile('^(.+)\.(action)$')
            m = regexp.match(filename)
            if m != None:
                groups = m.groups()
                action_name = groups[0]
                #file_path = os.path.join(action_path, filename)
                action_entry = ActionEntry.ActionEntry(filename)
                if action_name in selected_actions:
                    action_list[action_name] = action_entry

        return action_list
Example #2
0
 def new(self, filename):
     self.content = dict()
     self.addGroup(self.default_group)
     self.filename = os.path.join(utils.get_actions_path(), filename)
Example #3
0
 def __init__(self, filename=None):
     self.content = dict()
     self.parse(os.path.join(utils.get_actions_path(), filename))