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 |
|
|
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 |
+ |
|