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 354 of file production_tasks.py.

References str.

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

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

Definition at line 18 of file production_tasks.py.

Referenced by production_tasks.CreateJobDirectory.run().

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