'Indicates this tool\'s runtime requires Galaxy\'s Python environment.'

@property
def requires_galaxy_python_environment(self):

    if (self.tool_type != 'default'):
        return True
    config = self.app.config
    preserve_python_environment = config.preserve_python_environment
    if (preserve_python_environment == 'always'):
        return True
    elif ((preserve_python_environment == 'legacy_and_local') and (self.repository_id is None)):
        return True
    else:
        unversioned_legacy_tool = (self.old_id in GALAXY_LIB_TOOLS_UNVERSIONED)
        versioned_legacy_tool = (self.old_id in GALAXY_LIB_TOOLS_VERSIONED)
        legacy_tool = (unversioned_legacy_tool or (versioned_legacy_tool and (self.version_object < GALAXY_LIB_TOOLS_VERSIONED[self.old_id])))
        return legacy_tool
