243 if '--help' in args
or '-h' in args:
247 if '--verbose' in args:
249 args.remove(
'--verbose')
252 db_count = arg_count[
'--v1'] + arg_count[
'--v2'] + arg_count[
'--v3'] + arg_count[
'--v3-beta'] + arg_count[
'--v3-test']
254 sys.stderr.write(
'ERROR: conflicting database version specifications: "--v1", "--v2", "--v3", "--v3-beta", and "--v3-test" are mutually exclusive options' )
272 if '--v3-beta' in args:
275 args.remove(
'--v3-beta')
277 if '--v3-test' in args:
280 args.remove(
'--v3-test')
283 proxy_host =
"localhost"
285 if '--dbproxy' in args:
287 args.remove(
'--dbproxy')
288 if '--dbproxyhost' in args:
289 proxy_host = args.pop(args.index(
'--dbproxyhost')+1)
290 args.remove(
'--dbproxyhost')
291 if '--dbproxyport' in args:
292 proxy_port = args.pop(args.index(
'--dbproxyport')+1)
293 args.remove(
'--dbproxyport')
297 _dbs[
'v1'] = [
'--%s' % _db
for _db
in OfflineConverter.databases[
'v1'] ] + [
'--runNumber' ]
298 _dbs[
'v2'] = [
'--%s' % _db
for _db
in OfflineConverter.databases[
'v2'] ] + [
'--runNumber' ]
299 _dbs[
'v3'] = [
'--%s' % _db
for _db
in OfflineConverter.databases[
'v3'] ] + [
'--runNumber']
300 _dbs[
'v3-beta'] = [
'--%s' % _db
for _db
in OfflineConverter.databases[
'v3-beta'] ] + [
'--runNumber' ]
301 _dbs[
'v3-test'] = [
'--%s' % _db
for _db
in OfflineConverter.databases[
'v3-test'] ] + [
'--runNumber' ]
302 _dbargs = set(args) & set(sum(_dbs.values(), []))
306 sys.stderr.write(
"ERROR: too many database specifications: \"" +
"\", \"".
join( _dbargs) +
"\"\n" )
311 if db ==
'runNumber':
316 if not db
in OfflineConverter.databases[version]:
317 sys.stderr.write(
"ERROR: database version \"%s\" incompatible with specification \"%s\"\n" % (version, db) )
320 converter = OfflineConverter(version = version, database = db, verbose = verbose,
321 proxy = proxy, proxyHost = proxy_host, proxyPort=proxy_port)
322 out, err = converter.query( * args )
324 sys.stderr.write(
"%s: error while retriving the HLT menu\n\n%s\n\n" % (sys.argv[0], err) )
327 sys.stdout.write( out )