CMS 3D CMS Logo

Classes | Functions
production_tasks Namespace Reference

Classes

class  BaseDataset
 
class  CheckConfig
 
class  CheckDatasetExists
 
class  CheckForMask
 
class  CheckForWrite
 
class  CheckJobStatus
 
class  CleanFiles
 
class  CleanJobFiles
 
class  CreateJobDirectory
 
class  ExpandConfig
 
class  FindOnCastor
 
class  FullCFG
 
class  GenerateMask
 
class  GZipFiles
 
class  MonitorJobs
 
class  ParseOptions
 
class  RunCMSBatch
 
class  RunTestEvents
 
class  SourceCFG
 
class  Task
 
class  WriteJobReport
 
class  WriteToDatasets
 

Functions

def insertLines (insertedTo, toInsert)
 
def mkdir_p (path)
 

Function Documentation

def production_tasks.insertLines (   insertedTo,
  toInsert 
)
insert a sequence in another sequence.

the sequence is inserted either at the end, or at the position
of the HOOK, if it is found.
The HOOK is considered as being found if
  str(elem).find(###ProductionTaskHook$$$)
is true for one of the elements in the insertedTo sequence. 

Definition at line 356 of file production_tasks.py.

References str.

Referenced by production_tasks.FullCFG.run(), and production_tasks.RunTestEvents.run().

356 def insertLines( insertedTo, toInsert ):
357  '''insert a sequence in another sequence.
358 
359  the sequence is inserted either at the end, or at the position
360  of the HOOK, if it is found.
361  The HOOK is considered as being found if
362  str(elem).find(###ProductionTaskHook$$$)
363  is true for one of the elements in the insertedTo sequence.
364  '''
365  HOOK = '###ProductionTaskHook$$$'
366  hookIndex = None
367  for index, line in enumerate(insertedTo):
368  line = str(line)
369  if line.find(HOOK)>-1:
370  hookIndex = index
371  break
372  if hookIndex is not None:
373  before = insertedTo[:hookIndex]
374  after = insertedTo[hookIndex:]
375  result = before + toInsert + after
376  return result
377  else:
378  insertedTo.extend( toInsert )
379  return insertedTo
380 
381 
def insertLines(insertedTo, toInsert)
#define str(s)
def production_tasks.mkdir_p (   path)

Definition at line 20 of file production_tasks.py.

Referenced by production_tasks.CreateJobDirectory.run().

20 def mkdir_p(path):
21  try:
22  os.makedirs(path)
23  except OSError as exc: # Python >2.5
24  if exc.errno == errno.EEXIST:
25  pass
26  else: raise
27