details: http://www.bx.psu.edu/hg/galaxy/rev/f0a17cdd31a9 changeset: 2651:f0a17cdd31a9 user: jeremy goecks <jeremy.goecks@emory.edu> date: Fri Aug 28 15:55:37 2009 -0400 description: merge 0 file(s) affected in this change: diffs (152 lines): diff -r e383b1e2f8b0 -r f0a17cdd31a9 eggs.ini --- a/eggs.ini Fri Aug 28 15:44:28 2009 -0400 +++ b/eggs.ini Fri Aug 28 15:55:37 2009 -0400 @@ -26,13 +26,12 @@ numpy = 1.2.1 [eggs:noplatform] -Beaker = 0.5 +Beaker = 1.4 docutils = 0.4 elementtree = 1.2.6_20050316 -flup = 0.5 lrucache = 0.2 ;lsprof - james -Mako = 0.1.10 +Mako = 0.2.4 MyghtyUtils = 0.52 nose = 0.9.1 NoseHTML = 0.2 @@ -76,12 +75,11 @@ python_lzo = http://www.oberhumer.com/opensource/lzo/download/LZO-v1/python-lzo-1.08.tar.... http://www.oberhumer.com/opensource/lzo/download/LZO-v1/lzo-1.08.tar.gz threadframe = http://www.majid.info/python/threadframe/threadframe-0.2.tar.gz guppy = http://pypi.python.org/packages/source/g/guppy/guppy-0.1.8.tar.gz -Beaker = http://cheeseshop.python.org/packages/source/B/Beaker/Beaker-0.5.tar.gz +Beaker = http://cheeseshop.python.org/packages/source/B/Beaker/Beaker-1.4.tar.gz docutils = http://downloads.sourceforge.net/docutils/docutils-0.4.tar.gz elementtree = http://effbot.org/downloads/elementtree-1.2.6-20050316.tar.gz -flup = http://www.saddi.com/software/flup/dist/archive/flup-r2311.tar.gz lrucache = http://evan.prodromou.name/lrucache/lrucache-0.2.tar.gz -Mako = http://www.makotemplates.org/downloads/Mako-0.1.10.tar.gz +Mako = http://www.makotemplates.org/downloads/Mako-0.2.4.tar.gz MyghtyUtils = http://cheeseshop.python.org/packages/source/M/MyghtyUtils/MyghtyUtils-0.52.... nose = http://www.somethingaboutorange.com/mrl/projects/nose/nose-0.9.1.tar.gz NoseHTML = http://dist.g2.bx.psu.edu/nosehtml-0.2.tar.bz2 diff -r e383b1e2f8b0 -r f0a17cdd31a9 lib/galaxy/datatypes/images.py --- a/lib/galaxy/datatypes/images.py Fri Aug 28 15:44:28 2009 -0400 +++ b/lib/galaxy/datatypes/images.py Fri Aug 28 15:55:37 2009 -0400 @@ -9,6 +9,7 @@ from galaxy.datatypes.sniff import * from urllib import urlencode, quote_plus import zipfile +import os, subprocess, tempfile log = logging.getLogger(__name__) @@ -240,6 +241,26 @@ """Class describing a BAM binary file""" file_ext = "bam" MetadataElement( name="bam_index", desc="BAM Index File", param=metadata.FileParameter, readonly=True, no_value=None, visible=False, optional=True ) + def init_meta( self, dataset, copy_from=None ): + data.Binary.init_meta( self, dataset, copy_from=copy_from ) + def set_meta( self, dataset, overwrite = True, **kwd ): + """ + Sets index for BAM file. + """ + index_file = dataset.metadata.bam_index + if not index_file: + index_file = dataset.metadata.spec['bam_index'].param.new_file( dataset = dataset ) + tmp_dir = tempfile.gettempdir() + tmpf1 = tempfile.NamedTemporaryFile(dir=tmp_dir) + try: + subprocess.check_call(['cd', tmp_dir], shell=True) + subprocess.check_call('cp %s %s' % (dataset.file_name, tmpf1.name), shell=True) + subprocess.check_call('samtools index %s' % tmpf1.name, shell=True) + subprocess.check_call('cp %s.bai %s' % (tmpf1.name, index_file.file_name), shell=True) + except subprocess.CalledProcessError: + sys.stderr.write('There was a problem creating the index for the BAM file\n') + tmpf1.close() + dataset.metadata.bam_index = index_file def set_peek( self, dataset ): if not dataset.dataset.purged: export_url = "/history_add_to?" + urlencode({'history_id':dataset.history_id,'ext':'bam','name':'bam alignments','info':'Alignments file','dbkey':dataset.dbkey}) @@ -256,4 +277,3 @@ def get_mime(self): """Returns the mime type of the datatype""" return 'application/octet-stream' - \ No newline at end of file diff -r e383b1e2f8b0 -r f0a17cdd31a9 lib/galaxy/web/buildapp.py --- a/lib/galaxy/web/buildapp.py Fri Aug 28 15:44:28 2009 -0400 +++ b/lib/galaxy/web/buildapp.py Fri Aug 28 15:55:37 2009 -0400 @@ -11,7 +11,6 @@ from paste.util import import_string from paste import httpexceptions from paste.deploy.converters import asbool -import flup.middleware.session as flup_session import pkg_resources log = logging.getLogger( __name__ ) @@ -116,17 +115,6 @@ from paste import recursive app = recursive.RecursiveMiddleware( app, conf ) log.debug( "Enabling 'recursive' middleware" ) - ## # Session middleware puts a session factory into the environment - ## if asbool( conf.get( 'use_session', True ) ): - ## store = flup_session.MemorySessionStore() - ## app = flup_session.SessionMiddleware( store, app ) - ## log.debug( "Enabling 'flup session' middleware" ) - # Beaker session middleware - if asbool( conf.get( 'use_beaker_session', False ) ): - pkg_resources.require( "Beaker" ) - import beaker.session - app = beaker.session.SessionMiddleware( app, conf ) - log.debug( "Enabling 'beaker session' middleware" ) # Various debug middleware that can only be turned on if the debug # flag is set, either because they are insecure or greatly hurt # performance diff -r e383b1e2f8b0 -r f0a17cdd31a9 lib/galaxy/web/framework/__init__.py --- a/lib/galaxy/web/framework/__init__.py Fri Aug 28 15:44:28 2009 -0400 +++ b/lib/galaxy/web/framework/__init__.py Fri Aug 28 15:55:37 2009 -0400 @@ -583,12 +583,12 @@ data.update( kwargs ) ## return template.render( **data ) def render( environ, start_response ): - response_write = start_response( self.response.wsgi_status(), - self.response.wsgi_headeritems() ) - class C: - def write( self, *args, **kwargs ): - response_write( *args, **kwargs ) - context = mako.runtime.Context( C(), **data ) + response_write = start_response( self.response.wsgi_status(), self.response.wsgi_headeritems() ) + class StreamBuffer( object ): + def write( self, d ): + response_write( d.encode( 'utf-8' ) ) + buffer = StreamBuffer() + context = mako.runtime.Context( buffer, **data ) template.render_context( context ) return [] return render diff -r e383b1e2f8b0 -r f0a17cdd31a9 lib/galaxy/web/framework/base.py --- a/lib/galaxy/web/framework/base.py Fri Aug 28 15:44:28 2009 -0400 +++ b/lib/galaxy/web/framework/base.py Fri Aug 28 15:55:37 2009 -0400 @@ -13,7 +13,6 @@ import pkg_resources; pkg_resources.require( "Paste" ) pkg_resources.require( "Routes" ) -pkg_resources.require( "flup" ) pkg_resources.require( "WebOb" ) import routes diff -r e383b1e2f8b0 -r f0a17cdd31a9 templates/root/history_common.mako --- a/templates/root/history_common.mako Fri Aug 28 15:44:28 2009 -0400 +++ b/templates/root/history_common.mako Fri Aug 28 15:55:37 2009 -0400 @@ -35,7 +35,7 @@ <a class="icon-button delete" title="delete" href="${h.url_for( action='delete', id=data.id, show_deleted_on_refresh=show_deleted_on_refresh )}" id="historyItemDeleter-${data.id}"></a> </div> <span class="state-icon"></span> - <span class="historyItemTitle"><b>${hid}: ${data.display_name()}</b></span> + <span class="historyItemTitle"><b>${hid}: ${data.display_name().decode('utf-8')}</b></span> </div> ## Body for history items, extra info and actions, data "peek"