Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Identical to galaxyproject/galaxy#949 #335

Merged
merged 2 commits into from
Oct 20, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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