ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/BOSS/BossPython/BossSession.py
Revision: 1.30
Committed: Thu Nov 15 09:25:13 2007 UTC (17 years, 5 months ago) by gcodispo
Content type: text/x-python
Branch: MAIN
CVS Tags: BOSS_4_3_10, BOSS_4_3_9, HEAD
Changes since 1.29: +2 -2 lines
Log Message:
Added -force option to the archive command

File Contents

# Content
1 # This file was created automatically by SWIG.
2 # Don't modify this file, modify the SWIG interface instead.
3 # This file is compatible with both classic and new-style classes.
4 import _BossSession
5 def _swig_setattr(self,class_type,name,value):
6 if (name == "this"):
7 if isinstance(value, class_type):
8 self.__dict__[name] = value.this
9 if hasattr(value,"thisown"): self.__dict__["thisown"] = value.thisown
10 del value.thisown
11 return
12 method = class_type.__swig_setmethods__.get(name,None)
13 if method: return method(self,value)
14 self.__dict__[name] = value
15
16 def _swig_getattr(self,class_type,name):
17 method = class_type.__swig_getmethods__.get(name,None)
18 if method: return method(self)
19 raise AttributeError,name
20
21 import types
22 try:
23 _object = types.ObjectType
24 _newclass = 1
25 except AttributeError:
26 class _object : pass
27 _newclass = 0
28
29
30 class objectMap(_object):
31 __swig_setmethods__ = {}
32 __setattr__ = lambda self, name, value: _swig_setattr(self, objectMap, name, value)
33 __swig_getmethods__ = {}
34 __getattr__ = lambda self, name: _swig_getattr(self, objectMap, name)
35 def __init__(self,*args):
36 _swig_setattr(self, objectMap, 'this', apply(_BossSession.new_objectMap,args))
37 _swig_setattr(self, objectMap, 'thisown', 1)
38 def __len__(*args): return apply(_BossSession.objectMap___len__,args)
39 def clear(*args): return apply(_BossSession.objectMap_clear,args)
40 def __nonzero__(*args): return apply(_BossSession.objectMap___nonzero__,args)
41 def __getitem__(*args): return apply(_BossSession.objectMap___getitem__,args)
42 def __setitem__(*args): return apply(_BossSession.objectMap___setitem__,args)
43 def __delitem__(*args): return apply(_BossSession.objectMap___delitem__,args)
44 def has_key(*args): return apply(_BossSession.objectMap_has_key,args)
45 def keys(*args): return apply(_BossSession.objectMap_keys,args)
46 def values(*args): return apply(_BossSession.objectMap_values,args)
47 def items(*args): return apply(_BossSession.objectMap_items,args)
48 def __contains__(*args): return apply(_BossSession.objectMap___contains__,args)
49 def __iter__(*args): return apply(_BossSession.objectMap___iter__,args)
50 def __del__(self, destroy= _BossSession.delete_objectMap):
51 try:
52 if self.thisown: destroy(self)
53 except: pass
54 def __repr__(self):
55 return "<C objectMap instance at %s>" % (self.this,)
56
57 class objectMapPtr(objectMap):
58 def __init__(self,this):
59 _swig_setattr(self, objectMap, 'this', this)
60 if not hasattr(self,"thisown"): _swig_setattr(self, objectMap, 'thisown', 0)
61 _swig_setattr(self, objectMap,self.__class__,objectMap)
62 _BossSession.objectMap_swigregister(objectMapPtr)
63
64 class vector_string(_object):
65 __swig_setmethods__ = {}
66 __setattr__ = lambda self, name, value: _swig_setattr(self, vector_string, name, value)
67 __swig_getmethods__ = {}
68 __getattr__ = lambda self, name: _swig_getattr(self, vector_string, name)
69 def __init__(self,*args):
70 _swig_setattr(self, vector_string, 'this', apply(_BossSession.new_vector_string,args))
71 _swig_setattr(self, vector_string, 'thisown', 1)
72 def __len__(*args): return apply(_BossSession.vector_string___len__,args)
73 def __nonzero__(*args): return apply(_BossSession.vector_string___nonzero__,args)
74 def clear(*args): return apply(_BossSession.vector_string_clear,args)
75 def append(*args): return apply(_BossSession.vector_string_append,args)
76 def pop(*args): return apply(_BossSession.vector_string_pop,args)
77 def __getitem__(*args): return apply(_BossSession.vector_string___getitem__,args)
78 def __getslice__(*args): return apply(_BossSession.vector_string___getslice__,args)
79 def __setitem__(*args): return apply(_BossSession.vector_string___setitem__,args)
80 def __setslice__(*args): return apply(_BossSession.vector_string___setslice__,args)
81 def __delitem__(*args): return apply(_BossSession.vector_string___delitem__,args)
82 def __delslice__(*args): return apply(_BossSession.vector_string___delslice__,args)
83 def __del__(self, destroy= _BossSession.delete_vector_string):
84 try:
85 if self.thisown: destroy(self)
86 except: pass
87 def __repr__(self):
88 return "<C vector_string instance at %s>" % (self.this,)
89
90 class vector_stringPtr(vector_string):
91 def __init__(self,this):
92 _swig_setattr(self, vector_string, 'this', this)
93 if not hasattr(self,"thisown"): _swig_setattr(self, vector_string, 'thisown', 0)
94 _swig_setattr(self, vector_string,self.__class__,vector_string)
95 _BossSession.vector_string_swigregister(vector_stringPtr)
96
97 RUNNING = _BossSession.RUNNING
98 SCHEDULED = _BossSession.SCHEDULED
99 SUBMITTED = _BossSession.SUBMITTED
100 ALL = _BossSession.ALL
101 STATUS_ONLY = _BossSession.STATUS_ONLY
102 NORMAL = _BossSession.NORMAL
103 SPECIFIC = _BossSession.SPECIFIC
104 PROGRAMS = _BossSession.PROGRAMS
105 FULL = _BossSession.FULL
106 class BossSession(_object):
107 __swig_setmethods__ = {}
108 __setattr__ = lambda self, name, value: _swig_setattr(self, BossSession, name, value)
109 __swig_getmethods__ = {}
110 __getattr__ = lambda self, name: _swig_getattr(self, BossSession, name)
111 def __init__(self,*args):
112 _swig_setattr(self, BossSession, 'this', apply(_BossSession.new_BossSession,args))
113 _swig_setattr(self, BossSession, 'thisown', 1)
114 def __del__(self, destroy= _BossSession.delete_BossSession):
115 try:
116 if self.thisown: destroy(self)
117 except: pass
118 def resetDB(*args): return apply(_BossSession.BossSession_resetDB,args)
119 def clear(*args): return apply(_BossSession.BossSession_clear,args)
120 def task_begin(*args): return apply(_BossSession.BossSession_task_begin,args)
121 def task_end(*args): return apply(_BossSession.BossSession_task_end,args)
122 def tasksInMemory(*args): return apply(_BossSession.BossSession_tasksInMemory,args)
123 def locate(*args): return apply(_BossSession.BossSession_locate,args)
124 def makeBossTask(*args): return apply(_BossSession.BossSession_makeBossTask,args)
125 def destroyBossTask(*args): return apply(_BossSession.BossSession_destroyBossTask,args)
126 def showCHTools(*args): return apply(_BossSession.BossSession_showCHTools,args)
127 def showProgramTypes(*args): return apply(_BossSession.BossSession_showProgramTypes,args)
128 def showRTMon(*args): return apply(_BossSession.BossSession_showRTMon,args)
129 def showSchedulers(*args): return apply(_BossSession.BossSession_showSchedulers,args)
130 def defaultCHTool(*args): return apply(_BossSession.BossSession_defaultCHTool,args)
131 def defaultProgramType(*args): return apply(_BossSession.BossSession_defaultProgramType,args)
132 def defaultRTMon(*args): return apply(_BossSession.BossSession_defaultRTMon,args)
133 def defaultScheduler(*args): return apply(_BossSession.BossSession_defaultScheduler,args)
134 def version(*args): return apply(_BossSession.BossSession_version,args)
135 def clientID(*args): return apply(_BossSession.BossSession_clientID,args)
136 def showConfigs(*args): return apply(_BossSession.BossSession_showConfigs,args)
137 def RTupdate(*args): return apply(_BossSession.BossSession_RTupdate,args)
138 def listMatch(*args): return apply(_BossSession.BossSession_listMatch,args)
139 def query(*args): return apply(_BossSession.BossSession_query,args)
140 def getTasksByName(*args): return apply(_BossSession.BossSession_getTasksByName,args)
141 def getTasksByTaskInfo(*args): return apply(_BossSession.BossSession_getTasksByTaskInfo,args)
142 def getTasksByJobName(*args): return apply(_BossSession.BossSession_getTasksByJobName,args)
143 def show(*args): return apply(_BossSession.BossSession_show,args)
144 def CHTools(*args): return apply(_BossSession.BossSession_CHTools,args)
145 def ProgramTypes(*args): return apply(_BossSession.BossSession_ProgramTypes,args)
146 def RTMons(*args): return apply(_BossSession.BossSession_RTMons,args)
147 def schedulers(*args): return apply(_BossSession.BossSession_schedulers,args)
148 def schedListMatch(*args): return apply(_BossSession.BossSession_schedListMatch,args)
149 def schedulerQuery(*args): return apply(_BossSession.BossSession_schedulerQuery,args)
150 def query( self, filter_opt = SCHEDULED,
151 taskRange = "all",
152 jobRange = "all",
153 subn = "",
154 type = "",
155 user = "",
156 after = "",
157 before = "",
158 timeout = 0,
159 avoidCheck = 0):
160 self.schedulerQuery ( filter_opt, taskRange, jobRange, subn, type, user, after, before, timeout, avoidCheck )
161 ciao = {}
162 size = self.tasksInMemory()
163 for i in range(size):
164 ciao[self.locate(i).id()] = self.locate(i)
165 return ciao
166
167
168 def loadByName( self, taskName ):
169 start = self.getTasksByName(taskName)
170 ciao = {}
171 size = self.tasksInMemory()
172 for i in range( start, size ):
173 ciao[self.locate(i).id()] = self.locate(i)
174 return ciao
175
176
177 def loadByTaskInfo( self, taskInfo ):
178 start = self.getTasksByTaskInfo(taskInfo)
179 ciao = {}
180 size = self.tasksInMemory()
181 for i in range( start, size ):
182 ciao[self.locate(i).id()] = self.locate(i)
183 return ciao
184
185
186 def loadByJobName( self, jobName ):
187 start = self.getTasksByJobName( jobName )
188 ciao = {}
189 size = self.tasksInMemory()
190 for i in range( start, size ):
191 ciao[self.locate(i).id()] = self.locate(i)
192 return ciao
193
194
195 def __repr__(self):
196 return "<C BossSession instance at %s>" % (self.this,)
197
198 class BossSessionPtr(BossSession):
199 def __init__(self,this):
200 _swig_setattr(self, BossSession, 'this', this)
201 if not hasattr(self,"thisown"): _swig_setattr(self, BossSession, 'thisown', 0)
202 _swig_setattr(self, BossSession,self.__class__,BossSession)
203 _BossSession.BossSession_swigregister(BossSessionPtr)
204
205 class BossTaskException(_object):
206 __swig_setmethods__ = {}
207 __setattr__ = lambda self, name, value: _swig_setattr(self, BossTaskException, name, value)
208 __swig_getmethods__ = {}
209 __getattr__ = lambda self, name: _swig_getattr(self, BossTaskException, name)
210 def __init__(self,*args):
211 _swig_setattr(self, BossTaskException, 'this', apply(_BossSession.new_BossTaskException,args))
212 _swig_setattr(self, BossTaskException, 'thisown', 1)
213 def __del__(self, destroy= _BossSession.delete_BossTaskException):
214 try:
215 if self.thisown: destroy(self)
216 except: pass
217 def __repr__(self):
218 return "<C BossTaskException instance at %s>" % (self.this,)
219
220 class BossTaskExceptionPtr(BossTaskException):
221 def __init__(self,this):
222 _swig_setattr(self, BossTaskException, 'this', this)
223 if not hasattr(self,"thisown"): _swig_setattr(self, BossTaskException, 'thisown', 0)
224 _swig_setattr(self, BossTaskException,self.__class__,BossTaskException)
225 _BossSession.BossTaskException_swigregister(BossTaskExceptionPtr)
226
227 class BossTask(_object):
228 __swig_setmethods__ = {}
229 __setattr__ = lambda self, name, value: _swig_setattr(self, BossTask, name, value)
230 __swig_getmethods__ = {}
231 __getattr__ = lambda self, name: _swig_getattr(self, BossTask, name)
232 def job_begin(*args): return apply(_BossSession.BossTask_job_begin,args)
233 def job_end(*args): return apply(_BossSession.BossTask_job_end,args)
234 def jobsInMemory(*args): return apply(_BossSession.BossTask_jobsInMemory,args)
235 def queryJobPrograms(*args): return apply(_BossSession.BossTask_queryJobPrograms,args)
236 def queryProgram(*args): return apply(_BossSession.BossTask_queryProgram,args)
237 def queryProgramExec(*args): return apply(_BossSession.BossTask_queryProgramExec,args)
238 def __del__(self, destroy= _BossSession.delete_BossTask):
239 try:
240 if self.thisown: destroy(self)
241 except: pass
242 def __init__(self,*args):
243 _swig_setattr(self, BossTask, 'this', apply(_BossSession.new_BossTask,args))
244 _swig_setattr(self, BossTask, 'thisown', 1)
245 def id(*args): return apply(_BossSession.BossTask_id,args)
246 def name(*args): return apply(_BossSession.BossTask_name,args)
247 def chain(*args): return apply(_BossSession.BossTask_chain,args)
248 def taskMap(*args): return apply(_BossSession.BossTask_taskMap,args)
249 def jobsMap(*args): return apply(_BossSession.BossTask_jobsMap,args)
250 def jobMap(*args): return apply(_BossSession.BossTask_jobMap,args)
251 def programsMap(*args): return apply(_BossSession.BossTask_programsMap,args)
252 def declare(*args): return apply(_BossSession.BossTask_declare,args)
253 def remove(*args): return apply(_BossSession.BossTask_remove,args)
254 def archive(*args): return apply(_BossSession.BossTask_archive,args)
255 def submit(*args): return apply(_BossSession.BossTask_submit,args)
256 def reSubmit(*args): return apply(_BossSession.BossTask_reSubmit,args)
257 def kill(*args): return apply(_BossSession.BossTask_kill,args)
258 def getOutput(*args): return apply(_BossSession.BossTask_getOutput,args)
259 def loadByName(*args): return apply(_BossSession.BossTask_loadByName,args)
260 def load(*args): return apply(_BossSession.BossTask_load,args)
261 def schedulerQuery(*args): return apply(_BossSession.BossTask_schedulerQuery,args)
262 def query(*args): return apply(_BossSession.BossTask_query,args)
263 def query_out(*args): return apply(_BossSession.BossTask_query_out,args)
264 def clear(*args): return apply(_BossSession.BossTask_clear,args)
265 def Job( self, jobid ):
266 return BossJob( self, jobid )
267
268
269 def query( self, filter_opt = SCHEDULED,
270 jobRange = "all",
271 subn = "",
272 type = "",
273 user = "",
274 after = "",
275 before = "",
276 timeout = 0,
277 avoidCheck = 0):
278 if avoidCheck > 0 :
279 return self.load ( filter_opt, jobRange, subn, type, user, after, before )
280 return self.schedulerQuery ( filter_opt, jobRange, subn, type, user, after, before, timeout )
281
282
283 def appendToPyDict(*args): return apply(_BossSession.BossTask_appendToPyDict,args)
284 def jobDict(*args): return apply(_BossSession.BossTask_jobDict,args)
285 def jobsDict(*args): return apply(_BossSession.BossTask_jobsDict,args)
286 def job(*args): return apply(_BossSession.BossTask_job,args)
287 def Chain(*args): return apply(_BossSession.BossTask_Chain,args)
288 def jobStates(*args): return apply(_BossSession.BossTask_jobStates,args)
289 def joblist(*args): return apply(_BossSession.BossTask_joblist,args)
290 def jobsIterator( self ):
291 jobs = []
292 jl = self.joblist()
293 for jobid in jl :
294 jobs.append( BossJob( self, jobid, False ) )
295 return jobs
296
297
298 def jobStatistic(*args): return apply(_BossSession.BossTask_jobStatistic,args)
299 def progDict(*args): return apply(_BossSession.BossTask_progDict,args)
300 def jobPrograms(*args): return apply(_BossSession.BossTask_jobPrograms,args)
301 def program(*args): return apply(_BossSession.BossTask_program,args)
302 def programExec(*args): return apply(_BossSession.BossTask_programExec,args)
303 def specific(*args): return apply(_BossSession.BossTask_specific,args)
304 def __repr__(self):
305 return "<C BossTask instance at %s>" % (self.this,)
306
307 class BossTaskPtr(BossTask):
308 def __init__(self,this):
309 _swig_setattr(self, BossTask, 'this', this)
310 if not hasattr(self,"thisown"): _swig_setattr(self, BossTask, 'thisown', 0)
311 _swig_setattr(self, BossTask,self.__class__,BossTask)
312 _BossSession.BossTask_swigregister(BossTaskPtr)
313
314 class BossAdministratorSession(_object):
315 __swig_setmethods__ = {}
316 __setattr__ = lambda self, name, value: _swig_setattr(self, BossAdministratorSession, name, value)
317 __swig_getmethods__ = {}
318 __getattr__ = lambda self, name: _swig_getattr(self, BossAdministratorSession, name)
319 def __init__(self,*args):
320 _swig_setattr(self, BossAdministratorSession, 'this', apply(_BossSession.new_BossAdministratorSession,args))
321 _swig_setattr(self, BossAdministratorSession, 'thisown', 1)
322 def __del__(self, destroy= _BossSession.delete_BossAdministratorSession):
323 try:
324 if self.thisown: destroy(self)
325 except: pass
326 def configureDB(*args): return apply(_BossSession.BossAdministratorSession_configureDB,args)
327 def configureRTMonDB(*args): return apply(_BossSession.BossAdministratorSession_configureRTMonDB,args)
328 def deleteCHTool(*args): return apply(_BossSession.BossAdministratorSession_deleteCHTool,args)
329 def deleteProgramType(*args): return apply(_BossSession.BossAdministratorSession_deleteProgramType,args)
330 def deleteRTMon(*args): return apply(_BossSession.BossAdministratorSession_deleteRTMon,args)
331 def deleteScheduler(*args): return apply(_BossSession.BossAdministratorSession_deleteScheduler,args)
332 def registerCHTool(*args): return apply(_BossSession.BossAdministratorSession_registerCHTool,args)
333 def registerProgram(*args): return apply(_BossSession.BossAdministratorSession_registerProgram,args)
334 def registerRTMon(*args): return apply(_BossSession.BossAdministratorSession_registerRTMon,args)
335 def registerScheduler(*args): return apply(_BossSession.BossAdministratorSession_registerScheduler,args)
336 def help(*args): return apply(_BossSession.BossAdministratorSession_help,args)
337 def SQL(*args): return apply(_BossSession.BossAdministratorSession_SQL,args)
338 def purge(*args): return apply(_BossSession.BossAdministratorSession_purge,args)
339 def registerPlugins(*args): return apply(_BossSession.BossAdministratorSession_registerPlugins,args)
340 def __repr__(self):
341 return "<C BossAdministratorSession instance at %s>" % (self.this,)
342
343 class BossAdministratorSessionPtr(BossAdministratorSession):
344 def __init__(self,this):
345 _swig_setattr(self, BossAdministratorSession, 'this', this)
346 if not hasattr(self,"thisown"): _swig_setattr(self, BossAdministratorSession, 'thisown', 0)
347 _swig_setattr(self, BossAdministratorSession,self.__class__,BossAdministratorSession)
348 _BossSession.BossAdministratorSession_swigregister(BossAdministratorSessionPtr)
349
350 class BossJob:
351 def __init__(self, task, jobid, checkDB=True):
352 if checkDB == True :
353 task.job( jobid )
354 self.task = task
355 self.id = jobid
356 self.static = {}
357 self.running = {}
358 self.prog = {}
359 self.progExec = {}
360 self.spec = {}
361
362 def jobid(self):
363 return self.id
364
365 def taskid(self):
366 return self.task.id()
367
368 def staticInfo(self):
369 if len( self.static ) == 0 :
370 self.static = self.task.Chain( self.id )
371 return self.static
372
373 def runningInfo(self):
374 if len( self.running ) == 0 :
375 self.running = self.task.job( self.id )
376 return self.running
377 def program(self, programId):
378 if len( self.prog ) == 0 or self.prog['ID'] != programId:
379 self.prog = self.task.program( self.id, programId )
380 return self.prog
381 def programExec(self, programId):
382 if len( self.progExec ) == 0 or self.progExec['PROGRAM_ID'] != programId :
383 self.progExec = self.task.programExec( self.id, programId )
384 return self.progExec
385 def specific(self, programId):
386 if len( self.spec ) == 0 or self.spec['PROGRAM_ID'] != programId:
387 self.spec = self.task.specific( self.id, programId )
388 return self.spec
389 def reload(self):
390 if len( self.running ) != 0 :
391 self.running = self.task.job( self.id )
392 if len( self.progExec ) != 0 :
393 self.progExec = self.task.programExec( self.id, self.progExec["PROGRAM_ID"] )
394 if len( self.spec ) != 0 :
395 self.spec = self.task.specific( self.id, self.spec["PROGRAM_ID"] )
396
397 def jobPrograms(self):
398 return self.task.jobPrograms( self.id )
399
400 def submit(self,
401 schclassad="",
402 scheduler="",
403 rtmon = "",
404 timeout = 0,
405 reuseclad = False
406 ):
407 return self.task.submit( self.id, schclassad, scheduler, rtmon, "", timeout, reuseclad )
408
409 def query(self, filter_opt = SCHEDULED,
410 subn = "",
411 prog_type = "",
412 user = "",
413 after = "",
414 before = "",
415 timeout = 0):
416 return self.task.query( filter_opt, self.id, subn, prog_type, user, after, before, timeout )
417
418 def kill(self, timeout = 0, force = False ):
419 return self.task.kill( self.id, timeout, force )
420
421 def getOutput( self,
422 outdir= "",
423 timeout = 0,
424 force = False,
425 wantPrompt = False
426 ):
427 return self.task.getOutput( self.id, outdir, timeout, force, wantPrompt )
428
429 # def listMatch(self):
430 # return self.task.listMatch( self.id, )
431
432 def archive(self, force=False):
433 return self.task.archive( self.id, force)
434
435
436
437