ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/CRAB/python/DBinterface.py
(Generate patch)

Comparing COMP/CRAB/python/DBinterface.py (file contents):
Revision 1.2 by spiga, Tue Mar 4 15:50:44 2008 UTC vs.
Revision 1.4 by spiga, Wed Mar 5 18:30:40 2008 UTC

# Line 40 | Line 40 | class DBinterface:
40          common.bossSession = BossLiteAPI( self.db_type, dbConfig)
41          
42          return
43 +
44 +    def getTask(self):
45 +
46 +        self.task = common.bossSession.loadTaskByID(1)
47 +        return self.task
48  
49  
50  
# Line 196 | Line 201 | class DBinterface:
201              common.bossSession.getRunningInstance(task.jobs[i])
202              lines.append(task.jobs[i].runningJob[attr])
203          return lines
204 +
205 +    def queryDistJob(self, attr):
206 +        '''
207 +        Returns the list of distinct value for a given job attributes
208 +        '''
209 +        distAttr=[]
210 +        task = common.bossSession.loadJobDistAttr( 1, attr )
211 +        for i in task: distAttr.append(i[attr])  
212 +        return  distAttr
213 +
214 +    def queryDistJobHadr(self, attr_1, attr_2, list):
215 +        '''
216 +        Returns the list of distinct value for a given job attributes
217 +        '''
218 +        distAttr=[]
219 +        task = common.bossSession.loadJobDistAttrHadr( 1, attr_1, attr_2, list )
220 +        for i in task: distAttr.append(i[attr_1])  
221 +        return  distAttr
222 +    def queryAttrJob(self, attr, field):
223 +        '''
224 +        Returns the list of jobs matching the given attribute
225 +        '''
226 +        matched=[]
227 +        task = common.bossSession.loadJobsByAttr(attr )
228 +        for i in task:
229 +            matched.append(i[field])
230 +        return  matched
231 +

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines