From 217690a63ac647b06d54a2a8b8332bb694315b1a Mon Sep 17 00:00:00 2001 From: Carl Eberhard Date: Wed, 8 Aug 2012 12:30:25 -0400 Subject: [PATCH] fix to mako import and some up-stack error reporting in tools --- lib/galaxy/tools/__init__.py | 5 +++-- tools/new_operations/operation_filter.py | 7 +++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/lib/galaxy/tools/__init__.py b/lib/galaxy/tools/__init__.py index 66f737565b2..f5f4d177ac5 100755 --- a/lib/galaxy/tools/__init__.py +++ b/lib/galaxy/tools/__init__.py @@ -4,6 +4,7 @@ Classes encapsulating galaxy tools and tool configuration. import pkg_resources pkg_resources.require( "simplejson" ) +pkg_resources.require( "Mako" ) import logging, os, string, sys, tempfile, glob, shutil, types, urllib, subprocess, random, math, traceback import simplejson @@ -2344,7 +2345,7 @@ class Tool: command_line = command_line.replace( "\n", " " ).replace( "\r", " " ).strip() except Exception, e: # Modify exception message to be more clear - #e.args = ( 'Error substituting into command line. Params: %r, Command: %s' % ( param_dict, self.command ) ) + #e.args = ( 'Error substituting into command line. Params: %r, Command: %s' % ( param_dict, self.command ), ) raise if self.interpreter: # TODO: path munging for cluster/dataset server relocatability @@ -2441,7 +2442,7 @@ class Tool: if code: return code( *args, **kwargs ) except Exception, e: - e.args = ( "Error in '%s' hook '%s', original message: %s" % ( self.name, hook_name, e.args[0] ) ) + e.args = ( "Error in '%s' hook '%s', original message: %s" % ( self.name, hook_name, e.args[0] ), ) raise def exec_before_job( self, app, inp_data, out_data, param_dict={} ): pass diff --git a/tools/new_operations/operation_filter.py b/tools/new_operations/operation_filter.py index c91178d8e0b..a44a043cbd6 100644 --- a/tools/new_operations/operation_filter.py +++ b/tools/new_operations/operation_filter.py @@ -3,6 +3,9 @@ import os from galaxy import eggs from galaxy import jobs from galaxy.tools.parameters import DataToolParameter + +from galaxy.jobs.handler import JOB_ERROR + # Older py compatibility try: set() @@ -63,8 +66,8 @@ def exec_after_process(app, inp_data, out_data, param_dict, tool=None, stdout=No raise Exception( stderr ) except Exception, exc: - data.blurb = jobs.JOB_ERROR - data.state = jobs.JOB_ERROR + data.blurb = JOB_ERROR + data.state = JOB_ERROR ## def exec_after_process(app, inp_data, out_data, param_dict, tool=None, stdout=None, stderr=None): ## pass