[hg] galaxy 1665: merging heads
details: http://www.bx.psu.edu/hg/galaxy/rev/503fcdb79851 changeset: 1665:503fcdb79851 user: Greg Von Kuster <greg@bx.psu.edu> date: Mon Dec 15 08:55:16 2008 -0500 description: merging heads 3 file(s) affected in this change: lib/galaxy/web/framework/__init__.py test/functional/__init__.py tools/data_source/gbrowse_datasource.py diffs (116 lines): diff -r 5f4511a5b4d6 -r 503fcdb79851 lib/galaxy/web/framework/__init__.py --- a/lib/galaxy/web/framework/__init__.py Sat Dec 13 23:35:29 2008 -0500 +++ b/lib/galaxy/web/framework/__init__.py Mon Dec 15 08:55:16 2008 -0500 @@ -105,6 +105,8 @@ self.app = app self.webapp = webapp self.security = webapp.security + # FIXME: the following 3 attributes are not currently used + # Remove them if they are not going to be... self.__user = NOT_SET self.__history = NOT_SET self.__galaxy_session = NOT_SET @@ -178,9 +180,17 @@ Support for universe_session and universe_user cookies has been removed as of 31 Oct 2008. """ + #log.debug("####In __ensure_valid_session...") + #try: + # log.debug("####In __ensure_valid_session, self.galaxy_session: %s" % str( self.galaxy_session ) ) + # log.debug("####In __ensure_valid_session, self.galaxy_session.is_valid: %s" % str(self.galaxy_session.is_valid)) + #except: + # log.debug("####In __ensure_valid_session, self.galaxy_session does not yet exist...") sa_session = self.sa_session # Try to load an existing session + #log.debug("###In __ensure_valid_session, before secure_id = self.get_cookie( name='galaxysession' )...") secure_id = self.get_cookie( name='galaxysession' ) + #log.debug("###In __ensure_valid_session, secure_id: %s" % str( secure_id) ) galaxy_session = None prev_galaxy_session = None user_for_new_session = None @@ -191,8 +201,10 @@ if secure_id: # Decode the cookie value to get the session_key session_key = self.security.decode_session_key( secure_id ) + #log.debug("###In __ensure_valid_session, session_key: %s" % str( session_key) ) # Retrive the galaxy_session id via the unique session_key galaxy_session = sa_session.query( self.app.model.GalaxySession ).filter_by( session_key=session_key, is_valid=True ).first() + #log.debug("###In __ensure_valid_session, galaxy_session: %s" % str( galaxy_session) ) # If remote user is in use it can invalidate the session, so we need to # to check some things now. if self.app.config.use_remote_user: @@ -248,6 +260,7 @@ Caller is responsible for flushing the returned session. """ + #log.debug("###In __create_new_session...") session_key = self.security.get_new_session_key() galaxy_session = self.app.model.GalaxySession( session_key=session_key, diff -r 5f4511a5b4d6 -r 503fcdb79851 test/functional/__init__.py --- a/test/functional/__init__.py Sat Dec 13 23:35:29 2008 -0500 +++ b/test/functional/__init__.py Mon Dec 15 08:55:16 2008 -0500 @@ -24,7 +24,7 @@ # server (for running the tests against a running instance) default_galaxy_test_host = "localhost" -default_galaxy_test_port = "9999" +default_galaxy_test_port = "9879" galaxy_test_file_dir = "test-data" server = None app = None diff -r 5f4511a5b4d6 -r 503fcdb79851 tools/data_source/gbrowse_datasource.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tools/data_source/gbrowse_datasource.py Mon Dec 15 08:55:16 2008 -0500 @@ -0,0 +1,51 @@ +#!/usr/bin/env python +#Retreives data from GMOD and stores in a file. GBrowse parameters are provided in the input/output file. +import urllib, sys, os, gzip, tempfile, shutil + +assert sys.version_info[:2] >= ( 2, 4 ) + +def stop_err( msg ): + sys.stderr.write( msg ) + sys.exit() + +def __main__(): + filename = sys.argv[1] + params = {} + + for line in open( filename, 'r' ): + try: + line = line.strip() + fields = line.split( '\t' ) + params[ fields[0] ] = fields[1] + except: + continue + + URL = params.get( 'URL', None ) + if not URL: + open( filename, 'w' ).write( "" ) + stop_err( 'Datasource has not sent back a URL parameter.' ) + + for i, param in enumerate( params.keys() ): + if i == 0: + sep = '?' + else: + sep = '&' + if param != '__collected_datasets__': + URL += "%s%s=%s" % ( sep, param, params.get( param ) ) + + CHUNK_SIZE = 2**20 # 1Mb + try: + page = urllib.urlopen( URL ) + except Exception, exc: + raise Exception( 'Problems connecting to %s (%s)' % ( URL, exc ) ) + sys.exit( 1 ) + + fp = open( filename, 'wb' ) + while 1: + chunk = page.read( CHUNK_SIZE ) + if not chunk: + break + fp.write( chunk ) + fp.close() + +if __name__ == "__main__": __main__()
participants (1)
-
Greg Von Kuster