mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
Give ToolRequirements a string representation for easier debugging.
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
import copy
|
||||
|
||||
import six
|
||||
|
||||
from galaxy.util import (
|
||||
asbool,
|
||||
xml_text,
|
||||
@@ -11,6 +13,7 @@ DEFAULT_REQUIREMENT_TYPE = "package"
|
||||
DEFAULT_REQUIREMENT_VERSION = None
|
||||
|
||||
|
||||
@six.python_2_unicode_compatible
|
||||
class ToolRequirement( object ):
|
||||
"""
|
||||
Represents an external requirement that must be available for the tool to
|
||||
@@ -47,6 +50,11 @@ class ToolRequirement( object ):
|
||||
def __hash__(self):
|
||||
return hash((self.name, self.type, self.version, frozenset(self.specs)))
|
||||
|
||||
def __str__(self):
|
||||
return "ToolRequirement[%s,version=%s,type=%s,specs=%s]" % (self.name, self.version, self.type, self.specs)
|
||||
|
||||
__repr__ = __str__
|
||||
|
||||
|
||||
class RequirementSpecification(object):
|
||||
"""Refine a requirement using a URI."""
|
||||
|
||||
Reference in New Issue
Block a user