9 if bPlusMinus
is False:
10 for index,s
in enumerate(sChoiceList):
11 print (
"%3d : %-20s" % (index+iPlusMinus,s))
13 for index,s
in enumerate(sChoiceList):
14 print (
"%3d/%3d : %-20s" % (index+iPlusMinus,-index,s))
18 for s,v
in optionDict:
19 sMenu=sMenu+s+
" "+v+
" "
24 while bValidResponse
is False:
26 print (
" .. "+sPrompt+
" > ", end=
'')
27 tty =
open(
"/dev/tty",
"r+")
32 for s,v
in optionDict:
41 if bPlusMinus
is False:
42 if iResponse
in range(iPlusMinus, len(sChoiceList)+iPlusMinus):
46 if bPlusMinus
is True:
47 if iResponse
in range(iPlusMinus, len(sChoiceList)+iPlusMinus+1):
49 if iResponse
in range(-len(sChoiceList)+iPlusMinus,iPlusMinus-1):
52 print (
"WARNING : response out of range")
62 print (
" .. Type ENTER to continue > ", end=
'')
63 tty =
open(
"/dev/tty",
"r+")
70 print (sMessage+
" [y/n] :", end=
'')
71 tty =
open(
"/dev/tty",
"r+")
75 if rep==
"y" or rep==
"Y":
81 from ROOT
import TSQLServer
82 def getNextAtlasRunNumber(self):
84 Returns the next free ATLAS run number
88 server =
"oracle://localhost/atlr"
89 statement =
"select MAX(RUNNUMBER) FROM atlas_run_number.RUNNUMBER"
90 db = TSQLServer.Connect(server,
"atlas_run_number_r",
"07-Run.Num.rEaDeR")
91 if not db
or not db.IsConnected():
92 raise(Exception(
"Problem connecting to run number server \"%s\"" % server))
93 stmt = db.Statement(statement)
97 runNum = (stmt.GetUInt(0)+1)
99 raise(Exception(
"Error in processing statement \"%s\"" % statement ))