Skip to content

Commit

Permalink
fixing runSeeds option handling #22
Browse files Browse the repository at this point in the history
  • Loading branch information
behrisch committed Jan 30, 2024
1 parent 1b012df commit 27ac073
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions tools/runSeeds.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,20 +62,16 @@ def get_options(args=None):
else:
options.seeds = list(map(int, options.seeds.split(",")))

if not options.configuration:
sys.stderr.write("Error: option configuration is mandatory\n")
sys.exit()

if hasattr(shutil, "which") and not shutil.which(options.application):
sys.stderr.write("Error: application '%s' not found\n" % options.application)
sys.exit()

if options.application is None:
options.application = [sumolib.checkBinary("sumo")]
else:
options.application = options.application.split(',')
options.configuration = options.configuration.split(',')
for app in options.application:
if hasattr(shutil, "which") and not shutil.which(app):
sys.stderr.write("Error: application '%s' not found\n" % app)
sys.exit()

options.configuration = options.configuration.split(',')
for cfg in options.configuration:
if not os.path.exists(cfg):
sys.stderr.write("Error: configuration '%s' not found\n" % cfg)
Expand Down

0 comments on commit 27ac073

Please sign in to comment.