Skip to content

Commit

Permalink
Merge pull request #335 from galaxyproject/looks-like-a-bug
Browse files Browse the repository at this point in the history
  • Loading branch information
jmchilton committed Oct 20, 2015
2 parents 80bd596 + 7d934f3 commit 262796d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion planemo_ext/galaxy/tools/loader_directory.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import fnmatch
import glob
import os
import re
from ..tools import loader

import sys
Expand All @@ -12,6 +13,7 @@
PATH_AND_RECURSIVE_ERROR = "Cannot specify a single file and recursive."
LOAD_FAILURE_ERROR = "Failed to load tool with path %s."
TOOL_LOAD_ERROR = object()
TOOL_REGEX = re.compile(r"<tool\s")


def load_exception_handler(path, exc_info):
Expand Down Expand Up @@ -50,7 +52,7 @@ def is_tool_load_error(obj):
def __looks_like_a_tool(path):
with open(path, "r") as f:
start_contents = f.read(5 * 1024)
if "<tool" in start_contents:
if TOOL_REGEX.search(start_contents):
return True
return False

Expand Down

0 comments on commit 262796d

Please sign in to comment.