CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions
production_tasks.CreateJobDirectory Class Reference
Inheritance diagram for production_tasks.CreateJobDirectory:
production_tasks.Task

Public Member Functions

def __init__
 
def addOption
 
def run
 
- Public Member Functions inherited from production_tasks.Task
def __init__
 
def addOption
 
def getname
 
def run
 

Additional Inherited Members

- Public Attributes inherited from production_tasks.Task
 dataset
 
 instance
 
 name
 
 options
 
 user
 

Detailed Description

Generates a job directory on your local drive

Definition at line 305 of file production_tasks.py.

Constructor & Destructor Documentation

def production_tasks.CreateJobDirectory.__init__ (   self,
  dataset,
  user,
  options 
)

Definition at line 307 of file production_tasks.py.

308  def __init__(self, dataset, user, options):
Task.__init__(self,'CreateJobDirectory', dataset, user, options)

Member Function Documentation

def production_tasks.CreateJobDirectory.addOption (   self,
  parser 
)

Definition at line 309 of file production_tasks.py.

310  def addOption(self, parser):
parser.add_option("-o","--output", dest="output", default=None,help='The directory to use locally for job files')
def production_tasks.CreateJobDirectory.run (   self,
  input 
)

Definition at line 311 of file production_tasks.py.

References CalibratedPatElectronProducer.dataset, production_tasks.Task.dataset, CalibratedElectronProducer.dataset, edmIntegrityCheck.IntegrityCheck.dataset, genericValidation.GenericValidationData.dataset, and production_tasks.mkdir_p().

312  def run(self, input):
313  if self.options.output is not None:
314  output = self.options.output
315  else:
316  # output = '%s_%s' % (self.dataset.replace('/','.'),datetime.datetime.now().strftime("%s"))
317  # if output.startswith('.'):
318  output = '%s_%s' % (self.dataset,datetime.datetime.now().strftime("%s"))
319  output = output.lstrip('/')
320  if not os.path.exists(output):
321  mkdir_p(output)
322  return {'JobDir':output,'PWD':os.getcwd()}