3 from __future__
import print_function
10 if bPlusMinus
is False:
11 for index,s
in enumerate(sChoiceList):
12 print (
"%3d : %-20s" % (index+iPlusMinus,s))
14 for index,s
in enumerate(sChoiceList):
15 print (
"%3d/%3d : %-20s" % (index+iPlusMinus,-index,s))
19 for s,v
in optionDict:
20 sMenu=sMenu+s+
" "+v+
" "
25 while bValidResponse
is False:
27 print (
" .. "+sPrompt+
" > ", end=
'')
28 tty =
open(
"/dev/tty",
"r+")
33 for s,v
in optionDict:
42 if bPlusMinus
is False:
43 if iResponse
in range(iPlusMinus, len(sChoiceList)+iPlusMinus):
47 if bPlusMinus
is True:
48 if iResponse
in range(iPlusMinus, len(sChoiceList)+iPlusMinus+1):
50 if iResponse
in range(-len(sChoiceList)+iPlusMinus,iPlusMinus-1):
53 print (
"WARNING : response out of range")
63 print (
" .. Type ENTER to continue > ", end=
'')
64 tty =
open(
"/dev/tty",
"r+")
71 print (sMessage+
" [y/n] :", end=
'')
72 tty =
open(
"/dev/tty",
"r+")
76 if rep==
"y" or rep==
"Y":
82 from ROOT
import TSQLServer
83 def getNextAtlasRunNumber(self):
85 Returns the next free ATLAS run number
89 server =
"oracle://localhost/atlr"
90 statement =
"select MAX(RUNNUMBER) FROM atlas_run_number.RUNNUMBER"
91 db = TSQLServer.Connect(server,
"atlas_run_number_r",
"07-Run.Num.rEaDeR")
92 if not db
or not db.IsConnected():
93 raise(Exception(
"Problem connecting to run number server \"%s\"" % server))
94 stmt = db.Statement(statement)
98 runNum = (stmt.GetUInt(0)+1)
100 raise(Exception(
"Error in processing statement \"%s\"" % statement ))