details: http://www.bx.psu.edu/hg/galaxy/rev/62adea4325d7 changeset: 2988:62adea4325d7 user: dan date: Mon Nov 09 15:33:38 2009 -0500 description: Fix error message displayed when setting metadata_externally. e.g: Exception exceptions.TypeError: TypeError('<galaxy.datatypes.metadata.MetadataTempFile object at 0x40d9a10> is not JSON serializable',) in <bound method MutableAttrInstanceState._cleanup of <sqlalchemy.orm.state.MutableAttrInstanceState object at 0x40d99d0>> ignored diffstat: scripts/set_metadata.py | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diffs (26 lines): diff -r ef0b9956f7d7 -r 62adea4325d7 scripts/set_metadata.py --- a/scripts/set_metadata.py Mon Nov 09 14:56:21 2009 -0500 +++ b/scripts/set_metadata.py Mon Nov 09 15:33:38 2009 -0500 @@ -8,6 +8,7 @@ import logging logging.basicConfig() +log = logging.getLogger( __name__ ) import os, sys, cPickle assert sys.version_info[:2] >= ( 2, 4 ) @@ -24,6 +25,7 @@ galaxy.model.Job() #this looks REAL stupid, but it is REQUIRED in order for SA to insert parameters into the classes defined by the mappers --> it appears that instantiating ANY mapper'ed class would suffice here galaxy.datatypes.metadata.DATABASE_CONNECTION_AVAILABLE = False #Let metadata know that there is no database connection, and to just assume object ids are valid from galaxy.util import stringify_dictionary_keys +from sqlalchemy.orm import clear_mappers def __main__(): file_path = sys.argv.pop( 1 ) @@ -48,5 +50,6 @@ simplejson.dump( ( True, 'Metadata has been set successfully' ), open( filename_results_code, 'wb+' ) ) #setting metadata has suceeded except Exception, e: simplejson.dump( ( False, str( e ) ), open( filename_results_code, 'wb+' ) ) #setting metadata has failed somehow + clear_mappers() __main__()