/
githubmirror
/
cmssw
Обзор
Документация
Войти
/
githubmirror
/
cmssw
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
FWCore/ParameterSet/python/pfnInPath.py
16 строк
650 B
Chris Jones
Added python type annotation to some configuration classes
18 мар 2024, 19:37
18 мар 2024, 19:37
0600fad
Код
Авторство
О чём код?
import FWCore.ParameterSet.Config as cms import os, os.path def pfnInPath(name:str): for path in os.environ['CMSSW_SEARCH_PATH'].split(':'): fn = os.path.join(path, name) if os.path.isfile(fn): return 'file:' + fn raise IOError("No such file or directory '%s' in the CMSSW_SEARCH_PATH" % name) cms.pfnInPath = lambda name: cms.string(pfnInPath(name)) cms.untracked.pfnInPath = lambda name: cms.untracked.string(pfnInPath(name)) cms.pfnInPaths = lambda *names: cms.vstring(pfnInPath(name) for name in names) cms.untracked.pfnInPaths = lambda *names: cms.untracked.vstring(pfnInPath(name) for name in names)