galaxy-commits
Threads by month
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
February 2014
- 1 participants
- 192 discussions
2 new commits in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/8bd6b50a9fc1/
Changeset: 8bd6b50a9fc1
User: trevorw
Date: 2014-02-21 01:14:09
Summary: whitespace
Affected #: 7 files
diff -r 0f65411e40224e7a9b32f3273896113654a742ce -r 8bd6b50a9fc10b334647a5df755d845d341612ee lib/galaxy/datatypes/registry.py
--- a/lib/galaxy/datatypes/registry.py
+++ b/lib/galaxy/datatypes/registry.py
@@ -350,7 +350,7 @@
except Exception, e:
self.log.exception( 'Error calling method %s from class %s: %s', str( datatype_class_name ), str( module ), str( e ) )
ok = False
- if ok:
+ if ok:
if deactivate:
# We are deactivating or uninstalling an installed Tool Shed repository, so eliminate the appropriate sniffers.
sniffer_class = elem.get( 'type', None )
diff -r 0f65411e40224e7a9b32f3273896113654a742ce -r 8bd6b50a9fc10b334647a5df755d845d341612ee lib/galaxy/model/__init__.py
--- a/lib/galaxy/model/__init__.py
+++ b/lib/galaxy/model/__init__.py
@@ -1850,7 +1850,7 @@
if hda.copied_from_library_dataset_dataset_association is not None:
rval['copied_from_ldda_id'] = hda.copied_from_library_dataset_dataset_association.id
-
+
if hda.history is not None:
rval['history_id'] = hda.history.id
diff -r 0f65411e40224e7a9b32f3273896113654a742ce -r 8bd6b50a9fc10b334647a5df755d845d341612ee lib/galaxy/tools/parameters/basic.py
--- a/lib/galaxy/tools/parameters/basic.py
+++ b/lib/galaxy/tools/parameters/basic.py
@@ -1621,7 +1621,7 @@
if type( value ) != list:
value = [ value ]
field = form_builder.SelectField( self.name, self.multiple, None, self.refresh_on_change, refresh_on_change_values=self.refresh_on_change_values )
-
+
# CRUCIAL: the dataset_collector function needs to be local to DataToolParameter.get_html_field()
def dataset_collector( hdas, parent_hid ):
current_user_roles = trans.get_current_user_roles()
diff -r 0f65411e40224e7a9b32f3273896113654a742ce -r 8bd6b50a9fc10b334647a5df755d845d341612ee lib/galaxy/tools/parameters/grouping.py
--- a/lib/galaxy/tools/parameters/grouping.py
+++ b/lib/galaxy/tools/parameters/grouping.py
@@ -501,7 +501,7 @@
else:
input.visit_inputs( prefix, value[input.name], callback )
def get_initial_value( self, trans, context, history=None ):
- # State for a conditional is a plain dictionary.
+ # State for a conditional is a plain dictionary.
rval = {}
# Get the default value for the 'test element' and use it
# to determine the current case
diff -r 0f65411e40224e7a9b32f3273896113654a742ce -r 8bd6b50a9fc10b334647a5df755d845d341612ee lib/galaxy/webapps/galaxy/buildapp.py
--- a/lib/galaxy/webapps/galaxy/buildapp.py
+++ b/lib/galaxy/webapps/galaxy/buildapp.py
@@ -138,9 +138,9 @@
webapp.mapper.resource( 'workflow', 'workflows', path_prefix='/api' )
webapp.mapper.resource_with_deleted( 'history', 'histories', path_prefix='/api' )
webapp.mapper.resource( 'configuration', 'configuration', path_prefix='/api' )
- webapp.mapper.resource( 'datatype',
- 'datatypes',
- path_prefix='/api',
+ webapp.mapper.resource( 'datatype',
+ 'datatypes',
+ path_prefix='/api',
collection={ 'sniffers': 'GET' },
parent_resources=dict( member_name='datatype', collection_name='datatypes' ) )
#webapp.mapper.connect( 'run_workflow', '/api/workflow/{workflow_id}/library/{library_id}', controller='workflows', action='run', workflow_id=None, library_id=None, conditions=dict(method=["GET"]) )
@@ -180,41 +180,41 @@
# ============================
webapp.mapper.connect( 'api_key_retrieval',
- '/api/authenticate/baseauth/',
- controller='authenticate',
- action='get_api_key',
+ '/api/authenticate/baseauth/',
+ controller='authenticate',
+ action='get_api_key',
conditions=dict( method=[ "GET" ] ) )
# =======================
# ===== LIBRARY API =====
# =======================
-
+
webapp.mapper.connect( 'show_lda_item',
- '/api/libraries/datasets/:id',
- controller='lda_datasets',
- action='show',
+ '/api/libraries/datasets/:id',
+ controller='lda_datasets',
+ action='show',
conditions=dict( method=[ "GET" ] ) )
- webapp.mapper.connect( 'download_lda_items',
- '/api/libraries/datasets/download/:format',
- controller='lda_datasets',
- action='download',
+ webapp.mapper.connect( 'download_lda_items',
+ '/api/libraries/datasets/download/:format',
+ controller='lda_datasets',
+ action='download',
conditions=dict( method=[ "POST", "GET" ] ) )
- webapp.mapper.connect( 'create_folder',
- '/api/folders/:encoded_parent_folder_id',
- controller='folders',
- action='create',
+ webapp.mapper.connect( 'create_folder',
+ '/api/folders/:encoded_parent_folder_id',
+ controller='folders',
+ action='create',
conditions=dict( method=[ "POST" ] ) )
webapp.mapper.resource_with_deleted( 'library',
- 'libraries',
+ 'libraries',
path_prefix='/api' )
- webapp.mapper.resource( 'folder',
- 'folders',
+ webapp.mapper.resource( 'folder',
+ 'folders',
path_prefix='/api' )
- webapp.mapper.resource( 'content',
+ webapp.mapper.resource( 'content',
'contents',
controller='folder_contents',
name_prefix='folder_',
@@ -233,9 +233,9 @@
'permissions',
path_prefix='/api/libraries/:library_id',
parent_resources=dict( member_name='library', collection_name='libraries' ) )
-
- webapp.mapper.resource( 'job',
- 'jobs',
+
+ webapp.mapper.resource( 'job',
+ 'jobs',
path_prefix='/api' )
webapp.mapper.connect( 'job_search', '/api/jobs/search', controller='jobs', action='search', conditions=dict( method=['POST'] ) )
@@ -243,7 +243,7 @@
_add_item_extended_metadata_controller( webapp,
name_prefix="library_dataset_",
path_prefix='/api/libraries/:library_id/contents/:library_content_id' )
-
+
_add_item_extended_metadata_controller( webapp,
name_prefix="history_dataset_",
path_prefix='/api/histories/:history_id/contents/:history_content_id' )
@@ -251,14 +251,14 @@
# ====================
# ===== TOOLSHED =====
# ====================
-
+
# Handle displaying tool help images and README file images contained in repositories installed from the tool shed.
webapp.add_route( '/admin_toolshed/static/images/:repository_id/:image_file',
controller='admin_toolshed',
action='display_image_in_repository',
repository_id=None,
image_file=None )
-
+
# Galaxy API for tool shed features.
webapp.mapper.resource( 'tool_shed_repository',
'tool_shed_repositories',
diff -r 0f65411e40224e7a9b32f3273896113654a742ce -r 8bd6b50a9fc10b334647a5df755d845d341612ee lib/galaxy/webapps/galaxy/controllers/tool_runner.py
--- a/lib/galaxy/webapps/galaxy/controllers/tool_runner.py
+++ b/lib/galaxy/webapps/galaxy/controllers/tool_runner.py
@@ -239,7 +239,7 @@
Redirects a user accessing a Data Source tool to its target action link.
This method will subvert mix-mode content blocking in several browsers when
accessing non-https data_source tools from an https galaxy server.
-
+
Tested as working on Safari 7.0 and FireFox 26
Subverting did not work on Chrome 31
"""
@@ -255,13 +255,13 @@
trans.log_event( "Tool id '%s' does not exist" % tool_id )
trans.response.status = 404
return "Tool '%s' does not exist, kwd=%s " % ( tool_id, kwd )
-
+
if isinstance( tool, DataSourceTool ):
link = url_for( tool.action, **tool.get_static_param_values( trans ) )
else:
link = url_for( controller='tool_runner', tool_id=tool.id )
return trans.response.send_redirect( link )
-
+
@web.expose
def redirect( self, trans, redirect_url=None, **kwd ):
if not redirect_url:
diff -r 0f65411e40224e7a9b32f3273896113654a742ce -r 8bd6b50a9fc10b334647a5df755d845d341612ee tools/data_source/upload.py
--- a/tools/data_source/upload.py
+++ b/tools/data_source/upload.py
@@ -126,7 +126,7 @@
elif is_gzipped and is_valid:
if link_data_only == 'copy_files':
# We need to uncompress the temp_name file, but BAM files must remain compressed in the BGZF format
- CHUNK_SIZE = 2**20 # 1Mb
+ CHUNK_SIZE = 2**20 # 1Mb
fd, uncompressed = tempfile.mkstemp( prefix='data_id_%s_upload_gunzip_' % dataset.dataset_id, dir=os.path.dirname( output_path ), text=False )
gzipped_file = gzip.GzipFile( dataset.path, 'rb' )
while 1:
@@ -159,7 +159,7 @@
elif is_bzipped and is_valid:
if link_data_only == 'copy_files':
# We need to uncompress the temp_name file
- CHUNK_SIZE = 2**20 # 1Mb
+ CHUNK_SIZE = 2**20 # 1Mb
fd, uncompressed = tempfile.mkstemp( prefix='data_id_%s_upload_bunzip2_' % dataset.dataset_id, dir=os.path.dirname( output_path ), text=False )
bzipped_file = bz2.BZ2File( dataset.path, 'rb' )
while 1:
https://bitbucket.org/galaxy/galaxy-central/commits/1f2383ac9a8e/
Changeset: 1f2383ac9a8e
User: jmchilton
Date: 2014-02-21 03:25:04
Summary: Merged in trevorw/galaxy-central (pull request #331)
whitespace
Affected #: 7 files
diff -r d7c8982b89def2729638c5c4fad3fa14325f608e -r 1f2383ac9a8ec518f4c91a4c5c2de825f4ddf36f lib/galaxy/datatypes/registry.py
--- a/lib/galaxy/datatypes/registry.py
+++ b/lib/galaxy/datatypes/registry.py
@@ -350,7 +350,7 @@
except Exception, e:
self.log.exception( 'Error calling method %s from class %s: %s', str( datatype_class_name ), str( module ), str( e ) )
ok = False
- if ok:
+ if ok:
if deactivate:
# We are deactivating or uninstalling an installed Tool Shed repository, so eliminate the appropriate sniffers.
sniffer_class = elem.get( 'type', None )
diff -r d7c8982b89def2729638c5c4fad3fa14325f608e -r 1f2383ac9a8ec518f4c91a4c5c2de825f4ddf36f lib/galaxy/model/__init__.py
--- a/lib/galaxy/model/__init__.py
+++ b/lib/galaxy/model/__init__.py
@@ -1850,7 +1850,7 @@
if hda.copied_from_library_dataset_dataset_association is not None:
rval['copied_from_ldda_id'] = hda.copied_from_library_dataset_dataset_association.id
-
+
if hda.history is not None:
rval['history_id'] = hda.history.id
diff -r d7c8982b89def2729638c5c4fad3fa14325f608e -r 1f2383ac9a8ec518f4c91a4c5c2de825f4ddf36f lib/galaxy/tools/parameters/basic.py
--- a/lib/galaxy/tools/parameters/basic.py
+++ b/lib/galaxy/tools/parameters/basic.py
@@ -1621,7 +1621,7 @@
if type( value ) != list:
value = [ value ]
field = form_builder.SelectField( self.name, self.multiple, None, self.refresh_on_change, refresh_on_change_values=self.refresh_on_change_values )
-
+
# CRUCIAL: the dataset_collector function needs to be local to DataToolParameter.get_html_field()
def dataset_collector( hdas, parent_hid ):
current_user_roles = trans.get_current_user_roles()
diff -r d7c8982b89def2729638c5c4fad3fa14325f608e -r 1f2383ac9a8ec518f4c91a4c5c2de825f4ddf36f lib/galaxy/tools/parameters/grouping.py
--- a/lib/galaxy/tools/parameters/grouping.py
+++ b/lib/galaxy/tools/parameters/grouping.py
@@ -501,7 +501,7 @@
else:
input.visit_inputs( prefix, value[input.name], callback )
def get_initial_value( self, trans, context, history=None ):
- # State for a conditional is a plain dictionary.
+ # State for a conditional is a plain dictionary.
rval = {}
# Get the default value for the 'test element' and use it
# to determine the current case
diff -r d7c8982b89def2729638c5c4fad3fa14325f608e -r 1f2383ac9a8ec518f4c91a4c5c2de825f4ddf36f lib/galaxy/webapps/galaxy/buildapp.py
--- a/lib/galaxy/webapps/galaxy/buildapp.py
+++ b/lib/galaxy/webapps/galaxy/buildapp.py
@@ -138,9 +138,9 @@
webapp.mapper.resource( 'workflow', 'workflows', path_prefix='/api' )
webapp.mapper.resource_with_deleted( 'history', 'histories', path_prefix='/api' )
webapp.mapper.resource( 'configuration', 'configuration', path_prefix='/api' )
- webapp.mapper.resource( 'datatype',
- 'datatypes',
- path_prefix='/api',
+ webapp.mapper.resource( 'datatype',
+ 'datatypes',
+ path_prefix='/api',
collection={ 'sniffers': 'GET' },
parent_resources=dict( member_name='datatype', collection_name='datatypes' ) )
#webapp.mapper.connect( 'run_workflow', '/api/workflow/{workflow_id}/library/{library_id}', controller='workflows', action='run', workflow_id=None, library_id=None, conditions=dict(method=["GET"]) )
@@ -180,41 +180,41 @@
# ============================
webapp.mapper.connect( 'api_key_retrieval',
- '/api/authenticate/baseauth/',
- controller='authenticate',
- action='get_api_key',
+ '/api/authenticate/baseauth/',
+ controller='authenticate',
+ action='get_api_key',
conditions=dict( method=[ "GET" ] ) )
# =======================
# ===== LIBRARY API =====
# =======================
-
+
webapp.mapper.connect( 'show_lda_item',
- '/api/libraries/datasets/:id',
- controller='lda_datasets',
- action='show',
+ '/api/libraries/datasets/:id',
+ controller='lda_datasets',
+ action='show',
conditions=dict( method=[ "GET" ] ) )
- webapp.mapper.connect( 'download_lda_items',
- '/api/libraries/datasets/download/:format',
- controller='lda_datasets',
- action='download',
+ webapp.mapper.connect( 'download_lda_items',
+ '/api/libraries/datasets/download/:format',
+ controller='lda_datasets',
+ action='download',
conditions=dict( method=[ "POST", "GET" ] ) )
- webapp.mapper.connect( 'create_folder',
- '/api/folders/:encoded_parent_folder_id',
- controller='folders',
- action='create',
+ webapp.mapper.connect( 'create_folder',
+ '/api/folders/:encoded_parent_folder_id',
+ controller='folders',
+ action='create',
conditions=dict( method=[ "POST" ] ) )
webapp.mapper.resource_with_deleted( 'library',
- 'libraries',
+ 'libraries',
path_prefix='/api' )
- webapp.mapper.resource( 'folder',
- 'folders',
+ webapp.mapper.resource( 'folder',
+ 'folders',
path_prefix='/api' )
- webapp.mapper.resource( 'content',
+ webapp.mapper.resource( 'content',
'contents',
controller='folder_contents',
name_prefix='folder_',
@@ -233,9 +233,9 @@
'permissions',
path_prefix='/api/libraries/:library_id',
parent_resources=dict( member_name='library', collection_name='libraries' ) )
-
- webapp.mapper.resource( 'job',
- 'jobs',
+
+ webapp.mapper.resource( 'job',
+ 'jobs',
path_prefix='/api' )
webapp.mapper.connect( 'job_search', '/api/jobs/search', controller='jobs', action='search', conditions=dict( method=['POST'] ) )
@@ -243,7 +243,7 @@
_add_item_extended_metadata_controller( webapp,
name_prefix="library_dataset_",
path_prefix='/api/libraries/:library_id/contents/:library_content_id' )
-
+
_add_item_extended_metadata_controller( webapp,
name_prefix="history_dataset_",
path_prefix='/api/histories/:history_id/contents/:history_content_id' )
@@ -251,14 +251,14 @@
# ====================
# ===== TOOLSHED =====
# ====================
-
+
# Handle displaying tool help images and README file images contained in repositories installed from the tool shed.
webapp.add_route( '/admin_toolshed/static/images/:repository_id/:image_file',
controller='admin_toolshed',
action='display_image_in_repository',
repository_id=None,
image_file=None )
-
+
# Galaxy API for tool shed features.
webapp.mapper.resource( 'tool_shed_repository',
'tool_shed_repositories',
diff -r d7c8982b89def2729638c5c4fad3fa14325f608e -r 1f2383ac9a8ec518f4c91a4c5c2de825f4ddf36f lib/galaxy/webapps/galaxy/controllers/tool_runner.py
--- a/lib/galaxy/webapps/galaxy/controllers/tool_runner.py
+++ b/lib/galaxy/webapps/galaxy/controllers/tool_runner.py
@@ -239,7 +239,7 @@
Redirects a user accessing a Data Source tool to its target action link.
This method will subvert mix-mode content blocking in several browsers when
accessing non-https data_source tools from an https galaxy server.
-
+
Tested as working on Safari 7.0 and FireFox 26
Subverting did not work on Chrome 31
"""
@@ -255,13 +255,13 @@
trans.log_event( "Tool id '%s' does not exist" % tool_id )
trans.response.status = 404
return "Tool '%s' does not exist, kwd=%s " % ( tool_id, kwd )
-
+
if isinstance( tool, DataSourceTool ):
link = url_for( tool.action, **tool.get_static_param_values( trans ) )
else:
link = url_for( controller='tool_runner', tool_id=tool.id )
return trans.response.send_redirect( link )
-
+
@web.expose
def redirect( self, trans, redirect_url=None, **kwd ):
if not redirect_url:
diff -r d7c8982b89def2729638c5c4fad3fa14325f608e -r 1f2383ac9a8ec518f4c91a4c5c2de825f4ddf36f tools/data_source/upload.py
--- a/tools/data_source/upload.py
+++ b/tools/data_source/upload.py
@@ -126,7 +126,7 @@
elif is_gzipped and is_valid:
if link_data_only == 'copy_files':
# We need to uncompress the temp_name file, but BAM files must remain compressed in the BGZF format
- CHUNK_SIZE = 2**20 # 1Mb
+ CHUNK_SIZE = 2**20 # 1Mb
fd, uncompressed = tempfile.mkstemp( prefix='data_id_%s_upload_gunzip_' % dataset.dataset_id, dir=os.path.dirname( output_path ), text=False )
gzipped_file = gzip.GzipFile( dataset.path, 'rb' )
while 1:
@@ -159,7 +159,7 @@
elif is_bzipped and is_valid:
if link_data_only == 'copy_files':
# We need to uncompress the temp_name file
- CHUNK_SIZE = 2**20 # 1Mb
+ CHUNK_SIZE = 2**20 # 1Mb
fd, uncompressed = tempfile.mkstemp( prefix='data_id_%s_upload_bunzip2_' % dataset.dataset_id, dir=os.path.dirname( output_path ), text=False )
bzipped_file = bz2.BZ2File( dataset.path, 'rb' )
while 1:
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/d7c8982b89de/
Changeset: d7c8982b89de
User: guerler
Date: 2014-02-21 02:11:07
Summary: Pack scripts
Affected #: 1 file
diff -r 86f8a8311fec37d0cfcae2e919e37e96a31ca297 -r d7c8982b89def2729638c5c4fad3fa14325f608e static/scripts/packed/mvc/ui/ui-portlet.js
--- /dev/null
+++ b/static/scripts/packed/mvc/ui/ui-portlet.js
@@ -0,0 +1,1 @@
+define(["utils/utils"],function(a){var b=Backbone.View.extend({visible:false,optionsDefault:{label:"",icon:"fa-tasks",buttons:null,body:null,height:null,operations:null,placement:"bottom",overflow:"auto"},$content:null,initialize:function(d){this.options=a.merge(d,this.optionsDefault);this.setElement(this.template(this.options));this.$content=this.$el.find("#content");if(this.options.height){this.$el.find("#body").css("height",this.options.height);this.$el.find("#content").css("overflow",this.options.overflow)}this.$buttons=$(this.el).find("#buttons");if(this.options.buttons){var c=this;$.each(this.options.buttons,function(e,f){f.$el.prop("id",e);c.$buttons.append(f.$el)})}else{this.$buttons.remove()}this.$operations=$(this.el).find("#operations");if(this.options.operations){var c=this;$.each(this.options.operations,function(e,f){f.$el.prop("id",e);c.$operations.append(f.$el)})}if(this.options.body){this.append(this.options.body)}},append:function(c){this.$content.append(a.wrap(c))},content:function(){return this.$content},show:function(){this.$el.fadeIn("fast");this.visible=true},hide:function(){this.$el.fadeOut("fast");this.visible=false},enableButton:function(c){this.$buttons.find("#"+c).prop("disabled",false)},disableButton:function(c){this.$buttons.find("#"+c).prop("disabled",true)},hideOperation:function(c){this.$operations.find("#"+c).hide()},showOperation:function(c){this.$operations.find("#"+c).show()},setOperation:function(e,d){var c=this.$operations.find("#"+e);c.off("click");c.on("click",d)},label:function(c){var d=this.$el.find("#label");if(c){d.html(c)}return d.html()},template:function(d){var c='<div class="toolForm">';if(d.label||d.icon){c+='<div id="title" class="toolFormTitle" style="overflow:hidden;"><div id="operations" style="float: right;"></div><div style="overflow: hidden">';if(d.icon){c+='<i style="padding-top: 3px; float: left; font-size: 1.2em" class="icon fa '+d.icon+'"> </i>'}c+='<div id="label" style="padding-top: 2px; float: left;">'+d.label+"</div>";c+="</div></div>"}c+='<div id="body" class="toolFormBody">';if(d.placement=="top"){c+='<div id="buttons" class="buttons" style="height: 50px; padding: 10px;"></div>'}c+='<div id="content" class="content" style="height: inherit; padding: 10px;"></div>';if(d.placement=="bottom"){c+='<div id="buttons" class="buttons" style="height: 50px; padding: 10px;"></div>'}c+="</div></div>";return c}});return{View:b}});
\ No newline at end of file
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
commit/galaxy-central: guerler: Ui: Add portlet to ui library and use it in charts app
by commits-noreply@bitbucket.org 20 Feb '14
by commits-noreply@bitbucket.org 20 Feb '14
20 Feb '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/86f8a8311fec/
Changeset: 86f8a8311fec
User: guerler
Date: 2014-02-21 02:09:44
Summary: Ui: Add portlet to ui library and use it in charts app
Affected #: 29 files
diff -r 0f65411e40224e7a9b32f3273896113654a742ce -r 86f8a8311fec37d0cfcae2e919e37e96a31ca297 config/plugins/visualizations/charts/static/app.js
--- a/config/plugins/visualizations/charts/static/app.js
+++ b/config/plugins/visualizations/charts/static/app.js
@@ -1,7 +1,7 @@
// dependencies
-define(['library/portlet', 'library/ui', 'library/utils',
- 'views/charts', 'views/viewport', 'views/chart', 'views/group',
- 'models/config', 'models/datasets', 'models/chart', 'models/charts', 'models/group', 'models/types'],
+define(['mvc/ui/ui-portlet', 'plugin/library/ui', 'utils/utils',
+ 'plugin/views/charts', 'plugin/views/viewport', 'plugin/views/chart', 'plugin/views/group',
+ 'plugin/models/config', 'plugin/models/datasets', 'plugin/models/chart', 'plugin/models/charts', 'plugin/models/group', 'plugin/models/types'],
function( Portlet, Ui, Utils,
ChartsView, ViewportView, ChartView, GroupView,
Config, Datasets, Chart, Charts, Group, Types
@@ -42,7 +42,7 @@
// create portlet
if (!this.options.config.widget) {
- this.portlet = new Portlet({icon : 'fa-bar-chart-o', label : 'Charts'});
+ this.portlet = new Portlet.View({icon : 'fa-bar-chart-o', label : 'Charts'});
} else {
this.portlet = $('<div></div>');
}
diff -r 0f65411e40224e7a9b32f3273896113654a742ce -r 86f8a8311fec37d0cfcae2e919e37e96a31ca297 config/plugins/visualizations/charts/static/charts/horizontal.js
--- a/config/plugins/visualizations/charts/static/charts/horizontal.js
+++ b/config/plugins/visualizations/charts/static/charts/horizontal.js
@@ -1,5 +1,5 @@
// dependencies
-define(['library/utils'], function(Utils) {
+define(['utils/utils'], function(Utils) {
// widget
return Backbone.View.extend(
diff -r 0f65411e40224e7a9b32f3273896113654a742ce -r 86f8a8311fec37d0cfcae2e919e37e96a31ca297 config/plugins/visualizations/charts/static/charts/line.js
--- a/config/plugins/visualizations/charts/static/charts/line.js
+++ b/config/plugins/visualizations/charts/static/charts/line.js
@@ -1,5 +1,5 @@
// dependencies
-define(['library/utils'], function(Utils) {
+define(['utils/utils'], function(Utils) {
// widget
return Backbone.View.extend(
diff -r 0f65411e40224e7a9b32f3273896113654a742ce -r 86f8a8311fec37d0cfcae2e919e37e96a31ca297 config/plugins/visualizations/charts/static/charts/linewithfocus.js
--- a/config/plugins/visualizations/charts/static/charts/linewithfocus.js
+++ b/config/plugins/visualizations/charts/static/charts/linewithfocus.js
@@ -1,5 +1,5 @@
// dependencies
-define(['library/utils'], function(Utils) {
+define(['utils/utils'], function(Utils) {
// widget
return Backbone.View.extend(
diff -r 0f65411e40224e7a9b32f3273896113654a742ce -r 86f8a8311fec37d0cfcae2e919e37e96a31ca297 config/plugins/visualizations/charts/static/charts/piechart.js
--- a/config/plugins/visualizations/charts/static/charts/piechart.js
+++ b/config/plugins/visualizations/charts/static/charts/piechart.js
@@ -1,5 +1,5 @@
// dependencies
-define(['library/utils'], function(Utils) {
+define(['utils/utils'], function(Utils) {
// widget
return Backbone.View.extend(
diff -r 0f65411e40224e7a9b32f3273896113654a742ce -r 86f8a8311fec37d0cfcae2e919e37e96a31ca297 config/plugins/visualizations/charts/static/charts/scatterplot.js
--- a/config/plugins/visualizations/charts/static/charts/scatterplot.js
+++ b/config/plugins/visualizations/charts/static/charts/scatterplot.js
@@ -1,5 +1,5 @@
// dependencies
-define(['library/utils'], function(Utils) {
+define(['utils/utils'], function(Utils) {
// widget
return Backbone.View.extend(
diff -r 0f65411e40224e7a9b32f3273896113654a742ce -r 86f8a8311fec37d0cfcae2e919e37e96a31ca297 config/plugins/visualizations/charts/static/charts/stackedarea.js
--- a/config/plugins/visualizations/charts/static/charts/stackedarea.js
+++ b/config/plugins/visualizations/charts/static/charts/stackedarea.js
@@ -1,5 +1,5 @@
// dependencies
-define(['library/utils'], function(Utils) {
+define(['utils/utils'], function(Utils) {
// widget
return Backbone.View.extend(
diff -r 0f65411e40224e7a9b32f3273896113654a742ce -r 86f8a8311fec37d0cfcae2e919e37e96a31ca297 config/plugins/visualizations/charts/static/library/portlet.js
--- a/config/plugins/visualizations/charts/static/library/portlet.js
+++ /dev/null
@@ -1,171 +0,0 @@
-// dependencies
-define(['library/utils'], function(Utils) {
-
-// return
-return Backbone.View.extend(
-{
- // visibility
- visible: false,
-
- // defaults options
- optionsDefault: {
- label : '',
- icon : 'fa-tasks',
- buttons : null,
- body : null,
- height : null,
- operations : null,
- placement : 'bottom',
- overflow : 'auto'
- },
-
- // content
- $content : null,
-
- // initialize
- initialize : function(options) {
- // configure options
- this.options = Utils.merge(options, this.optionsDefault);
-
- // create new element
- this.setElement(this.template(this.options));
-
- // link content
- this.$content = this.$el.find('#content');
-
- // set content height
- if (this.options.height) {
- this.$el.find('#body').css('height', this.options.height);
- this.$el.find('#content').css('overflow', this.options.overflow);
- }
-
- // append buttons
- this.$buttons = $(this.el).find('#buttons');
- if (this.options.buttons) {
- // link functions
- var self = this;
- $.each(this.options.buttons, function(name, item) {
- item.$el.prop('id', name);
- self.$buttons.append(item.$el);
- });
- } else {
- this.$buttons.remove();
- }
-
- // append operations
- this.$operations = $(this.el).find('#operations');
- if (this.options.operations) {
- // link functions
- var self = this;
- $.each(this.options.operations, function(name, item) {
- item.$el.prop('id', name);
- self.$operations.append(item.$el);
- });
- }
-
- // add body
- if(this.options.body) {
- this.append(this.options.body);
- }
- },
-
- // append
- append: function($el) {
- this.$content.append(Utils.wrap($el));
- },
-
- // content
- content: function() {
- return this.$content;
- },
-
- // hide modal
- show: function(){
- // fade in
- this.$el.fadeIn('fast');
-
- // set flag
- this.visible = true;
- },
-
- // hide modal
- hide: function(){
- // fade out
- this.$el.fadeOut('fast');
-
- // set flag
- this.visible = false;
- },
-
- // enable buttons
- enableButton: function(id) {
- this.$buttons.find('#' + id).prop('disabled', false);
- },
-
- // disable buttons
- disableButton: function(id) {
- this.$buttons.find('#' + id).prop('disabled', true);
- },
-
- // enable operation
- hideOperation: function(id) {
- this.$operations.find('#' + id).hide();
- },
-
- // disable operation
- showOperation: function(id) {
- this.$operations.find('#' + id).show();
- },
-
- // set operation
- setOperation: function(id, callback) {
- var $el = this.$operations.find('#' + id);
- $el.off('click');
- $el.on('click', callback);
- },
-
- // label
- label: function(new_label) {
- var $el = this.$el.find('#label');
- if (new_label) {
- $el.html(new_label);
- }
- return $el.html();
- },
-
- // fill regular modal template
- template: function(options) {
- var tmpl = '<div class="toolForm">';
-
- if (options.label || options.icon) {
- tmpl += '<div id="title" class="toolFormTitle" style="overflow:hidden;">' +
- '<div id="operations" style="float: right;"></div>' +
- '<div style="overflow: hidden">';
-
- if (options.icon)
- tmpl += '<i style="padding-top: 3px; float: left; font-size: 1.2em" class="icon fa ' + options.icon + '"> </i>';
-
- tmpl += '<div id="label" style="padding-top: 2px; float: left;">' + options.label + '</div>';
-
- tmpl += '</div>' +
- '</div>';
- }
- tmpl += '<div id="body" class="toolFormBody">';
-
- if (options.placement == 'top') {
- tmpl += '<div id="buttons" class="buttons" style="height: 50px; padding: 10px;"></div>';
- }
-
- tmpl += '<div id="content" class="content" style="height: inherit; padding: 10px;"></div>';
-
- if (options.placement == 'bottom') {
- tmpl += '<div id="buttons" class="buttons" style="height: 50px; padding: 10px;"></div>';
- }
-
- tmpl += '</div>' +
- '</div>';
- return tmpl;
- }
-});
-
-});
diff -r 0f65411e40224e7a9b32f3273896113654a742ce -r 86f8a8311fec37d0cfcae2e919e37e96a31ca297 config/plugins/visualizations/charts/static/library/table.js
--- a/config/plugins/visualizations/charts/static/library/table.js
+++ b/config/plugins/visualizations/charts/static/library/table.js
@@ -1,5 +1,5 @@
// dependencies
-define(['library/utils'], function(Utils) {
+define(['utils/utils'], function(Utils) {
// return
return Backbone.View.extend(
diff -r 0f65411e40224e7a9b32f3273896113654a742ce -r 86f8a8311fec37d0cfcae2e919e37e96a31ca297 config/plugins/visualizations/charts/static/library/ui.js
--- a/config/plugins/visualizations/charts/static/library/ui.js
+++ b/config/plugins/visualizations/charts/static/library/ui.js
@@ -1,5 +1,5 @@
// dependencies
-define(['library/utils', 'library/ui.select'], function(Utils, Select) {
+define(['utils/utils', 'plugin/library/ui.select'], function(Utils, Select) {
// plugin
var Label = Backbone.View.extend(
diff -r 0f65411e40224e7a9b32f3273896113654a742ce -r 86f8a8311fec37d0cfcae2e919e37e96a31ca297 config/plugins/visualizations/charts/static/library/ui.select.js
--- a/config/plugins/visualizations/charts/static/library/ui.select.js
+++ b/config/plugins/visualizations/charts/static/library/ui.select.js
@@ -1,5 +1,5 @@
// dependencies
-define(['library/utils'], function(Utils) {
+define(['utils/utils'], function(Utils) {
// plugin
return Backbone.View.extend(
@@ -55,7 +55,7 @@
},
// label
- label : function () {
+ text : function () {
return this.$el.find('option:selected').text();
},
@@ -84,7 +84,7 @@
},
// remove
- remove: function(value) {
+ del: function(value) {
// remove option
$(this.el).find('option[value=' + value + ']').remove();
$(this.el).trigger('change');
diff -r 0f65411e40224e7a9b32f3273896113654a742ce -r 86f8a8311fec37d0cfcae2e919e37e96a31ca297 config/plugins/visualizations/charts/static/library/utils.js
--- a/config/plugins/visualizations/charts/static/library/utils.js
+++ /dev/null
@@ -1,130 +0,0 @@
-// dependencies
-define([], function() {
-
-// get
-function get (url, success, error) {
- request('GET', url, {}, success, error);
-};
-
-// generic function to send json to url
-function request (method, url, data, success, error) {
-
- // encode data into url
- if (method == 'GET' || method == 'DELETE') {
- url = url + "?" + $.param(data);
- }
-
- // prepare request
- var xhr = new XMLHttpRequest();
- xhr.open(method, url, true);
- xhr.setRequestHeader('Accept', 'application/json');
- xhr.setRequestHeader('Cache-Control', 'no-cache');
- xhr.setRequestHeader('X-Requested-With', 'XMLHttpRequest');
- xhr.setRequestHeader('Content-Type', 'application/json');
- xhr.onloadend = function() {
- var status = xhr.status;
- if (status == 200) {
- try {
- response = jQuery.parseJSON(xhr.responseText);
- } catch (e) {
- response = xhr.responseText;
- }
- success && success(response);
- } else {
- error && error(status);
- }
- };
-
- // make request
- if (method == 'GET' || method == 'DELETE') {
- xhr.send();
- } else {
- xhr.send(JSON.stringify(data));
- }
-};
-
-// merge
-function merge (options, optionsDefault) {
- if (options)
- return _.defaults(options, optionsDefault);
- else
- return optionsDefault;
-};
-
-// get css value
-function cssGetAttribute (classnames, name) {
- if (classnames.length == 0) {
- console.log('cssGetAttribute() : Requires a list of classnames');
- }
-
- // place dummy element
- var el = $('<div class="' + classnames[0] + '"></div>');
- var traverse_el = el;
- for (var i in classnames) {
- traverse_el.append('<div class="' + classnames[i] + '"></div>');
- traverse_el = traverse_el.find('.' + classnames[i]);
- }
-
- // required append
- el.appendTo(':eq(0)');
-
- // get value
- var value = el.css(name);
-
- // remove element
- el.remove();
-
- // return css value
- return value;
-};
-
-// load css
-function cssLoadFile (url) {
- // check if css is already available
- if (!$('link[href^="' + url + '"]').length)
- $('<link href="' + galaxy_config.root + url + '" rel="stylesheet">').appendTo('head');
-};
-
-// unique ide
-function uuid(){
- return (new Date().getTime()).toString(36);
-};
-
-// wrap
-function wrap($el) {
- var wrapper = $('<p></p>');
- wrapper.append($el);
- return wrapper;
-};
-
-// time
-function time() {
- // get date object
- var d = new Date();
-
- // format items
- var hours = (d.getHours() < 10 ? "0" : "") + d.getHours();
- var minutes = (d.getMinutes() < 10 ? "0" : "") + d.getMinutes()
-
- // format final stamp
- var datetime = d.getDate() + "/"
- + (d.getMonth() + 1) + "/"
- + d.getFullYear() + ", "
- + hours + ":"
- + minutes;
- return datetime;
-};
-
-// return
-return {
- cssLoadFile : cssLoadFile,
- cssGetAttribute : cssGetAttribute,
- get : get,
- merge : merge,
- request: request,
- uuid: uuid,
- wrap : wrap,
- time : time
-};
-
-});
diff -r 0f65411e40224e7a9b32f3273896113654a742ce -r 86f8a8311fec37d0cfcae2e919e37e96a31ca297 config/plugins/visualizations/charts/static/models/chart.js
--- a/config/plugins/visualizations/charts/static/models/chart.js
+++ b/config/plugins/visualizations/charts/static/models/chart.js
@@ -1,5 +1,5 @@
// dependencies
-define(['models/groups'], function(Groups) {
+define(['plugin/models/groups'], function(Groups) {
// model
diff -r 0f65411e40224e7a9b32f3273896113654a742ce -r 86f8a8311fec37d0cfcae2e919e37e96a31ca297 config/plugins/visualizations/charts/static/models/charts.js
--- a/config/plugins/visualizations/charts/static/models/charts.js
+++ b/config/plugins/visualizations/charts/static/models/charts.js
@@ -1,5 +1,5 @@
// dependencies
-define(['models/chart'], function(Chart) {
+define(['plugin/models/chart'], function(Chart) {
// collection
return Backbone.Collection.extend(
diff -r 0f65411e40224e7a9b32f3273896113654a742ce -r 86f8a8311fec37d0cfcae2e919e37e96a31ca297 config/plugins/visualizations/charts/static/models/datasets.js
--- a/config/plugins/visualizations/charts/static/models/datasets.js
+++ b/config/plugins/visualizations/charts/static/models/datasets.js
@@ -1,5 +1,5 @@
// dependencies
-define(['library/utils'], function(Utils) {
+define(['utils/utils'], function(Utils) {
// widget
return Backbone.Model.extend(
diff -r 0f65411e40224e7a9b32f3273896113654a742ce -r 86f8a8311fec37d0cfcae2e919e37e96a31ca297 config/plugins/visualizations/charts/static/models/groups.js
--- a/config/plugins/visualizations/charts/static/models/groups.js
+++ b/config/plugins/visualizations/charts/static/models/groups.js
@@ -1,5 +1,5 @@
// dependencies
-define(['models/group'], function(Group) {
+define(['plugin/models/group'], function(Group) {
// collection
return Backbone.Collection.extend(
diff -r 0f65411e40224e7a9b32f3273896113654a742ce -r 86f8a8311fec37d0cfcae2e919e37e96a31ca297 config/plugins/visualizations/charts/static/views/chart.js
--- a/config/plugins/visualizations/charts/static/views/chart.js
+++ b/config/plugins/visualizations/charts/static/views/chart.js
@@ -1,5 +1,5 @@
// dependencies
-define(['library/portlet', 'library/table', 'library/ui', 'library/utils', 'models/chart', 'views/groups'],
+define(['mvc/ui/ui-portlet', 'plugin/library/table', 'plugin/library/ui', 'utils/utils', 'plugin/models/chart', 'plugin/views/groups'],
function(Portlet, Table, Ui, Utils, Chart, GroupsView) {
// widget
@@ -82,7 +82,7 @@
// add table to portlet
var self = this;
- this.portlet = new Portlet({
+ this.portlet = new Portlet.View({
icon : 'fa-edit',
label : 'Create a new chart:',
operations : {
diff -r 0f65411e40224e7a9b32f3273896113654a742ce -r 86f8a8311fec37d0cfcae2e919e37e96a31ca297 config/plugins/visualizations/charts/static/views/charts.js
--- a/config/plugins/visualizations/charts/static/views/charts.js
+++ b/config/plugins/visualizations/charts/static/views/charts.js
@@ -1,5 +1,5 @@
// dependencies
-define(['library/portlet', 'library/table', 'library/ui', 'library/utils'], function(Portlet, Table, Ui, Utils) {
+define(['mvc/ui/ui-portlet', 'plugin/library/table', 'plugin/library/ui', 'utils/utils'], function(Portlet, Table, Ui, Utils) {
// widget
return Backbone.View.extend(
@@ -31,7 +31,7 @@
// add table to portlet
var self = this;
- this.portlet = new Portlet({
+ this.portlet = new Portlet.View({
icon : 'fa-list',
label : 'List of created charts:',
height : 100,
diff -r 0f65411e40224e7a9b32f3273896113654a742ce -r 86f8a8311fec37d0cfcae2e919e37e96a31ca297 config/plugins/visualizations/charts/static/views/group.js
--- a/config/plugins/visualizations/charts/static/views/group.js
+++ b/config/plugins/visualizations/charts/static/views/group.js
@@ -1,5 +1,5 @@
// dependencies
-define(['library/portlet', 'library/table', 'library/ui', 'library/utils'],
+define(['mvc/ui/ui-portlet', 'plugin/library/table', 'plugin/library/ui', 'utils/utils'],
function(Portlet, Table, Ui, Utils) {
// chart config
@@ -24,7 +24,7 @@
// add table to portlet
var self = this;
- this.portlet = new Portlet({
+ this.portlet = new Portlet.View({
icon : 'fa-edit',
label : 'Define group properties:',
operations : {
diff -r 0f65411e40224e7a9b32f3273896113654a742ce -r 86f8a8311fec37d0cfcae2e919e37e96a31ca297 config/plugins/visualizations/charts/static/views/groups.js
--- a/config/plugins/visualizations/charts/static/views/groups.js
+++ b/config/plugins/visualizations/charts/static/views/groups.js
@@ -1,5 +1,5 @@
// dependencies
-define(['library/portlet', 'library/table', 'library/ui', 'library/utils'], function(Portlet, Table, Ui, Utils) {
+define(['mvc/ui/ui-portlet', 'plugin/library/table', 'plugin/library/ui', 'utils/utils'], function(Portlet, Table, Ui, Utils) {
// chart config
return Backbone.View.extend(
@@ -28,7 +28,7 @@
// add table to portlet
var self = this;
- this.portlet = new Portlet({
+ this.portlet = new Portlet.View({
icon : '',
label : 'Select data columns:',
height : 100,
diff -r 0f65411e40224e7a9b32f3273896113654a742ce -r 86f8a8311fec37d0cfcae2e919e37e96a31ca297 config/plugins/visualizations/charts/static/views/viewport.js
--- a/config/plugins/visualizations/charts/static/views/viewport.js
+++ b/config/plugins/visualizations/charts/static/views/viewport.js
@@ -1,5 +1,5 @@
// dependencies
-define(['library/portlet', 'library/ui', 'library/utils'],
+define(['mvc/ui/ui-portlet', 'plugin/library/ui', 'utils/utils'],
function(Portlet, Ui, Utils) {
// widget
@@ -24,7 +24,7 @@
this.options = Utils.merge(options, this.optionsDefault);
// add table to portlet
- this.portlet = new Portlet({
+ this.portlet = new Portlet.View({
label : '',
icon : 'fa-signal',
height : this.options.height,
@@ -121,7 +121,7 @@
// create chart view
var self = this;
- require(['charts/' + chart_type], function(ChartView) {
+ require(['plugin/charts/' + chart_type], function(ChartView) {
// create chart
var view = new ChartView(self.app, {svg_id : svg_id, chart : chart});
diff -r 0f65411e40224e7a9b32f3273896113654a742ce -r 86f8a8311fec37d0cfcae2e919e37e96a31ca297 config/plugins/visualizations/charts/templates/charts.mako
--- a/config/plugins/visualizations/charts/templates/charts.mako
+++ b/config/plugins/visualizations/charts/templates/charts.mako
@@ -47,7 +47,10 @@
// configure require
require.config({
- baseUrl: config.root + "plugins/visualizations/charts/static/",
+ baseUrl: config.root + "static/scripts/",
+ paths: {
+ "plugin": config.root + "plugins/visualizations/charts/static/"
+ },
shim: {
"libs/underscore": { exports: "_" },
"libs/backbone/backbone": { exports: "Backbone" }
@@ -58,7 +61,7 @@
var app = null;
$(function() {
// request application script
- require(['app'], function(App) {
+ require(['plugin/app'], function(App) {
// load options
var options = {
config : ${h.to_json_string( config )},
diff -r 0f65411e40224e7a9b32f3273896113654a742ce -r 86f8a8311fec37d0cfcae2e919e37e96a31ca297 static/scripts/mvc/ui/ui-portlet.js
--- /dev/null
+++ b/static/scripts/mvc/ui/ui-portlet.js
@@ -0,0 +1,175 @@
+// dependencies
+define(['utils/utils'], function(Utils) {
+
+// return
+var View = Backbone.View.extend(
+{
+ // visibility
+ visible: false,
+
+ // defaults options
+ optionsDefault: {
+ label : '',
+ icon : 'fa-tasks',
+ buttons : null,
+ body : null,
+ height : null,
+ operations : null,
+ placement : 'bottom',
+ overflow : 'auto'
+ },
+
+ // content
+ $content : null,
+
+ // initialize
+ initialize : function(options) {
+ // configure options
+ this.options = Utils.merge(options, this.optionsDefault);
+
+ // create new element
+ this.setElement(this.template(this.options));
+
+ // link content
+ this.$content = this.$el.find('#content');
+
+ // set content height
+ if (this.options.height) {
+ this.$el.find('#body').css('height', this.options.height);
+ this.$el.find('#content').css('overflow', this.options.overflow);
+ }
+
+ // append buttons
+ this.$buttons = $(this.el).find('#buttons');
+ if (this.options.buttons) {
+ // link functions
+ var self = this;
+ $.each(this.options.buttons, function(name, item) {
+ item.$el.prop('id', name);
+ self.$buttons.append(item.$el);
+ });
+ } else {
+ this.$buttons.remove();
+ }
+
+ // append operations
+ this.$operations = $(this.el).find('#operations');
+ if (this.options.operations) {
+ // link functions
+ var self = this;
+ $.each(this.options.operations, function(name, item) {
+ item.$el.prop('id', name);
+ self.$operations.append(item.$el);
+ });
+ }
+
+ // add body
+ if(this.options.body) {
+ this.append(this.options.body);
+ }
+ },
+
+ // append
+ append: function($el) {
+ this.$content.append(Utils.wrap($el));
+ },
+
+ // content
+ content: function() {
+ return this.$content;
+ },
+
+ // hide modal
+ show: function(){
+ // fade in
+ this.$el.fadeIn('fast');
+
+ // set flag
+ this.visible = true;
+ },
+
+ // hide modal
+ hide: function(){
+ // fade out
+ this.$el.fadeOut('fast');
+
+ // set flag
+ this.visible = false;
+ },
+
+ // enable buttons
+ enableButton: function(id) {
+ this.$buttons.find('#' + id).prop('disabled', false);
+ },
+
+ // disable buttons
+ disableButton: function(id) {
+ this.$buttons.find('#' + id).prop('disabled', true);
+ },
+
+ // enable operation
+ hideOperation: function(id) {
+ this.$operations.find('#' + id).hide();
+ },
+
+ // disable operation
+ showOperation: function(id) {
+ this.$operations.find('#' + id).show();
+ },
+
+ // set operation
+ setOperation: function(id, callback) {
+ var $el = this.$operations.find('#' + id);
+ $el.off('click');
+ $el.on('click', callback);
+ },
+
+ // label
+ label: function(new_label) {
+ var $el = this.$el.find('#label');
+ if (new_label) {
+ $el.html(new_label);
+ }
+ return $el.html();
+ },
+
+ // fill regular modal template
+ template: function(options) {
+ var tmpl = '<div class="toolForm">';
+
+ if (options.label || options.icon) {
+ tmpl += '<div id="title" class="toolFormTitle" style="overflow:hidden;">' +
+ '<div id="operations" style="float: right;"></div>' +
+ '<div style="overflow: hidden">';
+
+ if (options.icon)
+ tmpl += '<i style="padding-top: 3px; float: left; font-size: 1.2em" class="icon fa ' + options.icon + '"> </i>';
+
+ tmpl += '<div id="label" style="padding-top: 2px; float: left;">' + options.label + '</div>';
+
+ tmpl += '</div>' +
+ '</div>';
+ }
+ tmpl += '<div id="body" class="toolFormBody">';
+
+ if (options.placement == 'top') {
+ tmpl += '<div id="buttons" class="buttons" style="height: 50px; padding: 10px;"></div>';
+ }
+
+ tmpl += '<div id="content" class="content" style="height: inherit; padding: 10px;"></div>';
+
+ if (options.placement == 'bottom') {
+ tmpl += '<div id="buttons" class="buttons" style="height: 50px; padding: 10px;"></div>';
+ }
+
+ tmpl += '</div>' +
+ '</div>';
+ return tmpl;
+ }
+});
+
+return {
+ View : View
+}
+
+});
diff -r 0f65411e40224e7a9b32f3273896113654a742ce -r 86f8a8311fec37d0cfcae2e919e37e96a31ca297 static/scripts/mvc/upload/upload-ftp.js
--- a/static/scripts/mvc/upload/upload-ftp.js
+++ b/static/scripts/mvc/upload/upload-ftp.js
@@ -21,7 +21,7 @@
this.setElement(this._template());
// load extension
- Utils.jsonFromUrl(galaxy_config.root + 'api/ftp_files', function(ftp_files) { self._fill(ftp_files); });
+ Utils.get(galaxy_config.root + 'api/ftp_files', function(ftp_files) { self._fill(ftp_files); });
},
// events
diff -r 0f65411e40224e7a9b32f3273896113654a742ce -r 86f8a8311fec37d0cfcae2e919e37e96a31ca297 static/scripts/mvc/upload/upload-view.js
--- a/static/scripts/mvc/upload/upload-view.js
+++ b/static/scripts/mvc/upload/upload-view.js
@@ -112,7 +112,7 @@
// load extension
var self = this;
- Utils.jsonFromUrl(galaxy_config.root + "api/datatypes?extension_only=False",
+ Utils.get(galaxy_config.root + "api/datatypes?extension_only=False",
function(datatypes) {
for (key in datatypes) {
self.list_extensions.push({
@@ -135,7 +135,7 @@
});
// load genomes
- Utils.jsonFromUrl(galaxy_config.root + "api/genomes",
+ Utils.get(galaxy_config.root + "api/genomes",
function(genomes) {
for (key in genomes) {
self.list_genomes.push({
diff -r 0f65411e40224e7a9b32f3273896113654a742ce -r 86f8a8311fec37d0cfcae2e919e37e96a31ca297 static/scripts/packed/mvc/upload/upload-ftp.js
--- a/static/scripts/packed/mvc/upload/upload-ftp.js
+++ b/static/scripts/packed/mvc/upload/upload-ftp.js
@@ -1,1 +1,1 @@
-define(["utils/utils"],function(a){return Backbone.View.extend({options:{class_add:"upload-icon-button fa fa-square-o",class_remove:"upload-icon-button fa fa-check-square-o"},initialize:function(c){this.app=c;var b=this;this.setElement(this._template());a.jsonFromUrl(galaxy_config.root+"api/ftp_files",function(d){b._fill(d)})},events:{mousedown:function(b){b.preventDefault()}},_fill:function(c){if(c.length>0){this.$el.find("#upload-ftp-content").html($(this._template_table()));var b=0;for(key in c){this.add(c[key]);b+=c[key].size}this.$el.find("#upload-ftp-number").html(c.length+" files");this.$el.find("#upload-ftp-disk").html(a.bytesToString(b,true))}else{this.$el.find("#upload-ftp-content").html($(this._template_info()))}this.$el.find("#upload-ftp-wait").hide()},add:function(e){var d=$(this._template_row(e));$(this.el).find("tbody").append(d);var c="";if(this._find(e)){c=this.options.class_remove}else{c=this.options.class_add}d.find("#upload-ftp-add").addClass(c);var b=this;d.find("#upload-ftp-add").on("click",function(){var f=b._find(e);$(this).removeClass();if(!f){b.app.uploadbox.add([{mode:"ftp",name:e.path,size:e.size,path:e.path}]);$(this).addClass(b.options.class_remove)}else{b.app.collection.remove(f);$(this).addClass(b.options.class_add)}})},_find:function(f){var c=this.app.collection.where({file_path:f.path});var b=null;for(var d in c){var e=c[d];if(e.get("status")=="init"&&e.get("file_mode")=="ftp"){b=e.get("id")}}return b},_template_row:function(b){return'<tr><td><div id="upload-ftp-add"/></td><td>'+b.path+'</td><td style="white-space: nowrap;">'+a.bytesToString(b.size)+'</td><td style="white-space: nowrap;">'+b.ctime+"</td></tr>"},_template_table:function(){return'<span style="whitespace: nowrap; float: left;">Available files: </span><span style="whitespace: nowrap; float: right;"><span class="upload-icon fa fa-file-text-o"/><span id="upload-ftp-number"/> <span class="upload-icon fa fa-hdd-o"/><span id="upload-ftp-disk"/></span><table class="grid" style="float: left;"><thead><tr><th></th><th>Name</th><th>Size</th><th>Created</th></tr></thead><tbody></tbody></table>'},_template_info:function(){return'<div class="upload-ftp-warning warningmessage">Your FTP directory does not contain any files.</div>'},_template:function(){return'<div class="upload-ftp"><div id="upload-ftp-wait" class="upload-ftp-wait fa fa-spinner fa-spin"/><div class="upload-ftp-help">This Galaxy server allows you to upload files via FTP. To upload some files, log in to the FTP server at <strong>'+this.app.options.ftp_upload_site+'</strong> using your Galaxy credentials (email address and password).</div><div id="upload-ftp-content"></div><div>'}})});
\ No newline at end of file
+define(["utils/utils"],function(a){return Backbone.View.extend({options:{class_add:"upload-icon-button fa fa-square-o",class_remove:"upload-icon-button fa fa-check-square-o"},initialize:function(c){this.app=c;var b=this;this.setElement(this._template());a.get(galaxy_config.root+"api/ftp_files",function(d){b._fill(d)})},events:{mousedown:function(b){b.preventDefault()}},_fill:function(c){if(c.length>0){this.$el.find("#upload-ftp-content").html($(this._template_table()));var b=0;for(key in c){this.add(c[key]);b+=c[key].size}this.$el.find("#upload-ftp-number").html(c.length+" files");this.$el.find("#upload-ftp-disk").html(a.bytesToString(b,true))}else{this.$el.find("#upload-ftp-content").html($(this._template_info()))}this.$el.find("#upload-ftp-wait").hide()},add:function(e){var d=$(this._template_row(e));$(this.el).find("tbody").append(d);var c="";if(this._find(e)){c=this.options.class_remove}else{c=this.options.class_add}d.find("#upload-ftp-add").addClass(c);var b=this;d.find("#upload-ftp-add").on("click",function(){var f=b._find(e);$(this).removeClass();if(!f){b.app.uploadbox.add([{mode:"ftp",name:e.path,size:e.size,path:e.path}]);$(this).addClass(b.options.class_remove)}else{b.app.collection.remove(f);$(this).addClass(b.options.class_add)}})},_find:function(f){var c=this.app.collection.where({file_path:f.path});var b=null;for(var d in c){var e=c[d];if(e.get("status")=="init"&&e.get("file_mode")=="ftp"){b=e.get("id")}}return b},_template_row:function(b){return'<tr><td><div id="upload-ftp-add"/></td><td>'+b.path+'</td><td style="white-space: nowrap;">'+a.bytesToString(b.size)+'</td><td style="white-space: nowrap;">'+b.ctime+"</td></tr>"},_template_table:function(){return'<span style="whitespace: nowrap; float: left;">Available files: </span><span style="whitespace: nowrap; float: right;"><span class="upload-icon fa fa-file-text-o"/><span id="upload-ftp-number"/> <span class="upload-icon fa fa-hdd-o"/><span id="upload-ftp-disk"/></span><table class="grid" style="float: left;"><thead><tr><th></th><th>Name</th><th>Size</th><th>Created</th></tr></thead><tbody></tbody></table>'},_template_info:function(){return'<div class="upload-ftp-warning warningmessage">Your FTP directory does not contain any files.</div>'},_template:function(){return'<div class="upload-ftp"><div id="upload-ftp-wait" class="upload-ftp-wait fa fa-spinner fa-spin"/><div class="upload-ftp-help">This Galaxy server allows you to upload files via FTP. To upload some files, log in to the FTP server at <strong>'+this.app.options.ftp_upload_site+'</strong> using your Galaxy credentials (email address and password).</div><div id="upload-ftp-content"></div><div>'}})});
\ No newline at end of file
diff -r 0f65411e40224e7a9b32f3273896113654a742ce -r 86f8a8311fec37d0cfcae2e919e37e96a31ca297 static/scripts/packed/mvc/upload/upload-view.js
--- a/static/scripts/packed/mvc/upload/upload-view.js
+++ b/static/scripts/packed/mvc/upload/upload-view.js
@@ -1,1 +1,1 @@
-define(["galaxy.modal","utils/utils","mvc/upload/upload-button","mvc/upload/upload-model","mvc/upload/upload-row","mvc/upload/upload-ftp","mvc/ui/ui-popover","mvc/ui","utils/uploadbox"],function(a,f,e,c,b,g,d){return Backbone.View.extend({options:{nginx_upload_path:""},modal:null,ui_button:null,uploadbox:null,current_history:null,upload_size:0,list_extensions:[],list_genomes:[],auto:{id:"auto",text:"Auto-detect",description:"This system will try to detect the file type automatically. If your file is not detected properly as one of the known formats, it most likely means that it has some format problems (e.g., different number of columns on different rows). You can still coerce the system to set your data to the format you think it should be. You can also upload compressed files, which will automatically be decompressed."},collection:new c.Collection(),ftp:null,counter:{announce:0,success:0,error:0,running:0,reset:function(){this.announce=this.success=this.error=this.running=0}},initialize:function(i){var h=this;if(i){this.options=_.defaults(i,this.options)}if(!Galaxy.currHistoryPanel||!Galaxy.currHistoryPanel.model){window.setTimeout(function(){h.initialize()},500);return}this.ui_button=new e.Model({icon:"fa-upload",tooltip:"Download from URL or upload files from disk",label:"Load Data",onclick:function(j){if(j){h._eventShow(j)}},onunload:function(){if(h.counter.running>0){return"Several uploads are still processing."}}});$("#left .unified-panel-header-inner").append((new e.View(this.ui_button)).$el);var h=this;f.jsonFromUrl(galaxy_config.root+"api/datatypes?extension_only=False",function(j){for(key in j){h.list_extensions.push({id:j[key].extension,text:j[key].extension,description:j[key].description,description_url:j[key].description_url})}h.list_extensions.sort(function(l,k){return l.id>k.id?1:l.id<k.id?-1:0});if(!h.options.datatypes_disable_auto){h.list_extensions.unshift(h.auto)}});f.jsonFromUrl(galaxy_config.root+"api/genomes",function(j){for(key in j){h.list_genomes.push({id:j[key][1],text:j[key][0]})}h.list_genomes.sort(function(l,k){return l.id>k.id?1:l.id<k.id?-1:0})});this.collection.on("remove",function(j){h._eventRemove(j)});this.collection.on("change:genome",function(k){var j=k.get("genome");h.collection.each(function(l){if(l.get("status")=="init"&&l.get("genome")=="?"){l.set("genome",j)}})})},_eventShow:function(j){j.preventDefault();if(!this.modal){var h=this;this.modal=new a.GalaxyModal({title:"Download data directly from web or upload files from your disk",body:this._template("upload-box","upload-info"),buttons:{"Choose local file":function(){h.uploadbox.select()},"Choose FTP file":function(){h._eventFtp()},"Paste/Fetch data":function(){h._eventCreate()},Start:function(){h._eventStart()},Pause:function(){h._eventStop()},Reset:function(){h._eventReset()},Close:function(){h.modal.hide()},},height:"400",width:"900",closing_events:true});this.setElement("#upload-box");var h=this;this.uploadbox=this.$el.uploadbox({announce:function(k,l,m){h._eventAnnounce(k,l,m)},initialize:function(k,l,m){return h._eventInitialize(k,l,m)},progress:function(k,l,m){h._eventProgress(k,l,m)},success:function(k,l,m){h._eventSuccess(k,l,m)},error:function(k,l,m){h._eventError(k,l,m)},complete:function(){h._eventComplete()}});var i=this.modal.getButton("Choose FTP file");this.ftp=new d.View({title:"FTP files",container:i})}this.modal.show();this._updateUser();this._updateScreen()},_eventRemove:function(i){var h=i.get("status");if(h=="success"){this.counter.success--}else{if(h=="error"){this.counter.error--}else{this.counter.announce--}}this._updateScreen();this.uploadbox.remove(i.id)},_eventAnnounce:function(h,i,k){this.counter.announce++;this._updateScreen();var j=new b(this,{id:h,file_name:i.name,file_size:i.size,file_mode:i.mode,file_path:i.path});this.collection.add(j.model);$(this.el).find("tbody:first").append(j.$el);j.render()},_eventInitialize:function(m,j,s){var k=this.collection.get(m);k.set("status","running");var o=k.get("file_name");var n=k.get("file_path");var h=k.get("file_mode");var p=k.get("extension");var r=k.get("genome");var q=k.get("url_paste");var l=k.get("space_to_tabs");var i=k.get("to_posix_lines");if(!q&&!(j.size>0)){return null}this.uploadbox.configure({url:this.options.nginx_upload_path});if(h=="local"){this.uploadbox.configure({paramname:"files_0|file_data"})}else{this.uploadbox.configure({paramname:null})}tool_input={};if(h=="new"){tool_input["files_0|url_paste"]=q}if(h=="ftp"){tool_input["files_0|ftp_files"]=n}tool_input.dbkey=r;tool_input.file_type=p;tool_input["files_0|type"]="upload_dataset";tool_input.space_to_tabs=l;tool_input.to_posix_lines=i;data={};data.history_id=this.current_history;data.tool_id="upload1";data.inputs=JSON.stringify(tool_input);return data},_eventProgress:function(i,j,h){var k=this.collection.get(i);k.set("percentage",h);this.ui_button.set("percentage",this._upload_percentage(h,j.size))},_eventSuccess:function(i,j,l){var k=this.collection.get(i);k.set("percentage",100);k.set("status","success");var h=k.get("file_size");this.ui_button.set("percentage",this._upload_percentage(100,h));this.upload_completed+=h*100;this.counter.announce--;this.counter.success++;this._updateScreen();Galaxy.currHistoryPanel.refreshHdas()},_eventError:function(h,i,k){var j=this.collection.get(h);j.set("percentage",100);j.set("status","error");j.set("info",k);this.ui_button.set("percentage",this._upload_percentage(100,i.size));this.ui_button.set("status","danger");this.upload_completed+=i.size*100;this.counter.announce--;this.counter.error++;this._updateScreen()},_eventComplete:function(){this.collection.each(function(h){if(h.get("status")=="queued"){h.set("status","init")}});this.counter.running=0;this._updateScreen()},_eventFtp:function(){if(!this.ftp.visible){this.ftp.empty();this.ftp.append((new g(this)).$el);this.ftp.show()}else{this.ftp.hide()}},_eventCreate:function(){this.uploadbox.add([{name:"New File",size:0,mode:"new"}])},_eventStart:function(){if(this.counter.announce==0||this.counter.running>0){return}var h=this;this.upload_size=0;this.upload_completed=0;this.collection.each(function(i){if(i.get("status")=="init"){i.set("status","queued");h.upload_size+=i.get("file_size")}});this.ui_button.set("percentage",0);this.ui_button.set("status","success");this.counter.running=this.counter.announce;this._updateScreen();this.uploadbox.start()},_eventStop:function(){if(this.counter.running==0){return}this.ui_button.set("status","info");this.uploadbox.stop();$("#upload-info").html("Queue will pause after completing the current file...")},_eventReset:function(){if(this.counter.running==0){this.collection.reset();this.counter.reset();this._updateScreen();this.uploadbox.reset();this.ui_button.set("percentage",0)}},_updateUser:function(){this.current_user=Galaxy.currUser.get("id");this.current_history=null;if(this.current_user){this.current_history=Galaxy.currHistoryPanel.model.get("id")}},_updateScreen:function(){if(this.counter.announce==0){if(this.uploadbox.compatible()){message="You can Drag & Drop files into this box."}else{message="Unfortunately, your browser does not support multiple file uploads or drag&drop.<br>Some supported browsers are: Firefox 4+, Chrome 7+, IE 10+, Opera 12+ or Safari 6+."}}else{if(this.counter.running==0){message="You added "+this.counter.announce+" file(s) to the queue. Add more files or click 'Start' to proceed."}else{message="Please wait..."+this.counter.announce+" out of "+this.counter.running+" remaining."}}$("#upload-info").html(message);if(this.counter.running==0&&this.counter.announce+this.counter.success+this.counter.error>0){this.modal.enableButton("Reset")}else{this.modal.disableButton("Reset")}if(this.counter.running==0&&this.counter.announce>0){this.modal.enableButton("Start")}else{this.modal.disableButton("Start")}if(this.counter.running>0){this.modal.enableButton("Pause")}else{this.modal.disableButton("Pause")}if(this.counter.running==0){this.modal.enableButton("Choose local file");this.modal.enableButton("Choose FTP file");this.modal.enableButton("Paste/Fetch data")}else{this.modal.disableButton("Choose local file");this.modal.disableButton("Choose FTP file");this.modal.disableButton("Paste/Fetch data")}if(this.current_user&&this.options.ftp_upload_dir&&this.options.ftp_upload_site){this.modal.showButton("Choose FTP file")}else{this.modal.hideButton("Choose FTP file")}if(this.counter.announce+this.counter.success+this.counter.error>0){$(this.el).find("#upload-table").show()}else{$(this.el).find("#upload-table").hide()}},_upload_percentage:function(h,i){return(this.upload_completed+(h*i))/this.upload_size},_template:function(i,h){return'<div id="'+i+'" class="upload-box"><table id="upload-table" class="table table-striped" style="display: none;"><thead><tr><th>Name</th><th>Size</th><th>Type</th><th>Genome</th><th>Settings</th><th>Status</th><th></th></tr></thead><tbody></tbody></table></div><h6 id="'+h+'" class="upload-info"></h6>'}})});
\ No newline at end of file
+define(["galaxy.modal","utils/utils","mvc/upload/upload-button","mvc/upload/upload-model","mvc/upload/upload-row","mvc/upload/upload-ftp","mvc/ui/ui-popover","mvc/ui","utils/uploadbox"],function(a,f,e,c,b,g,d){return Backbone.View.extend({options:{nginx_upload_path:""},modal:null,ui_button:null,uploadbox:null,current_history:null,upload_size:0,list_extensions:[],list_genomes:[],auto:{id:"auto",text:"Auto-detect",description:"This system will try to detect the file type automatically. If your file is not detected properly as one of the known formats, it most likely means that it has some format problems (e.g., different number of columns on different rows). You can still coerce the system to set your data to the format you think it should be. You can also upload compressed files, which will automatically be decompressed."},collection:new c.Collection(),ftp:null,counter:{announce:0,success:0,error:0,running:0,reset:function(){this.announce=this.success=this.error=this.running=0}},initialize:function(i){var h=this;if(i){this.options=_.defaults(i,this.options)}if(!Galaxy.currHistoryPanel||!Galaxy.currHistoryPanel.model){window.setTimeout(function(){h.initialize()},500);return}this.ui_button=new e.Model({icon:"fa-upload",tooltip:"Download from URL or upload files from disk",label:"Load Data",onclick:function(j){if(j){h._eventShow(j)}},onunload:function(){if(h.counter.running>0){return"Several uploads are still processing."}}});$("#left .unified-panel-header-inner").append((new e.View(this.ui_button)).$el);var h=this;f.get(galaxy_config.root+"api/datatypes?extension_only=False",function(j){for(key in j){h.list_extensions.push({id:j[key].extension,text:j[key].extension,description:j[key].description,description_url:j[key].description_url})}h.list_extensions.sort(function(l,k){return l.id>k.id?1:l.id<k.id?-1:0});if(!h.options.datatypes_disable_auto){h.list_extensions.unshift(h.auto)}});f.get(galaxy_config.root+"api/genomes",function(j){for(key in j){h.list_genomes.push({id:j[key][1],text:j[key][0]})}h.list_genomes.sort(function(l,k){return l.id>k.id?1:l.id<k.id?-1:0})});this.collection.on("remove",function(j){h._eventRemove(j)});this.collection.on("change:genome",function(k){var j=k.get("genome");h.collection.each(function(l){if(l.get("status")=="init"&&l.get("genome")=="?"){l.set("genome",j)}})})},_eventShow:function(j){j.preventDefault();if(!this.modal){var h=this;this.modal=new a.GalaxyModal({title:"Download data directly from web or upload files from your disk",body:this._template("upload-box","upload-info"),buttons:{"Choose local file":function(){h.uploadbox.select()},"Choose FTP file":function(){h._eventFtp()},"Paste/Fetch data":function(){h._eventCreate()},Start:function(){h._eventStart()},Pause:function(){h._eventStop()},Reset:function(){h._eventReset()},Close:function(){h.modal.hide()},},height:"400",width:"900",closing_events:true});this.setElement("#upload-box");var h=this;this.uploadbox=this.$el.uploadbox({announce:function(k,l,m){h._eventAnnounce(k,l,m)},initialize:function(k,l,m){return h._eventInitialize(k,l,m)},progress:function(k,l,m){h._eventProgress(k,l,m)},success:function(k,l,m){h._eventSuccess(k,l,m)},error:function(k,l,m){h._eventError(k,l,m)},complete:function(){h._eventComplete()}});var i=this.modal.getButton("Choose FTP file");this.ftp=new d.View({title:"FTP files",container:i})}this.modal.show();this._updateUser();this._updateScreen()},_eventRemove:function(i){var h=i.get("status");if(h=="success"){this.counter.success--}else{if(h=="error"){this.counter.error--}else{this.counter.announce--}}this._updateScreen();this.uploadbox.remove(i.id)},_eventAnnounce:function(h,i,k){this.counter.announce++;this._updateScreen();var j=new b(this,{id:h,file_name:i.name,file_size:i.size,file_mode:i.mode,file_path:i.path});this.collection.add(j.model);$(this.el).find("tbody:first").append(j.$el);j.render()},_eventInitialize:function(m,j,s){var k=this.collection.get(m);k.set("status","running");var o=k.get("file_name");var n=k.get("file_path");var h=k.get("file_mode");var p=k.get("extension");var r=k.get("genome");var q=k.get("url_paste");var l=k.get("space_to_tabs");var i=k.get("to_posix_lines");if(!q&&!(j.size>0)){return null}this.uploadbox.configure({url:this.options.nginx_upload_path});if(h=="local"){this.uploadbox.configure({paramname:"files_0|file_data"})}else{this.uploadbox.configure({paramname:null})}tool_input={};if(h=="new"){tool_input["files_0|url_paste"]=q}if(h=="ftp"){tool_input["files_0|ftp_files"]=n}tool_input.dbkey=r;tool_input.file_type=p;tool_input["files_0|type"]="upload_dataset";tool_input.space_to_tabs=l;tool_input.to_posix_lines=i;data={};data.history_id=this.current_history;data.tool_id="upload1";data.inputs=JSON.stringify(tool_input);return data},_eventProgress:function(i,j,h){var k=this.collection.get(i);k.set("percentage",h);this.ui_button.set("percentage",this._upload_percentage(h,j.size))},_eventSuccess:function(i,j,l){var k=this.collection.get(i);k.set("percentage",100);k.set("status","success");var h=k.get("file_size");this.ui_button.set("percentage",this._upload_percentage(100,h));this.upload_completed+=h*100;this.counter.announce--;this.counter.success++;this._updateScreen();Galaxy.currHistoryPanel.refreshHdas()},_eventError:function(h,i,k){var j=this.collection.get(h);j.set("percentage",100);j.set("status","error");j.set("info",k);this.ui_button.set("percentage",this._upload_percentage(100,i.size));this.ui_button.set("status","danger");this.upload_completed+=i.size*100;this.counter.announce--;this.counter.error++;this._updateScreen()},_eventComplete:function(){this.collection.each(function(h){if(h.get("status")=="queued"){h.set("status","init")}});this.counter.running=0;this._updateScreen()},_eventFtp:function(){if(!this.ftp.visible){this.ftp.empty();this.ftp.append((new g(this)).$el);this.ftp.show()}else{this.ftp.hide()}},_eventCreate:function(){this.uploadbox.add([{name:"New File",size:0,mode:"new"}])},_eventStart:function(){if(this.counter.announce==0||this.counter.running>0){return}var h=this;this.upload_size=0;this.upload_completed=0;this.collection.each(function(i){if(i.get("status")=="init"){i.set("status","queued");h.upload_size+=i.get("file_size")}});this.ui_button.set("percentage",0);this.ui_button.set("status","success");this.counter.running=this.counter.announce;this._updateScreen();this.uploadbox.start()},_eventStop:function(){if(this.counter.running==0){return}this.ui_button.set("status","info");this.uploadbox.stop();$("#upload-info").html("Queue will pause after completing the current file...")},_eventReset:function(){if(this.counter.running==0){this.collection.reset();this.counter.reset();this._updateScreen();this.uploadbox.reset();this.ui_button.set("percentage",0)}},_updateUser:function(){this.current_user=Galaxy.currUser.get("id");this.current_history=null;if(this.current_user){this.current_history=Galaxy.currHistoryPanel.model.get("id")}},_updateScreen:function(){if(this.counter.announce==0){if(this.uploadbox.compatible()){message="You can Drag & Drop files into this box."}else{message="Unfortunately, your browser does not support multiple file uploads or drag&drop.<br>Some supported browsers are: Firefox 4+, Chrome 7+, IE 10+, Opera 12+ or Safari 6+."}}else{if(this.counter.running==0){message="You added "+this.counter.announce+" file(s) to the queue. Add more files or click 'Start' to proceed."}else{message="Please wait..."+this.counter.announce+" out of "+this.counter.running+" remaining."}}$("#upload-info").html(message);if(this.counter.running==0&&this.counter.announce+this.counter.success+this.counter.error>0){this.modal.enableButton("Reset")}else{this.modal.disableButton("Reset")}if(this.counter.running==0&&this.counter.announce>0){this.modal.enableButton("Start")}else{this.modal.disableButton("Start")}if(this.counter.running>0){this.modal.enableButton("Pause")}else{this.modal.disableButton("Pause")}if(this.counter.running==0){this.modal.enableButton("Choose local file");this.modal.enableButton("Choose FTP file");this.modal.enableButton("Paste/Fetch data")}else{this.modal.disableButton("Choose local file");this.modal.disableButton("Choose FTP file");this.modal.disableButton("Paste/Fetch data")}if(this.current_user&&this.options.ftp_upload_dir&&this.options.ftp_upload_site){this.modal.showButton("Choose FTP file")}else{this.modal.hideButton("Choose FTP file")}if(this.counter.announce+this.counter.success+this.counter.error>0){$(this.el).find("#upload-table").show()}else{$(this.el).find("#upload-table").hide()}},_upload_percentage:function(h,i){return(this.upload_completed+(h*i))/this.upload_size},_template:function(i,h){return'<div id="'+i+'" class="upload-box"><table id="upload-table" class="table table-striped" style="display: none;"><thead><tr><th>Name</th><th>Size</th><th>Type</th><th>Genome</th><th>Settings</th><th>Status</th><th></th></tr></thead><tbody></tbody></table></div><h6 id="'+h+'" class="upload-info"></h6>'}})});
\ No newline at end of file
diff -r 0f65411e40224e7a9b32f3273896113654a742ce -r 86f8a8311fec37d0cfcae2e919e37e96a31ca297 static/scripts/packed/utils/utils.js
--- a/static/scripts/packed/utils/utils.js
+++ b/static/scripts/packed/utils/utils.js
@@ -1,1 +1,1 @@
-define(["libs/underscore"],function(c){function f(j,i,h){var k=new XMLHttpRequest();k.open("GET",j,true);k.setRequestHeader("Accept","application/json");k.setRequestHeader("Cache-Control","no-cache");k.setRequestHeader("X-Requested-With","XMLHttpRequest");k.onloadend=function(){var l=k.status;if(l==200){try{response=jQuery.parseJSON(k.responseText)}catch(m){response=k.responseText}i&&i(response)}else{h&&h(l)}};k.send()}function b(k,h){var i=$('<div class="'+k+'"></div>');i.appendTo(":eq(0)");var j=i.css(h);i.remove();return j}function a(h){if(!$('link[href^="'+h+'"]').length){$('<link href="'+galaxy_config.root+h+'" rel="stylesheet">').appendTo("head")}}function g(h,i){if(h){return c.defaults(h,i)}else{return i}}function d(i,k){var j="";if(i>=100000000000){i=i/100000000000;j="TB"}else{if(i>=100000000){i=i/100000000;j="GB"}else{if(i>=100000){i=i/100000;j="MB"}else{if(i>=100){i=i/100;j="KB"}else{if(i>0){i=i*10;j="b"}else{return"<strong>-</strong>"}}}}}var h=(Math.round(i)/10);if(k){return h+" "+j}else{return"<strong>"+h+"</strong> "+j}}function e(){return(new Date().getTime()).toString(36)}return{cssLoadFile:a,cssGetAttribute:b,jsonFromUrl:f,merge:g,bytesToString:d,uuid:e}});
\ No newline at end of file
+define(["libs/underscore"],function(j){function d(l,m,k){g("GET",l,{},m,k)}function g(p,l,m,o,k){if(p=="GET"||p=="DELETE"){if(l.indexOf("?")==-1){l+="?"}else{l+="&"}l+=$.param(m)}var n=new XMLHttpRequest();n.open(p,l,true);n.setRequestHeader("Accept","application/json");n.setRequestHeader("Cache-Control","no-cache");n.setRequestHeader("X-Requested-With","XMLHttpRequest");n.setRequestHeader("Content-Type","application/json");n.onloadend=function(){var q=n.status;if(q==200){try{response=jQuery.parseJSON(n.responseText)}catch(r){response=n.responseText}o&&o(response)}else{k&&k(q)}};if(p=="GET"||p=="DELETE"){n.send()}else{n.send(JSON.stringify(m))}}function h(n,k){var l=$('<div class="'+n+'"></div>');l.appendTo(":eq(0)");var m=l.css(k);l.remove();return m}function f(k){if(!$('link[href^="'+k+'"]').length){$('<link href="'+galaxy_config.root+k+'" rel="stylesheet">').appendTo("head")}}function i(k,l){if(k){return j.defaults(k,l)}else{return l}}function b(l,n){var m="";if(l>=100000000000){l=l/100000000000;m="TB"}else{if(l>=100000000){l=l/100000000;m="GB"}else{if(l>=100000){l=l/100000;m="MB"}else{if(l>=100){l=l/100;m="KB"}else{if(l>0){l=l*10;m="b"}else{return"<strong>-</strong>"}}}}}var k=(Math.round(l)/10);if(n){return k+" "+m}else{return"<strong>"+k+"</strong> "+m}}function a(){return(new Date().getTime()).toString(36)}function c(k){var l=$("<p></p>");l.append(k);return l}function e(){var m=new Date();var k=(m.getHours()<10?"0":"")+m.getHours();var l=(m.getMinutes()<10?"0":"")+m.getMinutes();var n=m.getDate()+"/"+(m.getMonth()+1)+"/"+m.getFullYear()+", "+k+":"+l;return n}return{cssLoadFile:f,cssGetAttribute:h,get:d,merge:i,bytesToString:b,uuid:a,time:e,wrap:c,request:g}});
\ No newline at end of file
diff -r 0f65411e40224e7a9b32f3273896113654a742ce -r 86f8a8311fec37d0cfcae2e919e37e96a31ca297 static/scripts/utils/utils.js
--- a/static/scripts/utils/utils.js
+++ b/static/scripts/utils/utils.js
@@ -7,35 +7,50 @@
define(["libs/underscore"], function(_) {
// generic function to recieve json from url
-function jsonFromUrl (url, successHandler, errorHandler) {
+function get (url, success, error) {
+ request('GET', url, {}, success, error);
+};
+
+// generic function to send json to url
+function request (method, url, data, success, error) {
+
+ // encode data into url
+ if (method == 'GET' || method == 'DELETE') {
+ if (url.indexOf('?') == -1) {
+ url += '?';
+ } else {
+ url += '&';
+ }
+ url += $.param(data)
+ }
- // open url
+ // prepare request
var xhr = new XMLHttpRequest();
- xhr.open('GET', url, true);
-
- // configure request
+ xhr.open(method, url, true);
xhr.setRequestHeader('Accept', 'application/json');
xhr.setRequestHeader('Cache-Control', 'no-cache');
xhr.setRequestHeader('X-Requested-With', 'XMLHttpRequest');
-
- // on completion
+ xhr.setRequestHeader('Content-Type', 'application/json');
xhr.onloadend = function() {
var status = xhr.status;
if (status == 200) {
- try
- {
+ try {
response = jQuery.parseJSON(xhr.responseText);
} catch (e) {
response = xhr.responseText;
}
- successHandler && successHandler(response);
+ success && success(response);
} else {
- errorHandler && errorHandler(status);
+ error && error(status);
}
};
-
- // submit request
- xhr.send();
+
+ // make request
+ if (method == 'GET' || method == 'DELETE') {
+ xhr.send();
+ } else {
+ xhr.send(JSON.stringify(data));
+ }
};
// get css value
@@ -96,14 +111,42 @@
return (new Date().getTime()).toString(36);
};
+// wrap
+function wrap($el) {
+ var wrapper = $('<p></p>');
+ wrapper.append($el);
+ return wrapper;
+};
+
+// time
+function time() {
+ // get date object
+ var d = new Date();
+
+ // format items
+ var hours = (d.getHours() < 10 ? "0" : "") + d.getHours();
+ var minutes = (d.getMinutes() < 10 ? "0" : "") + d.getMinutes()
+
+ // format final stamp
+ var datetime = d.getDate() + "/"
+ + (d.getMonth() + 1) + "/"
+ + d.getFullYear() + ", "
+ + hours + ":"
+ + minutes;
+ return datetime;
+};
+
// return
return {
cssLoadFile : cssLoadFile,
cssGetAttribute : cssGetAttribute,
- jsonFromUrl : jsonFromUrl,
+ get : get,
merge : merge,
bytesToString: bytesToString,
- uuid: uuid
+ uuid: uuid,
+ time: time,
+ wrap: wrap,
+ request: request
};
});
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
commit/galaxy-central: carlfeberhard: (Fix to 8e4196a) Histories embedded in pages: first pass at using panel
by commits-noreply@bitbucket.org 20 Feb '14
by commits-noreply@bitbucket.org 20 Feb '14
20 Feb '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/3c64bf81e1fc/
Changeset: 3c64bf81e1fc
User: carlfeberhard
Date: 2014-02-20 23:44:04
Summary: (Fix to 8e4196a) Histories embedded in pages: first pass at using panel
Affected #: 2 files
diff -r ccbd6e8e64ee76bf64dca24368052fc6ff775623 -r 3c64bf81e1fcbcf0c89b316ee7b80548e10214a8 lib/galaxy/webapps/galaxy/controllers/history.py
--- a/lib/galaxy/webapps/galaxy/controllers/history.py
+++ b/lib/galaxy/webapps/galaxy/controllers/history.py
@@ -753,7 +753,21 @@
history.annotation = self.get_item_annotation_str( trans.sa_session, history.user, history )
for dataset in datasets:
dataset.annotation = self.get_item_annotation_str( trans.sa_session, history.user, dataset )
- return trans.stream_template_mako( "/history/item_content.mako", item = history, item_data = datasets )
+
+ user_is_owner = trans.user == history.user
+ history.annotation = self.get_item_annotation_str( trans.sa_session, history.user, history )
+
+ hda_dicts = []
+ datasets = self.get_history_datasets( trans, history )
+ for hda in datasets:
+ hda_dict = self.get_hda_dict( trans, hda )
+ hda_dict[ 'annotation' ] = self.get_item_annotation_str( trans.sa_session, history.user, hda )
+ hda_dicts.append( hda_dict )
+ history_dict = self.get_history_dict( trans, history, hda_dictionaries=hda_dicts )
+ history_dict[ 'annotation' ] = history.annotation
+
+ return trans.fill_template( "history/item_content.mako", item=history, item_data=datasets,
+ user_is_owner=user_is_owner, history_dict=history_dict, hda_dicts=hda_dicts )
@web.expose
def name_autocomplete_data( self, trans, q=None, limit=None, timestamp=None ):
diff -r ccbd6e8e64ee76bf64dca24368052fc6ff775623 -r 3c64bf81e1fcbcf0c89b316ee7b80548e10214a8 templates/display_base.mako
--- a/templates/display_base.mako
+++ b/templates/display_base.mako
@@ -11,6 +11,7 @@
<%inherit file="${inherit( context )}"/><%namespace file="/tagging_common.mako" import="render_individual_tagging_element, render_community_tagging_element" /><%namespace file="/display_common.mako" import="*" />
+<%namespace file="webapps/galaxy/history/history_panel.mako" import="history_panel_javascripts" />
##
## Functions used by base.mako and base_panels.mako to display content.
@@ -34,7 +35,7 @@
${parent.javascripts()}
${h.js( "libs/jquery/jstorage", "libs/jquery/jquery.autocomplete", "libs/jquery/jquery.rating",
"galaxy.autocom_tagging" )}
-
+ ${history_panel_javascripts()}
${h.js( "galaxy.panels", "libs/jquery/jstorage", "libs/jquery/jquery.event.drag", "libs/jquery/jquery.event.hover","libs/jquery/jquery.mousewheel", "libs/jquery/jquery-ui", "libs/require", "libs/farbtastic" )}
<script type="text/javascript">
@@ -151,6 +152,18 @@
border-right-style: solid;
border-right-color: #66AA66;
}
+
+ .embedded-item.history .item-content {
+ padding: 8px;
+ background-color: white;
+ border-radius: 0px 0px 4px 4px;
+ }
+ .embedded-item.history hr {
+ margin-bottom: 2px;
+ }
+ .embedded-item.history .history-panel {
+ padding: 2px 0px 8px 0px;
+ }
</style></%def>
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
2 new commits in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/9fff68afbacf/
Changeset: 9fff68afbacf
User: jmchilton
Date: 2014-02-20 22:18:37
Summary: Fix failing api search test.
Affected #: 1 file
diff -r 647946821504986a4941738cab0ec52be2c295cf -r 9fff68afbacf9836d65dbf945a43fddc063ecf55 test/functional/api/test_search.py
--- a/test/functional/api/test_search.py
+++ b/test/functional/api/test_search.py
@@ -16,7 +16,7 @@
delete_url = self._api_url( "workflows/%s" % workflow_id, use_key=True )
delete_request( delete_url )
- search_response = self.__search( "select * from workflow where not deleted" )
+ search_response = self.__search( "select * from workflow where deleted = False" )
assert not self.__has_result_with_name( search_response, "test_for_search (imported from API)" ), search_response.json()
def __search( self, query ):
https://bitbucket.org/galaxy/galaxy-central/commits/ccbd6e8e64ee/
Changeset: ccbd6e8e64ee
User: jmchilton
Date: 2014-02-20 22:28:06
Summary: Fix mock-requests PUT action.
Should fix failing history import/export test on buildbot server that doesn't have requests dependency available.
Affected #: 1 file
diff -r 9fff68afbacf9836d65dbf945a43fddc063ecf55 -r ccbd6e8e64ee76bf64dca24368052fc6ff775623 test/base/interactor.py
--- a/test/base/interactor.py
+++ b/test/base/interactor.py
@@ -461,13 +461,16 @@
def post_request( url, data, files={} ):
return __multipart_request( url, data, files, verb="POST" )
- def put_request( url, data, files={} ):
- return __multipart_request( url, data, files, verb="PUT" )
+ def put_request( url ):
+ return __urllib_request( url, 'PUT' )
def delete_request( url ):
+ return __urllib_request( url, 'DELETE' )
+
+ def __urllib_request( url, verb ):
opener = urllib2.build_opener(urllib2.HTTPHandler)
request = urllib2.Request(url)
- request.get_method = lambda: 'DELETE'
+ request.get_method = lambda: verb
try:
response = opener.open(request)
return RequestsLikeResponse( response.read(), status_code=response.getcode() )
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
4 new commits in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/e3e3576a3124/
Changeset: e3e3576a3124
Branch: central-eliminate-fabric
User: inithello
Date: 2014-02-20 15:47:35
Summary: Eliminate the use of fabric when executing commands defined in an <action type="shell_command"> tag.
Affected #: 1 file
diff -r 74ba9422f7f9e01ed59d24163e1873875bb34d42 -r e3e3576a31247e390b3dfafd24d7523c78fa4afc lib/tool_shed/galaxy_install/tool_dependencies/fabric_util.py
--- a/lib/tool_shed/galaxy_install/tool_dependencies/fabric_util.py
+++ b/lib/tool_shed/galaxy_install/tool_dependencies/fabric_util.py
@@ -4,9 +4,14 @@
import logging
import os
import shutil
+import sys
import tempfile
-import shutil
import td_common_util
+import time
+import shlex
+
+from subprocess import PIPE, Popen
+from threading import Thread
from contextlib import contextmanager
from galaxy.util import unicodify
from galaxy.util.template import fill_template
@@ -16,12 +21,19 @@
eggs.require( 'paramiko' )
eggs.require( 'Fabric' )
+from fabric import state
from fabric.api import env
from fabric.api import hide
from fabric.api import lcd
from fabric.api import local
from fabric.api import settings
from fabric.api import prefix
+from fabric.operations import _AttributeString
+
+try:
+ from Queue import Queue, Empty
+except ImportError:
+ from queue import Queue, Empty
log = logging.getLogger( __name__ )
@@ -120,6 +132,22 @@
if int( version.split( "." )[ 0 ] ) < 1:
raise NotImplementedError( "Install Fabric version 1.0 or later." )
+def enqueue_output( stdout, stdout_queue, stderr, stderr_queue ):
+ stdout_logger = logging.getLogger( 'fabric_util.STDOUT' )
+ stderr_logger = logging.getLogger( 'fabric_util.STDERR' )
+ for line in iter( stdout.readline, b'' ):
+ output = line.rstrip()
+ stdout_logger.debug( output )
+ stdout_queue.put( output )
+ stdout.close()
+ stdout_queue.put(None)
+ for line in iter( stderr.readline, b'' ):
+ output = line.rstrip()
+ stderr_logger.debug( output )
+ stderr_queue.put( output )
+ stderr.close()
+ stderr_queue.put(None)
+
def file_append( text, file_path, skip_if_contained=True, make_executable=True ):
'''
Append a line to a file unless skip_if_contained is True and the line already exists in the file. This method creates the file
@@ -168,10 +196,9 @@
for shell_file_path in shell_file_paths:
env_file_builder.append_line( action="source", value=shell_file_path )
-def handle_command( app, tool_dependency, install_dir, cmd, return_output=False ):
+def handle_command( app, tool_dependency, install_dir, cmd, return_output=False, use_fabric=False ):
context = app.install_model.context
- with settings( warn_only=True ):
- output = local( cmd, capture=True )
+ output = run_local_command( cmd, capture_output=True, stream_output=True )
log_results( cmd, output, os.path.join( install_dir, INSTALLATION_LOG ) )
if output.return_code:
tool_dependency.status = app.install_model.ToolDependency.installation_status.ERROR
@@ -263,7 +290,7 @@
set_prior_environment_commands.append( 'echo "%s: $%s"' % ( inherited_env_var_name, inherited_env_var_name ) )
command = ' ; '.join( set_prior_environment_commands )
# Run the command and capture the output.
- command_return = handle_command( app, tool_dependency, install_dir, command, return_output=True )
+ command_return = handle_command( app, tool_dependency, install_dir, command, return_output=True, use_fabric=True )
# And extract anything labeled with the name of the environment variable we're populating here.
if '%s: ' % inherited_env_var_name in command_return:
environment_variable_value = command_return.split( '\n' )
@@ -370,7 +397,7 @@
filtered_actions = actions[ 1: ]
return_code = handle_command( app, tool_dependency, install_dir, action_dict[ 'command' ] )
if return_code:
- return tool_dependency
+ return tool_dependency
dir = package_name
elif action_type == 'download_file':
# <action type="download_file">http://effectors.org/download/version/TTSS_GUI-1.0.1.jar</action>
@@ -645,7 +672,7 @@
elif action_type == 'shell_command':
with settings( warn_only=True ):
cmd = install_environment.build_command( action_dict[ 'command' ] )
- return_code = handle_command( app, tool_dependency, install_dir, cmd )
+ return_code = handle_command( app, tool_dependency, install_dir, cmd, use_fabric=False )
if return_code:
return tool_dependency
elif action_type == 'template_command':
@@ -755,6 +782,30 @@
if os.path.exists( work_dir ):
local( 'rm -rf %s' % work_dir )
+def run_local_command( command, capture_output=True, stream_output=True ):
+ wrapped_command = shlex.split( "/bin/sh -c '%s'" % command )
+ stdout_queue = Queue()
+ stderr_queue = Queue()
+ process_handle = Popen( wrapped_command, stdout=PIPE, stderr=PIPE, bufsize=1, close_fds=False, cwd=state.env['lcwd'] )
+ stdio_thread = Thread( target=enqueue_output, args=( process_handle.stdout, stdout_queue, process_handle.stderr, stderr_queue ) )
+ stdio_thread.daemon = True
+ stdio_thread.start()
+ stdout, stderr = wait_for_process( process_handle, stream_output, stdout_queue, stderr_queue )
+ # Handle error condition (deal with stdout being None, too)
+ output = _AttributeString( stdout.strip() if stdout else "" )
+ errors = _AttributeString( stderr.strip() if stderr else "" )
+ output.failed = False
+ output.return_code = process_handle.returncode
+ output.stderr = errors
+ if process_handle.returncode not in env.ok_ret_codes:
+ output.failed = True
+ message = "Encountered an error (return code %s) while executing '%s'" % ( process_handle.returncode, command )
+ log.error( message )
+ output.succeeded = not output.failed
+ # If we were capturing, this will be a string; otherwise it will be None.
+ if capture_output:
+ return output
+
def set_galaxy_environment( galaxy_user, tool_dependency_dir, host='localhost', shell='/bin/bash -l -c' ):
"""General Galaxy environment configuration. This method is not currently used."""
env.user = galaxy_user
@@ -764,3 +815,21 @@
env.use_sudo = False
env.safe_cmd = local
return env
+
+def wait_for_process( process_handle, stream_output, stdout_queue, stderr_queue ):
+ standard_out = []
+ standard_err = []
+ process_handle.wait()
+ while True:
+ line = stdout_queue.get()
+ if line is None:
+ break
+ standard_out.append(line)
+ while True:
+ line = stderr_queue.get()
+ if line is None:
+ break
+ standard_err.append(line)
+ stdout = '\n'.join( standard_out )
+ stderr = '\n'.join( standard_err )
+ return stdout, stderr
https://bitbucket.org/galaxy/galaxy-central/commits/496e1d36231c/
Changeset: 496e1d36231c
Branch: central-eliminate-fabric
User: inithello
Date: 2014-02-20 21:45:42
Summary: Code cleanup, documentation.
Affected #: 1 file
diff -r e3e3576a31247e390b3dfafd24d7523c78fa4afc -r 496e1d36231c143333c972fb9f78961b27ce210e lib/tool_shed/galaxy_install/tool_dependencies/fabric_util.py
--- a/lib/tool_shed/galaxy_install/tool_dependencies/fabric_util.py
+++ b/lib/tool_shed/galaxy_install/tool_dependencies/fabric_util.py
@@ -133,6 +133,14 @@
raise NotImplementedError( "Install Fabric version 1.0 or later." )
def enqueue_output( stdout, stdout_queue, stderr, stderr_queue ):
+ '''
+ This method places streamed stdout and stderr into a threaded IPC queue target, defined as follows:
+
+ stdio_thread = Thread( target=enqueue_output, args=( process_handle.stdout, stdout_queue, process_handle.stderr, stderr_queue ) )
+
+ When input is received, it logs that input to the defined logger, and saves it to that thread's queue. The calling thread
+ can then retrieve that data using thread.stdout and thread.stderr.
+ '''
stdout_logger = logging.getLogger( 'fabric_util.STDOUT' )
stderr_logger = logging.getLogger( 'fabric_util.STDERR' )
for line in iter( stdout.readline, b'' ):
@@ -140,13 +148,13 @@
stdout_logger.debug( output )
stdout_queue.put( output )
stdout.close()
- stdout_queue.put(None)
+ stdout_queue.put( None )
for line in iter( stderr.readline, b'' ):
output = line.rstrip()
stderr_logger.debug( output )
stderr_queue.put( output )
stderr.close()
- stderr_queue.put(None)
+ stderr_queue.put( None )
def file_append( text, file_path, skip_if_contained=True, make_executable=True ):
'''
@@ -786,7 +794,7 @@
wrapped_command = shlex.split( "/bin/sh -c '%s'" % command )
stdout_queue = Queue()
stderr_queue = Queue()
- process_handle = Popen( wrapped_command, stdout=PIPE, stderr=PIPE, bufsize=1, close_fds=False, cwd=state.env['lcwd'] )
+ process_handle = Popen( wrapped_command, stdout=PIPE, stderr=PIPE, bufsize=1, close_fds=False, cwd=state.env[ 'lcwd' ] )
stdio_thread = Thread( target=enqueue_output, args=( process_handle.stdout, stdout_queue, process_handle.stderr, stderr_queue ) )
stdio_thread.daemon = True
stdio_thread.start()
https://bitbucket.org/galaxy/galaxy-central/commits/df8d1dfe007e/
Changeset: df8d1dfe007e
Branch: central-eliminate-fabric
User: inithello
Date: 2014-02-20 22:00:21
Summary: Use the provided use_fabric parameter in handle_command.
Affected #: 1 file
diff -r 496e1d36231c143333c972fb9f78961b27ce210e -r df8d1dfe007e56529a26f696a97a4159827d706b lib/tool_shed/galaxy_install/tool_dependencies/fabric_util.py
--- a/lib/tool_shed/galaxy_install/tool_dependencies/fabric_util.py
+++ b/lib/tool_shed/galaxy_install/tool_dependencies/fabric_util.py
@@ -206,7 +206,11 @@
def handle_command( app, tool_dependency, install_dir, cmd, return_output=False, use_fabric=False ):
context = app.install_model.context
- output = run_local_command( cmd, capture_output=True, stream_output=True )
+ if use_fabric:
+ with settings( warn_only=True ):
+ output = local( cmd, capture=True )
+ else:
+ output = run_local_command( cmd, capture_output=True, stream_output=True )
log_results( cmd, output, os.path.join( install_dir, INSTALLATION_LOG ) )
if output.return_code:
tool_dependency.status = app.install_model.ToolDependency.installation_status.ERROR
https://bitbucket.org/galaxy/galaxy-central/commits/647946821504/
Changeset: 647946821504
User: davebgx
Date: 2014-02-20 22:27:11
Summary: Merged in davebgx/galaxy-central/central-eliminate-fabric (pull request #330)
Eliminate use of fabric when executing tool dependency recipes' shell_command actions.
Affected #: 1 file
diff -r 2efd48ff20dc24d7c6ccd94e4abe1319aa52f25d -r 647946821504986a4941738cab0ec52be2c295cf lib/tool_shed/galaxy_install/tool_dependencies/fabric_util.py
--- a/lib/tool_shed/galaxy_install/tool_dependencies/fabric_util.py
+++ b/lib/tool_shed/galaxy_install/tool_dependencies/fabric_util.py
@@ -4,9 +4,14 @@
import logging
import os
import shutil
+import sys
import tempfile
-import shutil
import td_common_util
+import time
+import shlex
+
+from subprocess import PIPE, Popen
+from threading import Thread
from contextlib import contextmanager
from galaxy.util import unicodify
from galaxy.util.template import fill_template
@@ -16,12 +21,19 @@
eggs.require( 'paramiko' )
eggs.require( 'Fabric' )
+from fabric import state
from fabric.api import env
from fabric.api import hide
from fabric.api import lcd
from fabric.api import local
from fabric.api import settings
from fabric.api import prefix
+from fabric.operations import _AttributeString
+
+try:
+ from Queue import Queue, Empty
+except ImportError:
+ from queue import Queue, Empty
log = logging.getLogger( __name__ )
@@ -120,6 +132,30 @@
if int( version.split( "." )[ 0 ] ) < 1:
raise NotImplementedError( "Install Fabric version 1.0 or later." )
+def enqueue_output( stdout, stdout_queue, stderr, stderr_queue ):
+ '''
+ This method places streamed stdout and stderr into a threaded IPC queue target, defined as follows:
+
+ stdio_thread = Thread( target=enqueue_output, args=( process_handle.stdout, stdout_queue, process_handle.stderr, stderr_queue ) )
+
+ When input is received, it logs that input to the defined logger, and saves it to that thread's queue. The calling thread
+ can then retrieve that data using thread.stdout and thread.stderr.
+ '''
+ stdout_logger = logging.getLogger( 'fabric_util.STDOUT' )
+ stderr_logger = logging.getLogger( 'fabric_util.STDERR' )
+ for line in iter( stdout.readline, b'' ):
+ output = line.rstrip()
+ stdout_logger.debug( output )
+ stdout_queue.put( output )
+ stdout.close()
+ stdout_queue.put( None )
+ for line in iter( stderr.readline, b'' ):
+ output = line.rstrip()
+ stderr_logger.debug( output )
+ stderr_queue.put( output )
+ stderr.close()
+ stderr_queue.put( None )
+
def file_append( text, file_path, skip_if_contained=True, make_executable=True ):
'''
Append a line to a file unless skip_if_contained is True and the line already exists in the file. This method creates the file
@@ -168,10 +204,13 @@
for shell_file_path in shell_file_paths:
env_file_builder.append_line( action="source", value=shell_file_path )
-def handle_command( app, tool_dependency, install_dir, cmd, return_output=False ):
+def handle_command( app, tool_dependency, install_dir, cmd, return_output=False, use_fabric=False ):
context = app.install_model.context
- with settings( warn_only=True ):
- output = local( cmd, capture=True )
+ if use_fabric:
+ with settings( warn_only=True ):
+ output = local( cmd, capture=True )
+ else:
+ output = run_local_command( cmd, capture_output=True, stream_output=True )
log_results( cmd, output, os.path.join( install_dir, INSTALLATION_LOG ) )
if output.return_code:
tool_dependency.status = app.install_model.ToolDependency.installation_status.ERROR
@@ -263,7 +302,7 @@
set_prior_environment_commands.append( 'echo "%s: $%s"' % ( inherited_env_var_name, inherited_env_var_name ) )
command = ' ; '.join( set_prior_environment_commands )
# Run the command and capture the output.
- command_return = handle_command( app, tool_dependency, install_dir, command, return_output=True )
+ command_return = handle_command( app, tool_dependency, install_dir, command, return_output=True, use_fabric=True )
# And extract anything labeled with the name of the environment variable we're populating here.
if '%s: ' % inherited_env_var_name in command_return:
environment_variable_value = command_return.split( '\n' )
@@ -370,7 +409,7 @@
filtered_actions = actions[ 1: ]
return_code = handle_command( app, tool_dependency, install_dir, action_dict[ 'command' ] )
if return_code:
- return tool_dependency
+ return tool_dependency
dir = package_name
elif action_type == 'download_file':
# <action type="download_file">http://effectors.org/download/version/TTSS_GUI-1.0.1.jar</action>
@@ -645,7 +684,7 @@
elif action_type == 'shell_command':
with settings( warn_only=True ):
cmd = install_environment.build_command( action_dict[ 'command' ] )
- return_code = handle_command( app, tool_dependency, install_dir, cmd )
+ return_code = handle_command( app, tool_dependency, install_dir, cmd, use_fabric=False )
if return_code:
return tool_dependency
elif action_type == 'template_command':
@@ -755,6 +794,30 @@
if os.path.exists( work_dir ):
local( 'rm -rf %s' % work_dir )
+def run_local_command( command, capture_output=True, stream_output=True ):
+ wrapped_command = shlex.split( "/bin/sh -c '%s'" % command )
+ stdout_queue = Queue()
+ stderr_queue = Queue()
+ process_handle = Popen( wrapped_command, stdout=PIPE, stderr=PIPE, bufsize=1, close_fds=False, cwd=state.env[ 'lcwd' ] )
+ stdio_thread = Thread( target=enqueue_output, args=( process_handle.stdout, stdout_queue, process_handle.stderr, stderr_queue ) )
+ stdio_thread.daemon = True
+ stdio_thread.start()
+ stdout, stderr = wait_for_process( process_handle, stream_output, stdout_queue, stderr_queue )
+ # Handle error condition (deal with stdout being None, too)
+ output = _AttributeString( stdout.strip() if stdout else "" )
+ errors = _AttributeString( stderr.strip() if stderr else "" )
+ output.failed = False
+ output.return_code = process_handle.returncode
+ output.stderr = errors
+ if process_handle.returncode not in env.ok_ret_codes:
+ output.failed = True
+ message = "Encountered an error (return code %s) while executing '%s'" % ( process_handle.returncode, command )
+ log.error( message )
+ output.succeeded = not output.failed
+ # If we were capturing, this will be a string; otherwise it will be None.
+ if capture_output:
+ return output
+
def set_galaxy_environment( galaxy_user, tool_dependency_dir, host='localhost', shell='/bin/bash -l -c' ):
"""General Galaxy environment configuration. This method is not currently used."""
env.user = galaxy_user
@@ -764,3 +827,21 @@
env.use_sudo = False
env.safe_cmd = local
return env
+
+def wait_for_process( process_handle, stream_output, stdout_queue, stderr_queue ):
+ standard_out = []
+ standard_err = []
+ process_handle.wait()
+ while True:
+ line = stdout_queue.get()
+ if line is None:
+ break
+ standard_out.append(line)
+ while True:
+ line = stderr_queue.get()
+ if line is None:
+ break
+ standard_err.append(line)
+ stdout = '\n'.join( standard_out )
+ stderr = '\n'.join( standard_err )
+ return stdout, stderr
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/2efd48ff20dc/
Changeset: 2efd48ff20dc
User: martenson
Date: 2014-02-20 22:24:56
Summary: Merge
Affected #: 2 files
diff -r f33b3f81fe2ba741cded20cb0b29e0708fbc05ed -r 2efd48ff20dc24d7c6ccd94e4abe1319aa52f25d static/scripts/galaxy.menu.js
--- a/static/scripts/galaxy.menu.js
+++ b/static/scripts/galaxy.menu.js
@@ -235,7 +235,7 @@
content : this.options.citation_url,
target : "_blank"
});
- if (!this.options.terms_url)
+ if (this.options.terms_url)
{
tab_help.add({
title : "Terms and Conditions",
diff -r f33b3f81fe2ba741cded20cb0b29e0708fbc05ed -r 2efd48ff20dc24d7c6ccd94e4abe1319aa52f25d static/scripts/packed/galaxy.menu.js
--- a/static/scripts/packed/galaxy.menu.js
+++ b/static/scripts/packed/galaxy.menu.js
@@ -1,1 +1,1 @@
-define(["galaxy.masthead"],function(b){var a=Backbone.Model.extend({options:null,masthead:null,initialize:function(c){this.options=c.config;this.masthead=c.masthead;this.create()},create:function(){var e=new b.GalaxyMastheadTab({id:"analysis",title:"Analyze Data",content:"root/index",title_attribute:"Analysis home view"});this.masthead.append(e);var g={id:"workflow",title:"Workflow",content:"workflow",title_attribute:"Chain tools into workflows"};if(!this.options.user.valid){g.disabled=true}var d=new b.GalaxyMastheadTab(g);this.masthead.append(d);var i=new b.GalaxyMastheadTab({id:"shared",title:"Shared Data",content:"library/index",title_attribute:"Access published resources"});i.add({title:"Data Libraries",content:"library/index"});i.add({title:"Data Libraries Beta",content:"library/list",divider:true});i.add({title:"Published Histories",content:"history/list_published"});i.add({title:"Published Workflows",content:"workflow/list_published"});i.add({title:"Published Visualizations",content:"visualization/list_published"});i.add({title:"Published Pages",content:"page/list_published"});this.masthead.append(i);if(this.options.user.requests){var j=new b.GalaxyMastheadTab({id:"lab",title:"Lab"});j.add({title:"Sequencing Requests",content:"requests/index"});j.add({title:"Find Samples",content:"requests/find_samples_index"});j.add({title:"Help",content:this.options.lims_doc_url});this.masthead.append(j)}var c={id:"visualization",title:"Visualization",content:"visualization/list",title_attribute:"Visualize datasets"};if(!this.options.user.valid){c.disabled=true}var m=new b.GalaxyMastheadTab(c);if(this.options.user.valid){m.add({title:"New Track Browser",content:"visualization/trackster",target:"_frame"});m.add({title:"Saved Visualizations",content:"visualization/list",target:"_frame"})}this.masthead.append(m);if(this.options.enable_cloud_launch){var f=new b.GalaxyMastheadTab({id:"cloud",title:"Cloud",content:"cloudlaunch/index"});f.add({title:"New Cloud Cluster",content:"cloudlaunch/index"});this.masthead.append(f)}if(this.options.is_admin_user){var h=new b.GalaxyMastheadTab({id:"admin",title:"Admin",content:"admin/index",extra_class:"admin-only",title_attribute:"Administer this Galaxy"});this.masthead.append(h)}var l=new b.GalaxyMastheadTab({id:"help",title:"Help",title_attribute:"Support, contact, and community hubs"});if(this.options.biostar_url){l.add({title:"Galaxy Q&A Site",content:this.options.biostar_url_redirect,target:"_blank"});l.add({title:"Ask a question",content:"biostar/biostar_question_redirect",target:"_blank"})}l.add({title:"Support",content:this.options.support_url,target:"_blank"});l.add({title:"Search",content:this.options.search_url,target:"_blank"});l.add({title:"Mailing Lists",content:this.options.mailing_lists,target:"_blank"});l.add({title:"Videos",content:this.options.screencasts_url,target:"_blank"});l.add({title:"Wiki",content:this.options.wiki_url,target:"_blank"});l.add({title:"How to Cite Galaxy",content:this.options.citation_url,target:"_blank"});if(!this.options.terms_url){l.add({title:"Terms and Conditions",content:this.options.terms_url,target:"_blank"})}this.masthead.append(l);if(!this.options.user.valid){var k=new b.GalaxyMastheadTab({id:"user",title:"User",extra_class:"loggedout-only",title_attribute:"Account registration or login"});k.add({title:"Login",content:"user/login",target:"galaxy_main"});if(this.options.allow_user_creation){k.add({title:"Register",content:"user/create",target:"galaxy_main"})}this.masthead.append(k)}else{var k=new b.GalaxyMastheadTab({id:"user",title:"User",extra_class:"loggedin-only",title_attribute:"Account preferences and saved data"});k.add({title:"Logged in as "+this.options.user.email});if(this.options.use_remote_user&&this.options.remote_user_logout_href){k.add({title:"Logout",content:this.options.remote_user_logout_href,target:"_top"})}else{k.add({title:"Preferences",content:"user?cntrller=user",target:"galaxy_main"});k.add({title:"Custom Builds",content:"user/dbkeys",target:"galaxy_main"});k.add({title:"Logout",content:"user/logout",target:"_top",divider:true})}k.add({title:"Saved Histories",content:"history/list",target:"galaxy_main"});k.add({title:"Saved Datasets",content:"dataset/list",target:"galaxy_main"});k.add({title:"Saved Pages",content:"page/list",target:"_top"});k.add({title:"API Keys",content:"user/api_keys?cntrller=user",target:"galaxy_main"});if(this.options.use_remote_user){k.add({title:"Public Name",content:"user/edit_username?cntrller=user",target:"galaxy_main"})}this.masthead.append(k)}if(this.options.active_view){this.masthead.highlight(this.options.active_view)}}});return{GalaxyMenu:a}});
\ No newline at end of file
+define(["galaxy.masthead"],function(b){var a=Backbone.Model.extend({options:null,masthead:null,initialize:function(c){this.options=c.config;this.masthead=c.masthead;this.create()},create:function(){var e=new b.GalaxyMastheadTab({id:"analysis",title:"Analyze Data",content:"root/index",title_attribute:"Analysis home view"});this.masthead.append(e);var g={id:"workflow",title:"Workflow",content:"workflow",title_attribute:"Chain tools into workflows"};if(!this.options.user.valid){g.disabled=true}var d=new b.GalaxyMastheadTab(g);this.masthead.append(d);var i=new b.GalaxyMastheadTab({id:"shared",title:"Shared Data",content:"library/index",title_attribute:"Access published resources"});i.add({title:"Data Libraries",content:"library/index"});i.add({title:"Data Libraries Beta",content:"library/list",divider:true});i.add({title:"Published Histories",content:"history/list_published"});i.add({title:"Published Workflows",content:"workflow/list_published"});i.add({title:"Published Visualizations",content:"visualization/list_published"});i.add({title:"Published Pages",content:"page/list_published"});this.masthead.append(i);if(this.options.user.requests){var j=new b.GalaxyMastheadTab({id:"lab",title:"Lab"});j.add({title:"Sequencing Requests",content:"requests/index"});j.add({title:"Find Samples",content:"requests/find_samples_index"});j.add({title:"Help",content:this.options.lims_doc_url});this.masthead.append(j)}var c={id:"visualization",title:"Visualization",content:"visualization/list",title_attribute:"Visualize datasets"};if(!this.options.user.valid){c.disabled=true}var m=new b.GalaxyMastheadTab(c);if(this.options.user.valid){m.add({title:"New Track Browser",content:"visualization/trackster",target:"_frame"});m.add({title:"Saved Visualizations",content:"visualization/list",target:"_frame"})}this.masthead.append(m);if(this.options.enable_cloud_launch){var f=new b.GalaxyMastheadTab({id:"cloud",title:"Cloud",content:"cloudlaunch/index"});f.add({title:"New Cloud Cluster",content:"cloudlaunch/index"});this.masthead.append(f)}if(this.options.is_admin_user){var h=new b.GalaxyMastheadTab({id:"admin",title:"Admin",content:"admin/index",extra_class:"admin-only",title_attribute:"Administer this Galaxy"});this.masthead.append(h)}var l=new b.GalaxyMastheadTab({id:"help",title:"Help",title_attribute:"Support, contact, and community hubs"});if(this.options.biostar_url){l.add({title:"Galaxy Q&A Site",content:this.options.biostar_url_redirect,target:"_blank"});l.add({title:"Ask a question",content:"biostar/biostar_question_redirect",target:"_blank"})}l.add({title:"Support",content:this.options.support_url,target:"_blank"});l.add({title:"Search",content:this.options.search_url,target:"_blank"});l.add({title:"Mailing Lists",content:this.options.mailing_lists,target:"_blank"});l.add({title:"Videos",content:this.options.screencasts_url,target:"_blank"});l.add({title:"Wiki",content:this.options.wiki_url,target:"_blank"});l.add({title:"How to Cite Galaxy",content:this.options.citation_url,target:"_blank"});if(this.options.terms_url){l.add({title:"Terms and Conditions",content:this.options.terms_url,target:"_blank"})}this.masthead.append(l);if(!this.options.user.valid){var k=new b.GalaxyMastheadTab({id:"user",title:"User",extra_class:"loggedout-only",title_attribute:"Account registration or login"});k.add({title:"Login",content:"user/login",target:"galaxy_main"});if(this.options.allow_user_creation){k.add({title:"Register",content:"user/create",target:"galaxy_main"})}this.masthead.append(k)}else{var k=new b.GalaxyMastheadTab({id:"user",title:"User",extra_class:"loggedin-only",title_attribute:"Account preferences and saved data"});k.add({title:"Logged in as "+this.options.user.email});if(this.options.use_remote_user&&this.options.remote_user_logout_href){k.add({title:"Logout",content:this.options.remote_user_logout_href,target:"_top"})}else{k.add({title:"Preferences",content:"user?cntrller=user",target:"galaxy_main"});k.add({title:"Custom Builds",content:"user/dbkeys",target:"galaxy_main"});k.add({title:"Logout",content:"user/logout",target:"_top",divider:true})}k.add({title:"Saved Histories",content:"history/list",target:"galaxy_main"});k.add({title:"Saved Datasets",content:"dataset/list",target:"galaxy_main"});k.add({title:"Saved Pages",content:"page/list",target:"_top"});k.add({title:"API Keys",content:"user/api_keys?cntrller=user",target:"galaxy_main"});if(this.options.use_remote_user){k.add({title:"Public Name",content:"user/edit_username?cntrller=user",target:"galaxy_main"})}this.masthead.append(k)}if(this.options.active_view){this.masthead.highlight(this.options.active_view)}}});return{GalaxyMenu:a}});
\ No newline at end of file
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
commit/galaxy-central: martenson: bugfix: reverted showing of terms_url
by commits-noreply@bitbucket.org 20 Feb '14
by commits-noreply@bitbucket.org 20 Feb '14
20 Feb '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/f58179ab4888/
Changeset: f58179ab4888
Branch: stable
User: martenson
Date: 2014-02-20 22:21:45
Summary: bugfix: reverted showing of terms_url
Affected #: 2 files
diff -r 2a68e5c0cbec107210d45cd35271ba80a7436f3c -r f58179ab488879a1a54821e98b4c65c048fa2fd6 static/scripts/galaxy.menu.js
--- a/static/scripts/galaxy.menu.js
+++ b/static/scripts/galaxy.menu.js
@@ -235,7 +235,7 @@
content : this.options.citation_url,
target : "_blank"
});
- if (!this.options.terms_url)
+ if (this.options.terms_url)
{
tab_help.add({
title : "Terms and Conditions",
diff -r 2a68e5c0cbec107210d45cd35271ba80a7436f3c -r f58179ab488879a1a54821e98b4c65c048fa2fd6 static/scripts/packed/galaxy.menu.js
--- a/static/scripts/packed/galaxy.menu.js
+++ b/static/scripts/packed/galaxy.menu.js
@@ -1,1 +1,1 @@
-define(["galaxy.masthead"],function(b){var a=Backbone.Model.extend({options:null,masthead:null,initialize:function(c){this.options=c.config;this.masthead=c.masthead;this.create()},create:function(){var e=new b.GalaxyMastheadTab({id:"analysis",title:"Analyze Data",content:"root/index",title_attribute:"Analysis home view"});this.masthead.append(e);var g={id:"workflow",title:"Workflow",content:"workflow",title_attribute:"Chain tools into workflows"};if(!this.options.user.valid){g.disabled=true}var d=new b.GalaxyMastheadTab(g);this.masthead.append(d);var i=new b.GalaxyMastheadTab({id:"shared",title:"Shared Data",content:"library/index",title_attribute:"Access published resources"});i.add({title:"Data Libraries",content:"library/index"});i.add({title:"Data Libraries Beta",content:"library/list",divider:true});i.add({title:"Published Histories",content:"history/list_published"});i.add({title:"Published Workflows",content:"workflow/list_published"});i.add({title:"Published Visualizations",content:"visualization/list_published"});i.add({title:"Published Pages",content:"page/list_published"});this.masthead.append(i);if(this.options.user.requests){var j=new b.GalaxyMastheadTab({id:"lab",title:"Lab"});j.add({title:"Sequencing Requests",content:"requests/index"});j.add({title:"Find Samples",content:"requests/find_samples_index"});j.add({title:"Help",content:this.options.lims_doc_url});this.masthead.append(j)}var c={id:"visualization",title:"Visualization",content:"visualization/list",title_attribute:"Visualize datasets"};if(!this.options.user.valid){c.disabled=true}var m=new b.GalaxyMastheadTab(c);if(this.options.user.valid){m.add({title:"New Track Browser",content:"visualization/trackster",target:"_frame"});m.add({title:"Saved Visualizations",content:"visualization/list",target:"_frame"})}this.masthead.append(m);if(this.options.enable_cloud_launch){var f=new b.GalaxyMastheadTab({id:"cloud",title:"Cloud",content:"cloudlaunch/index"});f.add({title:"New Cloud Cluster",content:"cloudlaunch/index"});this.masthead.append(f)}if(this.options.is_admin_user){var h=new b.GalaxyMastheadTab({id:"admin",title:"Admin",content:"admin/index",extra_class:"admin-only",title_attribute:"Administer this Galaxy"});this.masthead.append(h)}var l=new b.GalaxyMastheadTab({id:"help",title:"Help",title_attribute:"Support, contact, and community hubs"});if(this.options.biostar_url){l.add({title:"Galaxy Q&A Site",content:this.options.biostar_url_redirect,target:"_blank"});l.add({title:"Ask a question",content:"biostar/biostar_question_redirect",target:"_blank"})}l.add({title:"Support",content:this.options.support_url,target:"_blank"});l.add({title:"Search",content:this.options.search_url,target:"_blank"});l.add({title:"Mailing Lists",content:this.options.mailing_lists,target:"_blank"});l.add({title:"Videos",content:this.options.screencasts_url,target:"_blank"});l.add({title:"Wiki",content:this.options.wiki_url,target:"_blank"});l.add({title:"How to Cite Galaxy",content:this.options.citation_url,target:"_blank"});if(!this.options.terms_url){l.add({title:"Terms and Conditions",content:this.options.terms_url,target:"_blank"})}this.masthead.append(l);if(!this.options.user.valid){var k=new b.GalaxyMastheadTab({id:"user",title:"User",extra_class:"loggedout-only",title_attribute:"Account registration or login"});k.add({title:"Login",content:"user/login",target:"galaxy_main"});if(this.options.allow_user_creation){k.add({title:"Register",content:"user/create",target:"galaxy_main"})}this.masthead.append(k)}else{var k=new b.GalaxyMastheadTab({id:"user",title:"User",extra_class:"loggedin-only",title_attribute:"Account preferences and saved data"});k.add({title:"Logged in as "+this.options.user.email});if(this.options.use_remote_user&&this.options.remote_user_logout_href){k.add({title:"Logout",content:this.options.remote_user_logout_href,target:"_top"})}else{k.add({title:"Preferences",content:"user?cntrller=user",target:"galaxy_main"});k.add({title:"Custom Builds",content:"user/dbkeys",target:"galaxy_main"});k.add({title:"Logout",content:"user/logout",target:"_top",divider:true})}k.add({title:"Saved Histories",content:"history/list",target:"galaxy_main"});k.add({title:"Saved Datasets",content:"dataset/list",target:"galaxy_main"});k.add({title:"Saved Pages",content:"page/list",target:"_top"});k.add({title:"API Keys",content:"user/api_keys?cntrller=user",target:"galaxy_main"});if(this.options.use_remote_user){k.add({title:"Public Name",content:"user/edit_username?cntrller=user",target:"galaxy_main"})}this.masthead.append(k)}if(this.options.active_view){this.masthead.highlight(this.options.active_view)}}});return{GalaxyMenu:a}});
\ No newline at end of file
+define(["galaxy.masthead"],function(b){var a=Backbone.Model.extend({options:null,masthead:null,initialize:function(c){this.options=c.config;this.masthead=c.masthead;this.create()},create:function(){var e=new b.GalaxyMastheadTab({id:"analysis",title:"Analyze Data",content:"root/index",title_attribute:"Analysis home view"});this.masthead.append(e);var g={id:"workflow",title:"Workflow",content:"workflow",title_attribute:"Chain tools into workflows"};if(!this.options.user.valid){g.disabled=true}var d=new b.GalaxyMastheadTab(g);this.masthead.append(d);var i=new b.GalaxyMastheadTab({id:"shared",title:"Shared Data",content:"library/index",title_attribute:"Access published resources"});i.add({title:"Data Libraries",content:"library/index"});i.add({title:"Data Libraries Beta",content:"library/list",divider:true});i.add({title:"Published Histories",content:"history/list_published"});i.add({title:"Published Workflows",content:"workflow/list_published"});i.add({title:"Published Visualizations",content:"visualization/list_published"});i.add({title:"Published Pages",content:"page/list_published"});this.masthead.append(i);if(this.options.user.requests){var j=new b.GalaxyMastheadTab({id:"lab",title:"Lab"});j.add({title:"Sequencing Requests",content:"requests/index"});j.add({title:"Find Samples",content:"requests/find_samples_index"});j.add({title:"Help",content:this.options.lims_doc_url});this.masthead.append(j)}var c={id:"visualization",title:"Visualization",content:"visualization/list",title_attribute:"Visualize datasets"};if(!this.options.user.valid){c.disabled=true}var m=new b.GalaxyMastheadTab(c);if(this.options.user.valid){m.add({title:"New Track Browser",content:"visualization/trackster",target:"_frame"});m.add({title:"Saved Visualizations",content:"visualization/list",target:"_frame"})}this.masthead.append(m);if(this.options.enable_cloud_launch){var f=new b.GalaxyMastheadTab({id:"cloud",title:"Cloud",content:"cloudlaunch/index"});f.add({title:"New Cloud Cluster",content:"cloudlaunch/index"});this.masthead.append(f)}if(this.options.is_admin_user){var h=new b.GalaxyMastheadTab({id:"admin",title:"Admin",content:"admin/index",extra_class:"admin-only",title_attribute:"Administer this Galaxy"});this.masthead.append(h)}var l=new b.GalaxyMastheadTab({id:"help",title:"Help",title_attribute:"Support, contact, and community hubs"});if(this.options.biostar_url){l.add({title:"Galaxy Q&A Site",content:this.options.biostar_url_redirect,target:"_blank"});l.add({title:"Ask a question",content:"biostar/biostar_question_redirect",target:"_blank"})}l.add({title:"Support",content:this.options.support_url,target:"_blank"});l.add({title:"Search",content:this.options.search_url,target:"_blank"});l.add({title:"Mailing Lists",content:this.options.mailing_lists,target:"_blank"});l.add({title:"Videos",content:this.options.screencasts_url,target:"_blank"});l.add({title:"Wiki",content:this.options.wiki_url,target:"_blank"});l.add({title:"How to Cite Galaxy",content:this.options.citation_url,target:"_blank"});if(this.options.terms_url){l.add({title:"Terms and Conditions",content:this.options.terms_url,target:"_blank"})}this.masthead.append(l);if(!this.options.user.valid){var k=new b.GalaxyMastheadTab({id:"user",title:"User",extra_class:"loggedout-only",title_attribute:"Account registration or login"});k.add({title:"Login",content:"user/login",target:"galaxy_main"});if(this.options.allow_user_creation){k.add({title:"Register",content:"user/create",target:"galaxy_main"})}this.masthead.append(k)}else{var k=new b.GalaxyMastheadTab({id:"user",title:"User",extra_class:"loggedin-only",title_attribute:"Account preferences and saved data"});k.add({title:"Logged in as "+this.options.user.email});if(this.options.use_remote_user&&this.options.remote_user_logout_href){k.add({title:"Logout",content:this.options.remote_user_logout_href,target:"_top"})}else{k.add({title:"Preferences",content:"user?cntrller=user",target:"galaxy_main"});k.add({title:"Custom Builds",content:"user/dbkeys",target:"galaxy_main"});k.add({title:"Logout",content:"user/logout",target:"_top",divider:true})}k.add({title:"Saved Histories",content:"history/list",target:"galaxy_main"});k.add({title:"Saved Datasets",content:"dataset/list",target:"galaxy_main"});k.add({title:"Saved Pages",content:"page/list",target:"_top"});k.add({title:"API Keys",content:"user/api_keys?cntrller=user",target:"galaxy_main"});if(this.options.use_remote_user){k.add({title:"Public Name",content:"user/edit_username?cntrller=user",target:"galaxy_main"})}this.masthead.append(k)}if(this.options.active_view){this.masthead.highlight(this.options.active_view)}}});return{GalaxyMenu:a}});
\ No newline at end of file
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
commit/galaxy-central: carlfeberhard: Remove debugging statement
by commits-noreply@bitbucket.org 20 Feb '14
by commits-noreply@bitbucket.org 20 Feb '14
20 Feb '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/f33b3f81fe2b/
Changeset: f33b3f81fe2b
User: carlfeberhard
Date: 2014-02-20 21:59:22
Summary: Remove debugging statement
Affected #: 2 files
diff -r 7b4be3dda0f29dca1f11da8675273350698c95be -r f33b3f81fe2ba741cded20cb0b29e0708fbc05ed static/scripts/mvc/history/current-history-panel.js
--- a/static/scripts/mvc/history/current-history-panel.js
+++ b/static/scripts/mvc/history/current-history-panel.js
@@ -205,8 +205,8 @@
return this;
},
+ /** perform additional rendering based on preferences */
renderBasedOnPrefs : function(){
- console.debug( 'renderBasedOnPrefs', this.preferences.toJSON() )
if( this.preferences.get( 'searching' ) ){
this.showSearchControls( 0 );
}
diff -r 7b4be3dda0f29dca1f11da8675273350698c95be -r f33b3f81fe2ba741cded20cb0b29e0708fbc05ed static/scripts/packed/mvc/history/current-history-panel.js
--- a/static/scripts/packed/mvc/history/current-history-panel.js
+++ b/static/scripts/packed/mvc/history/current-history-panel.js
@@ -1,1 +1,1 @@
-define(["mvc/dataset/hda-edit","mvc/history/history-panel"],function(b,e){var c=SessionStorageModel.extend({defaults:{searching:false,tagsEditorShown:false,annotationEditorShown:false},toString:function(){return"HistoryPanelPrefs("+JSON.stringify(this.toJSON())+")"}});c.storageKey=function d(){return("history-panel")};var a=e.HistoryPanel.extend({HDAViewClass:b.HDAEditView,emptyMsg:_l("This history is empty. Click 'Get Data' on the left pane to start"),noneFoundMsg:_l("No matching datasets found"),initialize:function(f){f=f||{};this.preferences=new c(_.extend({id:c.storageKey()},_.pick(f,_.keys(c.prototype.defaults))));e.HistoryPanel.prototype.initialize.call(this,f);if(this.model){console.debug(this.model);this.model.checkForUpdates()}},loadCurrentHistory:function(g){var f=this;return this.loadHistoryWithHDADetails("current",g).then(function(i,h){f.trigger("current-history",f)})},switchToHistory:function(i,h){var f=this,g=function(){return jQuery.post(galaxy_config.root+"api/histories/"+i+"/set_as_current")};return this.loadHistoryWithHDADetails(i,h,g).then(function(k,j){f.trigger("switched-history",f)})},createNewHistory:function(h){if(!Galaxy||!Galaxy.currUser||Galaxy.currUser.isAnonymous()){this.displayMessage("error",_l("You must be logged in to create histories"));return $.when()}var f=this,g=function(){return jQuery.post(galaxy_config.root+"api/histories",{current:true})};return this.loadHistory(undefined,h,g).then(function(j,i){f.trigger("new-history",f)})},setModel:function(h,f,g){g=g||{};e.HistoryPanel.prototype.setModel.call(this,h,f,g);this.model.checkForUpdates();return this},_setUpModelEventHandlers:function(){e.HistoryPanel.prototype._setUpModelEventHandlers.call(this);if(Galaxy&&Galaxy.quotaMeter){this.listenTo(this.model,"change:nice_size",function(){Galaxy.quotaMeter.update()})}this.model.hdas.on("state:ready",function(g,h,f){if((!g.get("visible"))&&(!this.storage.get("show_hidden"))){this.removeHdaView(this.hdaViews[g.id])}},this)},render:function(h,i){h=(h===undefined)?(this.fxSpeed):(h);var f=this,g;if(this.model){g=this.renderModel()}else{g=this.renderWithoutModel()}$(f).queue("fx",[function(j){if(h&&f.$el.is(":visible")){f.$el.fadeOut(h,j)}else{j()}},function(j){f.$el.empty();if(g){f.$el.append(g.children());f.renderBasedOnPrefs()}j()},function(j){if(h&&!f.$el.is(":visible")){f.$el.fadeIn(h,j)}else{j()}},function(j){if(i){i.call(this)}f.trigger("rendered",this);j()}]);return this},renderBasedOnPrefs:function(){console.debug("renderBasedOnPrefs",this.preferences.toJSON());if(this.preferences.get("searching")){this.showSearchControls(0)}},_renderTags:function(f){var g=this;e.HistoryPanel.prototype._renderTags.call(this,f);if(this.preferences.get("tagsEditorShown")){this.tagsEditor.toggle(true)}this.tagsEditor.on("hiddenUntilActivated:shown hiddenUntilActivated:hidden",function(h){g.preferences.set("tagsEditorShown",h.hidden)})},_renderAnnotation:function(f){var g=this;e.HistoryPanel.prototype._renderAnnotation.call(this,f);if(this.preferences.get("annotationEditorShown")){this.annotationEditor.toggle(true)}this.annotationEditor.on("hiddenUntilActivated:shown hiddenUntilActivated:hidden",function(h){g.preferences.set("annotationEditorShown",h.hidden)})},connectToQuotaMeter:function(f){if(!f){return this}this.listenTo(f,"quota:over",this.showQuotaMessage);this.listenTo(f,"quota:under",this.hideQuotaMessage);this.on("rendered rendered:initial",function(){if(f&&f.isOverQuota()){this.showQuotaMessage()}});return this},showQuotaMessage:function(){var f=this.$el.find(".quota-message");if(f.is(":hidden")){f.slideDown(this.fxSpeed)}},hideQuotaMessage:function(){var f=this.$el.find(".quota-message");if(!f.is(":hidden")){f.slideUp(this.fxSpeed)}},connectToOptionsMenu:function(f){if(!f){return this}this.on("new-storage",function(h,g){if(f&&h){f.findItemByHtml(_l("Include Deleted Datasets")).checked=h.get("show_deleted");f.findItemByHtml(_l("Include Hidden Datasets")).checked=h.get("show_hidden")}});return this},toString:function(){return"CurrentHistoryPanel("+((this.model)?(this.model.get("name")):(""))+")"}});return{CurrentHistoryPanel:a}});
\ No newline at end of file
+define(["mvc/dataset/hda-edit","mvc/history/history-panel"],function(b,e){var c=SessionStorageModel.extend({defaults:{searching:false,tagsEditorShown:false,annotationEditorShown:false},toString:function(){return"HistoryPanelPrefs("+JSON.stringify(this.toJSON())+")"}});c.storageKey=function d(){return("history-panel")};var a=e.HistoryPanel.extend({HDAViewClass:b.HDAEditView,emptyMsg:_l("This history is empty. Click 'Get Data' on the left pane to start"),noneFoundMsg:_l("No matching datasets found"),initialize:function(f){f=f||{};this.preferences=new c(_.extend({id:c.storageKey()},_.pick(f,_.keys(c.prototype.defaults))));e.HistoryPanel.prototype.initialize.call(this,f);if(this.model){console.debug(this.model);this.model.checkForUpdates()}},loadCurrentHistory:function(g){var f=this;return this.loadHistoryWithHDADetails("current",g).then(function(i,h){f.trigger("current-history",f)})},switchToHistory:function(i,h){var f=this,g=function(){return jQuery.post(galaxy_config.root+"api/histories/"+i+"/set_as_current")};return this.loadHistoryWithHDADetails(i,h,g).then(function(k,j){f.trigger("switched-history",f)})},createNewHistory:function(h){if(!Galaxy||!Galaxy.currUser||Galaxy.currUser.isAnonymous()){this.displayMessage("error",_l("You must be logged in to create histories"));return $.when()}var f=this,g=function(){return jQuery.post(galaxy_config.root+"api/histories",{current:true})};return this.loadHistory(undefined,h,g).then(function(j,i){f.trigger("new-history",f)})},setModel:function(h,f,g){g=g||{};e.HistoryPanel.prototype.setModel.call(this,h,f,g);this.model.checkForUpdates();return this},_setUpModelEventHandlers:function(){e.HistoryPanel.prototype._setUpModelEventHandlers.call(this);if(Galaxy&&Galaxy.quotaMeter){this.listenTo(this.model,"change:nice_size",function(){Galaxy.quotaMeter.update()})}this.model.hdas.on("state:ready",function(g,h,f){if((!g.get("visible"))&&(!this.storage.get("show_hidden"))){this.removeHdaView(this.hdaViews[g.id])}},this)},render:function(h,i){h=(h===undefined)?(this.fxSpeed):(h);var f=this,g;if(this.model){g=this.renderModel()}else{g=this.renderWithoutModel()}$(f).queue("fx",[function(j){if(h&&f.$el.is(":visible")){f.$el.fadeOut(h,j)}else{j()}},function(j){f.$el.empty();if(g){f.$el.append(g.children());f.renderBasedOnPrefs()}j()},function(j){if(h&&!f.$el.is(":visible")){f.$el.fadeIn(h,j)}else{j()}},function(j){if(i){i.call(this)}f.trigger("rendered",this);j()}]);return this},renderBasedOnPrefs:function(){if(this.preferences.get("searching")){this.showSearchControls(0)}},_renderTags:function(f){var g=this;e.HistoryPanel.prototype._renderTags.call(this,f);if(this.preferences.get("tagsEditorShown")){this.tagsEditor.toggle(true)}this.tagsEditor.on("hiddenUntilActivated:shown hiddenUntilActivated:hidden",function(h){g.preferences.set("tagsEditorShown",h.hidden)})},_renderAnnotation:function(f){var g=this;e.HistoryPanel.prototype._renderAnnotation.call(this,f);if(this.preferences.get("annotationEditorShown")){this.annotationEditor.toggle(true)}this.annotationEditor.on("hiddenUntilActivated:shown hiddenUntilActivated:hidden",function(h){g.preferences.set("annotationEditorShown",h.hidden)})},connectToQuotaMeter:function(f){if(!f){return this}this.listenTo(f,"quota:over",this.showQuotaMessage);this.listenTo(f,"quota:under",this.hideQuotaMessage);this.on("rendered rendered:initial",function(){if(f&&f.isOverQuota()){this.showQuotaMessage()}});return this},showQuotaMessage:function(){var f=this.$el.find(".quota-message");if(f.is(":hidden")){f.slideDown(this.fxSpeed)}},hideQuotaMessage:function(){var f=this.$el.find(".quota-message");if(!f.is(":hidden")){f.slideUp(this.fxSpeed)}},connectToOptionsMenu:function(f){if(!f){return this}this.on("new-storage",function(h,g){if(f&&h){f.findItemByHtml(_l("Include Deleted Datasets")).checked=h.get("show_deleted");f.findItemByHtml(_l("Include Hidden Datasets")).checked=h.get("show_hidden")}});return this},toString:function(){return"CurrentHistoryPanel("+((this.model)?(this.model.get("name")):(""))+")"}});return{CurrentHistoryPanel:a}});
\ No newline at end of file
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
2 new commits in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/2a68e5c0cbec/
Changeset: 2a68e5c0cbec
Branch: stable
User: davebgx
Date: 2014-02-19 21:21:12
Summary: Fix for situation where duplicate database records would be created if a repository was uninstalled and reinstalled after getting updates from the tool shed.
Affected #: 2 files
diff -r 1480f00e6bdcebe043b695fa1daaa0220fc0c086 -r 2a68e5c0cbec107210d45cd35271ba80a7436f3c lib/galaxy/webapps/galaxy/controllers/admin_toolshed.py
--- a/lib/galaxy/webapps/galaxy/controllers/admin_toolshed.py
+++ b/lib/galaxy/webapps/galaxy/controllers/admin_toolshed.py
@@ -1381,7 +1381,7 @@
repository_dependencies = repository_dependency_util.get_repository_dependencies_for_installed_tool_shed_repository( trans, tool_shed_repository )
repo_info_dict = repository_util.create_repo_info_dict( trans=trans,
repository_clone_url=repository_clone_url,
- changeset_revision=tool_shed_repository.changeset_revision,
+ changeset_revision=tool_shed_repository.installed_changeset_revision,
ctx_rev=tool_shed_repository.ctx_rev,
repository_owner=tool_shed_repository.owner,
repository_name=tool_shed_repository.name,
diff -r 1480f00e6bdcebe043b695fa1daaa0220fc0c086 -r 2a68e5c0cbec107210d45cd35271ba80a7436f3c lib/tool_shed/util/shed_util_common.py
--- a/lib/tool_shed/util/shed_util_common.py
+++ b/lib/tool_shed/util/shed_util_common.py
@@ -1617,6 +1617,13 @@
except:
pass
+def __repository_query( app ):
+ if app.name == "galaxy":
+ query = app.install_model.context.query( app.install_model.ToolShedRepository )
+ else:
+ query = app.model.context.query( app.model.Repository )
+ return query
+
def repository_was_previously_installed( trans, tool_shed_url, repository_name, repo_info_tuple ):
"""
Find out if a repository is already installed into Galaxy - there are several scenarios where this
@@ -1866,10 +1873,3 @@
for arg in args:
parts.append( arg.strip( '/' ) )
return '/'.join( parts )
-
-def __repository_query( app ):
- if app.name == "galaxy":
- query = app.install_model.context.query( app.install_model.ToolShedRepository )
- else:
- query = app.model.context.query( app.model.Repository )
- return query
https://bitbucket.org/galaxy/galaxy-central/commits/7b4be3dda0f2/
Changeset: 7b4be3dda0f2
User: davebgx
Date: 2014-02-20 21:52:09
Summary: Merge stable.
Affected #: 1 file
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0