def __init__(self, valName, alignment, config):
    import random
    self.name = valName
    self.alignmentToValidate = alignment
    self.general = config.getGeneral()
    self.randomWorkdirPart = ('%0i' % random.randint(1, 10000000000.0))
    self.configFiles = []
    self.config = config
    self.jobid = ''
    theUpdate = config.getResultingSection(((self.valType + ':') + self.name), defaultDict=self.defaults, demandPars=self.mandatories)
    self.general.update(theUpdate)
    self.jobmode = self.general['jobmode']
    self.NJobs = int(self.general['parallelJobs'])
    self.needsproxy = boolfromstring(self.general['needsproxy'], 'needsproxy')
    maximumNumberJobs = 40
    if (self.NJobs > maximumNumberJobs):
        msg = (('Maximum allowed number of parallel jobs ' + str(maximumNumberJobs)) + ' exceeded!!!')
        raise AllInOneError(msg)
    if ((self.NJobs > 1) and (not isinstance(self, ParallelValidation))):
        raise AllInOneError('Parallel jobs not implemented for {}!\nPlease set parallelJobs = 1.'.format(type(self).__name__))
    self.jobid = self.general['jobid']
    if self.jobid:
        try:
            output = getCommandOutput2(('bjobs %(jobid)s 2>&1' % self.general))
            if ('is not found' in output):
                raise RuntimeError
        except RuntimeError:
            raise AllInOneError(('%s is not a valid jobid.\nMaybe it finished already?' % self.jobid))
    self.cmssw = self.general['cmssw']
    badcharacters = "\\'"
    for character in badcharacters:
        if (character in self.cmssw):
            raise AllInOneError((('The bad characters ' + badcharacters) + ' are not allowed in the cmssw\npath name.  If you really have it in such a ridiculously named location,\ntry making a symbolic link somewhere with a decent name.'))
    try:
        os.listdir(self.cmssw)
    except OSError:
        raise AllInOneError((('Your cmssw release ' + self.cmssw) + ' does not exist'))
    if (self.cmssw == os.environ['CMSSW_BASE']):
        self.scramarch = os.environ['SCRAM_ARCH']
        self.cmsswreleasebase = os.environ['CMSSW_RELEASE_BASE']
    else:
        command = (("cd '" + self.cmssw) + '\' && eval `scramv1 ru -sh 2> /dev/null` && echo "$CMSSW_BASE\n$SCRAM_ARCH\n$CMSSW_RELEASE_BASE"')
        commandoutput = getCommandOutput2(command).split('\n')
        self.cmssw = commandoutput[0]
        self.scramarch = commandoutput[1]
        self.cmsswreleasebase = commandoutput[2]
    self.packages = {}
    for package in self.needpackages:
        for placetolook in (self.cmssw, self.cmsswreleasebase):
            pkgpath = os.path.join(placetolook, 'src', package)
            if os.path.exists(pkgpath):
                self.packages[package] = pkgpath
                break
        else:
            raise AllInOneError('Package {} does not exist in {} or {}!'.format(package, self.cmssw, self.cmsswreleasebase))
    self.AutoAlternates = True
    if config.has_option('alternateTemplates', 'AutoAlternates'):
        try:
            self.AutoAlternates = json.loads(config.get('alternateTemplates', 'AutoAlternates').lower())
        except ValueError:
            raise AllInOneError(('AutoAlternates needs to be true or false, not %s' % config.get('alternateTemplates', 'AutoAlternates')))
    knownOpts = ((set(self.defaults.keys()) | self.mandatories) | self.optionals)
    ignoreOpts = []
    config.checkInput(((self.valType + ':') + self.name), knownSimpleOptions=knownOpts, ignoreOptions=ignoreOpts)
def __init__(self, valName, alignment, config):
    import random
    self.name = valName
    self.alignmentToValidate = alignment
    self.general = config.getGeneral()
    self.randomWorkdirPart = ('%0i' % random.randint(1, 10000000000.0))
    self.configFiles = []
    self.config = config
    self.jobid = 
    theUpdate = config.getResultingSection(((self.valType + ':') + self.name), defaultDict=self.defaults, demandPars=self.mandatories)
    self.general.update(theUpdate)
    self.jobmode = self.general['jobmode']
    self.NJobs = int(self.general['parallelJobs'])
    self.needsproxy = boolfromstring(self.general['needsproxy'], 'needsproxy')
    maximumNumberJobs = 40
    if (self.NJobs > maximumNumberJobs):
        msg = (('Maximum allowed number of parallel jobs ' + str(maximumNumberJobs)) + ' exceeded!!!')
        raise AllInOneError(msg)
    if ((self.NJobs > 1) and (not isinstance(self, ParallelValidation))):
        raise AllInOneError('Parallel jobs not implemented for {}!\nPlease set parallelJobs = 1.'.format(type(self).__name__))
    self.jobid = self.general['jobid']
    if self.jobid:
        try:
            output = getCommandOutput2(('bjobs %(jobid)s 2>&1' % self.general))
            if ('is not found' in output):
                raise RuntimeError
        except RuntimeError:
            raise AllInOneError(('%s is not a valid jobid.\nMaybe it finished already?' % self.jobid))
    self.cmssw = self.general['cmssw']
    badcharacters = "\\'"
    for character in badcharacters:
        if (character in self.cmssw):
            raise AllInOneError((('The bad characters ' + badcharacters) + ' are not allowed in the cmssw\npath name.  If you really have it in such a ridiculously named location,\ntry making a symbolic link somewhere with a decent name.'))
    try:
        os.listdir(self.cmssw)
    except OSError:
        raise AllInOneError((('Your cmssw release ' + self.cmssw) + ' does not exist'))
    if (self.cmssw == os.environ['CMSSW_BASE']):
        self.scramarch = os.environ['SCRAM_ARCH']
        self.cmsswreleasebase = os.environ['CMSSW_RELEASE_BASE']
    else:
        command = (("cd '" + self.cmssw) + '\' && eval `scramv1 ru -sh 2> /dev/null` && echo "$CMSSW_BASE\n$SCRAM_ARCH\n$CMSSW_RELEASE_BASE"')
        commandoutput = getCommandOutput2(command).split('\n')
        self.cmssw = commandoutput[0]
        self.scramarch = commandoutput[1]
        self.cmsswreleasebase = commandoutput[2]
    self.packages = {}
    for package in self.needpackages:
        for placetolook in (self.cmssw, self.cmsswreleasebase):
            pkgpath = os.path.join(placetolook, 'src', package)
            if os.path.exists(pkgpath):
                self.packages[package] = pkgpath
                break
        else:
            raise AllInOneError('Package {} does not exist in {} or {}!'.format(package, self.cmssw, self.cmsswreleasebase))
    self.AutoAlternates = True
    if config.has_option('alternateTemplates', 'AutoAlternates'):
        try:
            self.AutoAlternates = json.loads(config.get('alternateTemplates', 'AutoAlternates').lower())
        except ValueError:
            raise AllInOneError(('AutoAlternates needs to be true or false, not %s' % config.get('alternateTemplates', 'AutoAlternates')))
    knownOpts = ((set(self.defaults.keys()) | self.mandatories) | self.optionals)
    ignoreOpts = []
    config.checkInput(((self.valType + ':') + self.name), knownSimpleOptions=knownOpts, ignoreOptions=ignoreOpts)