241 if '--help' in args
or '-h' in args:
245 if '--verbose' in args:
247 args.remove(
'--verbose')
250 db_count = arg_count[
'--v1'] + arg_count[
'--v2'] + arg_count[
'--v3'] + arg_count[
'--v3-beta'] + arg_count[
'--v3-test']
252 sys.stderr.write(
'ERROR: conflicting database version specifications: "--v1", "--v2", "--v3", "--v3-beta", and "--v3-test" are mutually exclusive options' )
270 if '--v3-beta' in args:
273 args.remove(
'--v3-beta')
275 if '--v3-test' in args:
278 args.remove(
'--v3-test')
281 proxy_host =
"localhost"
283 if '--dbproxy' in args:
285 args.remove(
'--dbproxy')
286 if '--dbproxyhost' in args:
287 proxy_host = args.pop(args.index(
'--dbproxyhost')+1)
288 args.remove(
'--dbproxyhost')
289 if '--dbproxyport' in args:
290 proxy_port = args.pop(args.index(
'--dbproxyport')+1)
291 args.remove(
'--dbproxyport')
295 _dbs[
'v1'] = [
'--%s' % _db
for _db
in OfflineConverter.databases[
'v1'] ] + [
'--runNumber' ]
296 _dbs[
'v2'] = [
'--%s' % _db
for _db
in OfflineConverter.databases[
'v2'] ] + [
'--runNumber' ]
297 _dbs[
'v3'] = [
'--%s' % _db
for _db
in OfflineConverter.databases[
'v3'] ] + [
'--runNumber']
298 _dbs[
'v3-beta'] = [
'--%s' % _db
for _db
in OfflineConverter.databases[
'v3-beta'] ] + [
'--runNumber' ]
299 _dbs[
'v3-test'] = [
'--%s' % _db
for _db
in OfflineConverter.databases[
'v3-test'] ] + [
'--runNumber' ]
300 _dbargs = set(args) & set(sum(_dbs.values(), []))
304 sys.stderr.write(
"ERROR: too many database specifications: \"" +
"\", \"".
join( _dbargs) +
"\"\n" )
309 if db ==
'runNumber':
314 if not db
in OfflineConverter.databases[version]:
315 sys.stderr.write(
"ERROR: database version \"%s\" incompatible with specification \"%s\"\n" % (version, db) )
318 converter =
OfflineConverter(version = version, database = db, verbose = verbose,
319 proxy = proxy, proxyHost = proxy_host, proxyPort=proxy_port)
320 out, err = converter.query( * args )
322 sys.stderr.write(
"%s: error while retriving the HLT menu\n\n%s\n\n" % (sys.argv[0], err) )
325 sys.stdout.write( out )