details: http://www.bx.psu.edu/hg/galaxy/rev/7a4e6f19aa17 changeset: 2737:7a4e6f19aa17 user: rc date: Mon Sep 21 12:06:33 2009 -0400 description: Galaxy AMQP messaging now uses amqp & sqlalchemy eggs 2 file(s) affected in this change: scripts/galaxy_messaging/amqp_consumer.py scripts/galaxy_messaging/galaxydb_interface.py diffs (58 lines): diff -r f2e5b1725b50 -r 7a4e6f19aa17 scripts/galaxy_messaging/amqp_consumer.py --- a/scripts/galaxy_messaging/amqp_consumer.py Mon Sep 21 11:21:35 2009 -0400 +++ b/scripts/galaxy_messaging/amqp_consumer.py Mon Sep 21 12:06:33 2009 -0400 @@ -9,13 +9,23 @@ this script can be run to receive messages and update the Galaxy database accordingly ''' - -from amqplib import client_0_8 as amqp import ConfigParser -import sys +import sys, os import optparse import xml.dom.minidom from galaxydb_interface import GalaxyDbInterface + +assert sys.version_info[:2] >= ( 2, 4 ) +new_path = [ os.path.join( os.getcwd(), "lib" ) ] +new_path.extend( sys.path[1:] ) # remove scripts/ from the path +sys.path = new_path + +from galaxy import eggs +import pkg_resources +pkg_resources.require( "amqplib" ) + +from amqplib import client_0_8 as amqp + galaxy_config_file = 'universe_wsgi.ini' global dbconnstr diff -r f2e5b1725b50 -r 7a4e6f19aa17 scripts/galaxy_messaging/galaxydb_interface.py --- a/scripts/galaxy_messaging/galaxydb_interface.py Mon Sep 21 11:21:35 2009 -0400 +++ b/scripts/galaxy_messaging/galaxydb_interface.py Mon Sep 21 12:06:33 2009 -0400 @@ -1,13 +1,22 @@ #/usr/bin/python -from sqlalchemy import * -from sqlalchemy.orm import sessionmaker from datetime import datetime, timedelta import sys import optparse import os import time import logging + +assert sys.version_info[:2] >= ( 2, 4 ) +new_path = [ os.path.join( os.getcwd(), "lib" ) ] +new_path.extend( sys.path[1:] ) # remove scripts/ from the path +sys.path = new_path +from galaxy import eggs +import pkg_resources +#pkg_resources.require( "psycopg2 >= 2.0.6" ) +pkg_resources.require( "SQLAlchemy >= 0.4" ) +from sqlalchemy import * +from sqlalchemy.orm import sessionmaker logging.basicConfig(level=logging.DEBUG) log = logging.getLogger( 'GalaxyDbInterface' )