CMS 3D CMS Logo

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

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.

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

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

Definition at line 16 of file production_tasks.py.

Referenced by production_tasks.CreateJobDirectory.run().

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