50""" Get tasks from folder. If the folder is query based it uses the query to determine the list of task.
+ 51 But the folder contents itself remains untouch.
+ 52 """
+ 53query=None
+ 54iffolder.is_query_based:
+ 55query=ccm.Query(folder.session,"type='task' and "+folder.query,
+ 56['objectname','owner','task_synopsis','displayname'],
+ 57['ccmobject','string','string','string'])
+ 58else:
+ 59query=ccm.Query(folder.session,folder.objectname,
+ 60['objectname','owner','task_synopsis','displayname'],
+ 61['ccmobject','string','string','string'],
+ 62"folder -show tasks")
+ 63# executing the query
+ 64returnquery.execute().output
+
69""" Get tasks from folder. If the folder is query based it uses the query to determine the list of task.
+ 70 But the folder contents itself remains untouch.
+ 71 """
+ 72iffolder.is_query_based:
+ 73r=folder.session.execute("query -u -t task \"%s\" -f \"%%objectname\""%folder.query,ccm.ObjectListResult(folder.session))
+ 74returnr.output
+ 75else:
+ 76returnfolder.tasks
+
87""" Has our object any successor in the list. """
+ 88foroatinoatl:
+ 89ifself.object.__ne__(oat.object)andoat.object.is_recursive_successor_of_fast(self.object):
+ 90self.overridenby.append(oat)
+ 91returnTrue
+ 92returnFalse
+
164""" Validates objects a list of task.
+165 It returns a list of list of conflicting ObjectAndTask.
+166 """
+167
+168object_families,taskmodels=tasks_to_families_and_taskmodels(tasks,size)
+169conflicts=[]
+170lock=threading.Lock()
+171
+172pool=threadpool.ThreadPool(size)
+173
+174def__work(family):
+175result=[]
+176foroatinobject_families[family]:
+177ifoat.has_successor_in_list(object_families[family])==False:
+178add=True
+179forroatinresult:
+180ifroat.object==oat.object:
+181add=False
+182break
+183ifadd:
+184result.append(oat)
+185
+186iflen(result)>1:
+187lock.acquire()
+188conflicts.append(result)
+189lock.release()
+
214output="Multiple objects from the same family found under the baseline (%s).\n"%self.baseline.objectname
+215output+="\n".join(lambdax:x.objectname,self.objectlist)
+216returnoutput
+