Skip to content

Commit

Permalink
Merge branch 'dev' into grid_histories
Browse files Browse the repository at this point in the history
  • Loading branch information
guerler committed Jun 13, 2017
2 parents 72d0385 + 3e36af0 commit b9461eb
Show file tree
Hide file tree
Showing 42 changed files with 1,141 additions and 367 deletions.
14 changes: 12 additions & 2 deletions client/galaxy/scripts/apps/analysis.js
Expand Up @@ -9,7 +9,8 @@ var jQuery = require( 'jquery' ),
UserPreferences = require( 'mvc/user/user-preferences' ),
CustomBuilds = require( 'mvc/user/user-custom-builds' ),
Tours = require( 'mvc/tours' ),
GridView = require( 'mvc/grid/grid-view' )
GridView = require( 'mvc/grid/grid-view' ),
PageList = require( 'mvc/page/page-list' ),
Workflows = require( 'mvc/workflow/workflow' ),
HistoryList = require( 'mvc/history/history-list' ),
WorkflowsConfigureMenu = require( 'mvc/workflow/workflow-configure-menu' );
Expand Down Expand Up @@ -84,6 +85,7 @@ window.app = function app( options, bootstrapped ){
'(/)workflow(/)' : 'show_workflows',
'(/)pages(/)(:action_id)' : 'show_pages',
'(/)histories(/)(:action_id)' : 'show_histories',
'(/)datasets(/)(:action_id)' : 'show_datasets',
'(/)workflow/configure_menu(/)' : 'show_configure_menu',
'(/)custom_builds' : 'show_custom_builds'
},
Expand Down Expand Up @@ -123,8 +125,16 @@ window.app = function app( options, bootstrapped ){
this.page.display( new HistoryList.View() );
},

show_datasets : function() {
this.page.display( new GridView( { url_base: Galaxy.root + 'dataset/list', dict_format: true } ) );
},

show_pages : function( action_id ) {
this.page.display( new GridView( { url_base: Galaxy.root + 'page/list_published', dict_format: true } ) );
if ( action_id == 'list' ) {
this.page.display( new PageList.View() );
} else {
this.page.display( new GridView( { url_base: Galaxy.root + 'page/list_published', dict_format: true } ) );
}
},

show_workflows : function(){
Expand Down
6 changes: 3 additions & 3 deletions client/galaxy/scripts/layout/menu.js
Expand Up @@ -271,11 +271,11 @@ var Collection = Backbone.Collection.extend({
target : '_top'
},{
title : _l('Saved Datasets'),
url : 'dataset/list',
target : 'galaxy_main'
url : 'datasets/list',
target : '_top'
},{
title : _l('Saved Pages'),
url : 'page/list',
url : 'pages/list',
target : '_top'
}]
};
Expand Down
2 changes: 1 addition & 1 deletion client/galaxy/scripts/mvc/grid/grid-view.js
Expand Up @@ -639,7 +639,7 @@ return Backbone.View.extend({
var insert = self.grid.get('insert');

// request new configuration
var json = self.dict_format ? response_text.embedded_grid || response_text : $.parseJSON(response_text);
var json = self.dict_format ? response_text : $.parseJSON(response_text);

// update
json.embedded = embedded;
Expand Down
56 changes: 56 additions & 0 deletions client/galaxy/scripts/mvc/page/page-list.js
@@ -0,0 +1,56 @@
/** This class renders the page list. */
define( [ 'utils/utils', 'mvc/grid/grid-view' ], function( Utils, GridView ) {
var View = Backbone.View.extend({
initialize: function( options ) {
var self = this;
this.setElement( $( '<div/>' ) );
this.model = new Backbone.Model();
Utils.get({
url : Galaxy.root + 'page/list',
success : function( response ) {
response[ 'dict_format' ] = true;
self.model.set( response );
self.render();
}
});
},

render: function() {
var grid = new GridView( this.model.attributes );
this.$el.empty().append( grid.$el );
this.$el.append( this._templateShared() );
},

_templateShared: function() {
var $tmpl = $( '<div>' +
'<h2>Pages shared with you by others</h2>' +
'</div>' );
var options = this.model.attributes;
if ( options.shared_by_others && options.shared_by_others.length > 0 ) {
var $table = $( '<table class="colored" border="0" cellspacing="0" cellpadding="0" width="100%">' +
'<tr class="header">' +
'<th>Title</th>' +
'<th>Owner</th>' +
'</tr>' +
'</table>' );
_.each( options.shared_by_others, function( page, index ) {
var display_url = Galaxy.root + 'page/display_by_username_and_slug?username=' + page.username + '&slug=' + page.slug;
$table.append( '<tr>' +
'<td>' +
'<a href="' + display_url + '">' + _.escape( page.title ) + '</a>' +
'</td>' +
'<td>' + _.escape( page.username ) + '</td>' +
'</tr>' );
});
$tmpl.append( $table );
} else {
$tmpl.append( 'No pages have been shared with you.' );
}
return $tmpl;
}
});

return {
View: View
}
});
19 changes: 13 additions & 6 deletions config/datatypes_conf.xml.sample
Expand Up @@ -602,11 +602,18 @@
<datatype extension="maskinfo-asn1-binary" type="galaxy.datatypes.binary:GenericAsn1Binary" mimetype="application/octet-stream" subclass="true" display_in_upload="true" />
<datatype extension="pssm-asn1" type="galaxy.datatypes.data:GenericAsn1" mimetype="text/plain" subclass="true" display_in_upload="true" />
<!-- PlantTribes datatypes -->
<datatype extension="ptalign" type="galaxy.datatypes.text:PlantTribesMultipleSequenceAlignment" />
<datatype extension="ptortho" type="galaxy.datatypes.text:PlantTribesOrtho" />
<datatype extension="ptorthocs" type="galaxy.datatypes.text:PlantTribesOrthoCodingSequence" />
<datatype extension="pttree" type="galaxy.datatypes.text:PlantTribesPhylogeneticTree" />
<datatype extension="smat" type="galaxy.datatypes.text:Smat" display_in_upload="true" />
<datatype extension="ptalign" type="galaxy.datatypes.plant_tribes:PlantTribesMultipleSequenceAlignment" />
<datatype extension="ptalignca" type="galaxy.datatypes.plant_tribes:PlantTribesMultipleSequenceAlignmentCodonAlignment" />
<datatype extension="ptaligntrimmed" type="galaxy.datatypes.plant_tribes:PlantTribesMultipleSequenceAlignmentTrimmed" />
<datatype extension="ptaligntrimmedca" type="galaxy.datatypes.plant_tribes:PlantTribesMultipleSequenceAlignmentTrimmedCodonAlignment" />
<datatype extension="ptalignfiltered" type="galaxy.datatypes.plant_tribes:PlantTribesMultipleSequenceAlignmentFiltered" />
<datatype extension="ptalignfilteredca" type="galaxy.datatypes.plant_tribes:PlantTribesMultipleSequenceAlignmentFilteredCodonAlignment" />
<datatype extension="ptortho" type="galaxy.datatypes.plant_tribes:PlantTribesOrtho" />
<datatype extension="ptorthocs" type="galaxy.datatypes.plant_tribes:PlantTribesOrthoCodingSequence" />
<datatype extension="ptphylip" type="galaxy.datatypes.plant_tribes:PlantTribesPhylip" />
<datatype extension="pttgf" type="galaxy.datatypes.plant_tribes:PlantTribesTargetedGeneFamilies" />
<datatype extension="pttree" type="galaxy.datatypes.plant_tribes:PlantTribesPhylogeneticTree" />
<datatype extension="smat" type="galaxy.datatypes.plant_tribes:Smat" display_in_upload="true" />
</registration>
<sniffers>
<!--
Expand All @@ -616,7 +623,7 @@
defined format first, followed by next-most rigidly defined,
and so on.
-->
<sniffer type="galaxy.datatypes.text:Smat"/>
<sniffer type="galaxy.datatypes.plant_tribes:Smat"/>
<sniffer type="galaxy.datatypes.mothur:Sabund"/>
<sniffer type="galaxy.datatypes.mothur:Otu"/>
<sniffer type="galaxy.datatypes.mothur:GroupAbund"/>
Expand Down
8 changes: 4 additions & 4 deletions config/galaxy.ini.sample
Expand Up @@ -349,10 +349,10 @@ paste.app_factory = galaxy.web.buildapp:app_factory

# Interactive environment plugins root directory: where to look for interactive
# environment plugins. By default none will be loaded. Set to
# config/plugins/interactive_environments to load Galaxy's stock plugins
# (currently just Jupyter). These will require Docker to be configured and
# have security considerations, so proceed with caution. The path is relative to the
# Galaxy root dir. To use an absolute path begin the path with '/'. This is a comma
# config/plugins/interactive_environments to load Galaxy's stock plugins.
# These will require Docker to be configured and have security considerations,
# so proceed with caution. The path is relative to the Galaxy root dir. To use
# an absolute path begin the path with '/'. This is a comma
# separated list.
#interactive_environment_plugins_directory =

Expand Down
47 changes: 47 additions & 0 deletions config/job_conf.xml.sample_advanced
Expand Up @@ -440,6 +440,53 @@
the deployer. -->
<!-- <param id="require_container">true</param> -->
</destination>
<destination id="singularity_local" runner="local">
<param id="singularity_enabled">true</param>
<!-- See the above documentation for docker_volumes, singularity_volumes works
almost the same way. The only difference is that $default will expand with
rw directories that in Docker would expand as ro if any of subdirectories are rw.
As an example consider that Docker mounts the parent of the working directory
(this is known as the job directory) as ro and the working directory itself as rw.
This doesn't work in Singularity because if any parent directory is mounted as ro
none of its children will be rw. So the job directory will be mounted rw for
Singularity.
-->
<!--
<param id="singularity_volumes">$defaults,/mnt/galaxyData/libraries:ro,/mnt/galaxyData/indices:ro</param>
-->
<!-- You can configure singularity to run using sudo - this probably should not
be set and may be removed in the future.
-->
<!-- <param id="singularity_sudo">false</param> -->
<!-- Following option can be used to tweak sudo command used by
default. -->
<!-- <param id="singularity_sudo_cmd">/usr/bin/sudo -extra_param</param> -->
<!-- Pass extra arguments to the singularity exec command not covered by the
above options. -->
<!-- <param id="singularity_run_extra_arguments"></param> -->
<!-- Following command can be used to tweak singularity command. -->
<!-- <param id="singularity_cmd">/usr/local/custom_docker/docker</param> -->

<!-- If deployer wants to use singularity for isolation, but does not
trust tool's specified container - a destination wide override
can be set. This will cause all jobs on this destination to use
that singularity image. -->
<!-- <param id="singularity_container_id_override">/path/to/singularity/image</param> -->

<!-- Likewise, if deployer wants to use singularity for isolation and
does trust tool's specified container - but also wants tool's not
configured to run in a container the following option can provide
a fallback. -->
<!-- <param id="singularity_default_container_id">/path/to/singularity/image</param> -->

<!-- If the destination should be secured to only allow containerized jobs
the following parameter may be set for the job destination. Not all,
or even most, tools available in Galaxy core or in the Tool Shed
support Docker yet so this option may require a lot of extra work for
the deployer. -->
<!-- <param id="require_container">true</param> -->
</destination>
<destination id="pbs" runner="pbs" tags="mycluster"/>
<destination id="pbs_longjobs" runner="pbs" tags="mycluster,longjobs">
<!-- Define parameters that are native to the job runner plugin. -->
Expand Down
4 changes: 4 additions & 0 deletions lib/galaxy/config.py
Expand Up @@ -247,7 +247,11 @@ def __init__( self, **kwargs ):
log.warn("preserve_python_environment set to unknown value [%s], defaulting to legacy_only")
preserve_python_environment = "legacy_only"
self.preserve_python_environment = preserve_python_environment
# Older default container cache path, I don't think anyone is using it anymore and it wasn't documented - we
# should probably drop the backward compatiblity to save the path check.
self.container_image_cache_path = self.resolve_path( kwargs.get( "container_image_cache_path", "database/container_images" ) )
if not os.path.exists( self.container_image_cache_path ):
self.container_image_cache_path = self.resolve_path( kwargs.get( "container_image_cache_path", "database/container_cache" ) )
self.outputs_to_working_directory = string_as_bool( kwargs.get( 'outputs_to_working_directory', False ) )
self.output_size_limit = int( kwargs.get( 'output_size_limit', 0 ) )
self.retry_job_output_collection = int( kwargs.get( 'retry_job_output_collection', 0 ) )
Expand Down
23 changes: 22 additions & 1 deletion lib/galaxy/datatypes/data.py
Expand Up @@ -367,7 +367,28 @@ def display_data(self, trans, data, preview=False, filename=None, to_ext=None, *
file_path = trans.app.object_store.get_filename(data.dataset, extra_dir='dataset_%s_files' % data.dataset.id, alt_name=filename)
if os.path.exists( file_path ):
if os.path.isdir( file_path ):
return trans.show_error_message( "Directory listing is not allowed." ) # TODO: Reconsider allowing listing of directories?
tmp_fh = tempfile.NamedTemporaryFile(delete=False)
tmp_file_name = tmp_fh.name
dir_items = sorted(os.listdir(file_path))
base_path, item_name = os.path.split(file_path)
tmp_fh.write('<html><head><h3>Directory %s contents: %d items</h3></head>\n' % (item_name, len(dir_items)))
tmp_fh.write('<body><p/><table cellpadding="2">\n')
for index, fname in enumerate(dir_items):
if index % 2 == 0:
bgcolor = '#D8D8D8'
else:
bgcolor = '#FFFFFF'
# Can't have an href link here because there is no route
# defined for files contained within multiple subdirectory
# levels of the primary dataset. Something like this is
# close, but not quite correct:
# href = url_for(controller='dataset', action='display',
# dataset_id=trans.security.encode_id(data.dataset.id),
# preview=preview, filename=fname, to_ext=to_ext)
tmp_fh.write('<tr bgcolor="%s"><td>%s</td></tr>\n' % (bgcolor, fname))
tmp_fh.write('</table></body></html>\n')
tmp_fh.close()
return open(tmp_file_name)
mime = mimetypes.guess_type( file_path )[0]
if not mime:
try:
Expand Down

0 comments on commit b9461eb

Please sign in to comment.