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

References harvestTrackValidationPlots.str.

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

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

Definition at line 16 of file production_tasks.py.

Referenced by production_tasks.CreateJobDirectory.run().

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