CMS 3D CMS Logo

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
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

◆ insertLines()

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

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

References str.

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

◆ mkdir_p()

def production_tasks.mkdir_p (   path)

Definition at line 19 of file production_tasks.py.

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

Referenced by production_tasks.CreateJobDirectory.run().

str
#define str(s)
Definition: TestProcessor.cc:53
production_tasks.insertLines
def insertLines(insertedTo, toInsert)
Definition: production_tasks.py:355
production_tasks.mkdir_p
def mkdir_p(path)
Definition: production_tasks.py:19