diff --git a/scripts/galaxy_messaging/amqp_consumer.py b/scripts/galaxy_messaging/amqp_consumer.py index ac533b757f8..9775bb438ca 100644 --- a/scripts/galaxy_messaging/amqp_consumer.py +++ b/scripts/galaxy_messaging/amqp_consumer.py @@ -9,14 +9,24 @@ Once the RabbitMQ server has been setup and started with the given parameters, 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 --git a/scripts/galaxy_messaging/galaxydb_interface.py b/scripts/galaxy_messaging/galaxydb_interface.py index e07c5765ecc..16645f71b48 100644 --- a/scripts/galaxy_messaging/galaxydb_interface.py +++ b/scripts/galaxy_messaging/galaxydb_interface.py @@ -1,7 +1,5 @@ #/usr/bin/python -from sqlalchemy import * -from sqlalchemy.orm import sessionmaker from datetime import datetime, timedelta import sys import optparse @@ -9,6 +7,17 @@ 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' )