Beispiel #1
0
parser.add_option("-o", "--output", 
                  dest="output",
                  help="Output file name.",
                  default="source_cff.py")

(options,args) = parser.parse_args()

if len(args)!=1:
    parser.print_help()
    sys.exit(1)

sampleName = args[0].rstrip('/')

# getting all files from this sample -----------------

dbs = 'dbs search --query="find file where dataset like %s"' % sampleName

dbsOut = os.popen(dbs)

# allFiles = []
for line in dbsOut:
    if line.find('/store')==-1:
        continue
    line = line.rstrip()
    # print 'line',line
    # allFiles.append(line)


from CMGTools.Production.doImportNewSource import doImportNewSource
doImportNewSource( sampleName, 'sourceFileListCAF.py ' + sampleName, options.output)
Beispiel #2
0
                  help="Output file name.",
                  default="source_cff.py")

(options,args) = parser.parse_args()

if len(args)!=1:
    parser.print_help()
    sys.exit(1)

sampleName = args[0].rstrip('/')

# checking castor dir -----------------

import CMGTools.Production.castorBaseDir as castorBaseDir

cdir = castortools.lfnToCastor( castorBaseDir.castorBaseDir( options.user ) )
cdir += sampleName

pattern = fnmatch.translate( options.wildcard )
if not castortools.fileExists(cdir):
    print 'importNewSource: castor directory does not exist. Exit!'
    sys.exit(1)


# sourceFileList = 'sourceFileList.py -c %s "%s" > %s' % (cdir, pattern, sourceFile)

from CMGTools.Production.doImportNewSource import doImportNewSource
doImportNewSource( sampleName,
                   'sourceFileList.py -c %s "%s"' % (cdir, pattern),
                   options.output ) 
Beispiel #3
0
                  "--output",
                  dest="output",
                  help="Output file name.",
                  default="source_cff.py")

(options, args) = parser.parse_args()

if len(args) != 1:
    parser.print_help()
    sys.exit(1)

sampleName = args[0].rstrip('/')

# checking castor dir -----------------

import CMGTools.Production.castorBaseDir as castorBaseDir

cdir = castortools.lfnToCastor(castorBaseDir.castorBaseDir(options.user))
cdir += sampleName

pattern = fnmatch.translate(options.wildcard)
if not castortools.fileExists(cdir):
    print 'importNewSource: castor directory does not exist. Exit!'
    sys.exit(1)

# sourceFileList = 'sourceFileList.py -c %s "%s" > %s' % (cdir, pattern, sourceFile)

from CMGTools.Production.doImportNewSource import doImportNewSource
doImportNewSource(sampleName, 'sourceFileList.py -c %s "%s"' % (cdir, pattern),
                  options.output)
Beispiel #4
0
                  "--output",
                  dest="output",
                  help="Output file name.",
                  default="source_cff.py")

(options, args) = parser.parse_args()

if len(args) != 1:
    parser.print_help()
    sys.exit(1)

sampleName = args[0].rstrip('/')

# getting all files from this sample -----------------

dbs = 'dbs search --query="find file where dataset like %s"' % sampleName

dbsOut = os.popen(dbs)

# allFiles = []
for line in dbsOut:
    if line.find('/store') == -1:
        continue
    line = line.rstrip()
    # print 'line',line
    # allFiles.append(line)

from CMGTools.Production.doImportNewSource import doImportNewSource
doImportNewSource(sampleName, 'sourceFileListCAF.py ' + sampleName,
                  options.output)