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.5 by spiga, Fri Mar 7 09:27:49 2008 UTC vs.
Revision 1.6 by slacapra, Fri Mar 7 17:25:23 2008 UTC

# Line 46 | Line 46 | class DBinterface:
46          self.task = common.bossSession.loadTaskByID(1)
47          return self.task
48  
49 +    def getJob(self, n):
50 +
51 +        self.job = common.bossSession.loadJobByID(1,n)
52 +        return self.job
53  
54  
55      def createTask_(self, optsToSave):      
56          """
57          Task declaration
58          with the first coniguration stuff
59 <         {'server_name': 'crabas.lnl.infn.it/data1/cms/', '-scheduler': 'glite', '-jobtype': 'cmssw', '-server_mode': '0'}
59 >        {'server_name': 'crabas.lnl.infn.it/data1/cms/', '-scheduler': 'glite', '-jobtype': 'cmssw', '-server_mode': '0'}
60  
61          """
62          opt={}
63 <        if optsToSave['server_mode'] == 1: opt['serverName']=optsToSave['server_name']
63 >        opt['serverName']=optsToSave.get('server_name',0)
64          opt['jobType']=optsToSave['jobtype']  
65          opt[ 'name']=common.work_space.taskName()  
66          task = Task( opt )
# Line 86 | Line 90 | class DBinterface:
90          jobs = []
91          for id in range(nj):
92              parameters = {}
93 <            parameters['name'] = 'job' + str(id)
93 >            parameters['name'] = id
94              job = Job(parameters)
95              jobs.append(job)    
96          task.addJobs(jobs)
# Line 216 | Line 220 | class DBinterface:
220          Returns the list of distinct value for a given job attributes
221          '''
222          distAttr=[]
223 <        task = common.bossSession.loadJobDistAttr_Attr( 1, attr_1, attr_2, list )
223 >        task = common.bossSession.loadJobDistAttr( 1, attr_1, attr_2, list )
224          for i in task: distAttr.append(i[attr_1])  
225          return  distAttr
226 +
227      def queryAttrJob(self, attr, field):
228          '''
229          Returns the list of jobs matching the given attribute

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines