示例#1
0
 def update_task_in_history_with_objects(self, task, objects):
     # Find the task in history if its there
     found = False
     for t in self.history[self.tag]['tasks']:
         if t.get_object_name() == task:
             if t.objects:
                 t.objects.extend(
                     [o for o in objects if ':project:' not in o])
                 t.objects = list(set(t.objects))
             else:
                 t.objects = [o for o in objects if ':project:' not in o]
             found = True
     if not found:
         t = ccm_cache.get_object(task, self.ccm)
         if t.type == 'task':
             t.objects = [o for o in objects if ':project:' not in o]
             self.history[self.tag]['tasks'].append(t)
         elif t.type == 'dir':
             # Make a task from the directory object
             task_obj = TaskObject(
                 "%s%s%s:task:%s" %
                 (t.name, self.delim, t.version, t.instance), self.delim,
                 t.author, t.status, t.created_time, t.tasks)
             task_obj.set_attributes(t.attributes)
             task_obj.complete_time = t.get_integrate_time()
             task_obj.objects = [o for o in objects if ':project:' not in o]
             self.history[self.tag]['tasks'].append(task_obj)
示例#2
0
 def update_task_in_history_with_objects(self, task, objects):
     # Find the task in history if its there
     found = False
     for t in self.history[self.tag]['tasks']:
         if t.get_object_name() == task:
             if t.objects:
                 t.objects.extend([o for o in objects if ':project:' not in o])
                 t.objects = list(set(t.objects))
             else:
                 t.objects = [o for o in objects if ':project:' not in o]
             found = True
     if not found:
         t = ccm_cache.get_object(task, self.ccm)
         if t.type == 'task':
             t.objects = [o for o in objects if ':project:' not in o]
             self.history[self.tag]['tasks'].append(t)
         elif t.type == 'dir':
             # Make a task from the directory object
             task_obj = TaskObject("%s%s%s:task:%s" %(t.name, self.delim, t.version, t.instance), self.delim, t.author, t.status, t.created_time, t.tasks)
             task_obj.set_attributes(t.attributes)
             task_obj.complete_time = t.get_integrate_time()
             task_obj.objects = [o for o in objects if ':project:' not in o]
             self.history[self.tag]['tasks'].append(task_obj)