Skip to content

Commit d690bdf

Browse files
author
sss
committed
Implement suggested changes.
Also add a banner instructing to exit the interactive interpreter to continue the job.
1 parent bad364a commit d690bdf

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

k4FWCore/scripts/k4run

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,10 @@ def startInteractive(vars):
136136
vars = vars.copy()
137137

138138
# start the interpreter
139-
code.interact(local=vars)
139+
code.interact(
140+
local=vars,
141+
banner="Starting interactive Python session. Exit with Ctrl-D to resume the job.",
142+
)
140143
return
141144

142145

@@ -193,6 +196,7 @@ def main():
193196

194197
parser.add_argument(
195198
"-i",
199+
"--interactive",
196200
action="store_true",
197201
help="Start a Python command loop after reading the configuration files",
198202
default=False,
@@ -220,8 +224,7 @@ def main():
220224
print(f"{item} (from {cfgdb[item]['lib']}), path: {path_to_component}")
221225
sys.exit()
222226

223-
config_ns = {}
224-
config_ns["os"] = os
227+
config_ns = {"os": os}
225228
for file in opts[0].config_files:
226229
load_file(file, config_ns)
227230

@@ -280,7 +283,7 @@ def main():
280283

281284
from Gaudi.Main import gaudimain
282285

283-
if opts.i:
286+
if opts.interactive:
284287
startInteractive(config_ns)
285288

286289
gaudi = gaudimain()

0 commit comments

Comments
 (0)