From c8951a634a88c47878516331d6a1473f7f054bee Mon Sep 17 00:00:00 2001 From: Dave Parker Date: Wed, 24 Jun 2015 20:16:07 +0000 Subject: [PATCH] prism-auto patch: Make name of "models" file configurable. [from Joachim Klein] git-svn-id: https://www.prismmodelchecker.org/svn/prism/prism/trunk@10090 bbc10eb1-c90d-0410-af57-cb519fbb1720 --- prism/etc/scripts/prism-auto | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/prism/etc/scripts/prism-auto b/prism/etc/scripts/prism-auto index 74f396a8..8f12398d 100755 --- a/prism/etc/scripts/prism-auto +++ b/prism/etc/scripts/prism-auto @@ -56,12 +56,15 @@ def lineIsCommentedOut(line): # A "models" file is a list of (relative) path names, in which lines starting with # are ignored. # Each item of the returned list is itself a tuple consisting of the name of the model file and # a possibly empty argument list, e.g. ("model.pm", ["-const", "N=2"]) +# +# The name of the "models" file is configurable, defaults to "models" and is +# stored in options.modelsFilename def getModelsInDir(dir): modelFiles = [] # Process "models" file, if present - if os.path.isfile(os.path.join(dir, "models")): - for line in open(os.path.join(dir, "models"), 'r').readlines(): + if os.path.isfile(os.path.join(dir, options.modelsFilename)): + for line in open(os.path.join(dir, options.modelsFilename), 'r').readlines(): line = line.strip() if len(line) == 0 or lineIsCommentedOut(line): continue first = 1 @@ -593,6 +596,7 @@ parser.add_option("--test-all", action="store_true", dest="testAll", default=Fal parser.add_option("--no-renaming", action="store_true", dest="noRenaming", default=False, help="Don't rename files to be exported") parser.add_option("--debug", action="store_true", dest="debug", default=False, help="Enable debug mode: display debugging info") parser.add_option("--echo-full", action="store_true", dest="echoFull", default=False, help="An expanded version of -e/--echo") +parser.add_option("--models-filename", dest="modelsFilename", default="models", help="The name of the optional 'models' file in directories, storing a list of models and parameters [default=models]") (options, args) = parser.parse_args() if len(args) < 1: parser.print_help()