From 769bbcdbfda98f506f69f2efa76537d4b85ab12b Mon Sep 17 00:00:00 2001 From: Matej Trojak Date: Wed, 7 Sep 2022 22:31:26 +0200 Subject: [PATCH] Make sniffing of BCSL model more strict --- lib/galaxy/datatypes/text.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/galaxy/datatypes/text.py b/lib/galaxy/datatypes/text.py index ee8c6da0bf9..18badf79c8f 100644 --- a/lib/galaxy/datatypes/text.py +++ b/lib/galaxy/datatypes/text.py @@ -1103,8 +1103,8 @@ class BCSLmodel(Text): """ Determines whether the file is in .bcsl.model format """ - keywords = ["#! rules", "#! inits", "#! definitions"] - return any(keyword in file_prefix.contents_header for keyword in keywords) + reg = r"^#! rules|^#! inits|^#! definitions" + return re.search(reg, file_prefix.contents_header, re.MULTILINE) is not None @build_sniff_from_prefix