[hg] galaxy 1666: Attempting to merge conflicts.
details: http://www.bx.psu.edu/hg/galaxy/rev/ced77aa5f967 changeset: 1666:ced77aa5f967 user: Greg Von Kuster <greg@bx.psu.edu> date: Mon Dec 15 08:58:33 2008 -0500 description: Attempting to merge conflicts. 1 file(s) affected in this change: tools/data_source/gbrowse_datasource.py diffs (55 lines): diff -r 503fcdb79851 -r ced77aa5f967 tools/data_source/gbrowse_datasource.py --- a/tools/data_source/gbrowse_datasource.py Mon Dec 15 08:55:16 2008 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,51 +0,0 @@ -#!/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