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
April 2014
- 1 participants
- 261 discussions
commit/galaxy-central: jmchilton: Refactor managers into their own module.
by commits-noreply@bitbucket.org 26 Apr '14
by commits-noreply@bitbucket.org 26 Apr '14
26 Apr '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/56dd83576ce6/
Changeset: 56dd83576ce6
User: jmchilton
Date: 2014-04-27 03:27:07
Summary: Refactor managers into their own module.
Allows cleaner reuse outside of controllers. Small PEP8 fixes.
Affected #: 5 files
diff -r 9dbd0de27e53a2cac3c604c0aa6fb70ffb5ac7d1 -r 56dd83576ce67763863b61ad85104f8d14d978e0 lib/galaxy/managers/__init__.py
--- /dev/null
+++ b/lib/galaxy/managers/__init__.py
@@ -0,0 +1,4 @@
+""" 'Business logic' independent of web transactions/user context (trans)
+should be pushed into models - but logic that requires the context trans
+should be placed under this module.
+"""
diff -r 9dbd0de27e53a2cac3c604c0aa6fb70ffb5ac7d1 -r 56dd83576ce67763863b61ad85104f8d14d978e0 lib/galaxy/managers/hdas.py
--- /dev/null
+++ b/lib/galaxy/managers/hdas.py
@@ -0,0 +1,67 @@
+from galaxy import exceptions
+from ..managers import histories
+
+
+class HDAManager( object ):
+
+ def __init__( self ):
+ self.histories_mgr = histories.HistoryManager()
+
+ def get( self, trans, unencoded_id, check_ownership=True, check_accessible=True ):
+ """
+ """
+ # this is a replacement for UsesHistoryDatasetAssociationMixin because mixins are a bad soln/structure
+ hda = trans.sa_session.query( trans.app.model.HistoryDatasetAssociation ).get( unencoded_id )
+ if hda is None:
+ raise exceptions.ObjectNotFound()
+ hda = self.secure( trans, hda, check_ownership, check_accessible )
+ return hda
+
+ def secure( self, trans, hda, check_ownership=True, check_accessible=True ):
+ """
+ checks if (a) user owns item or (b) item is accessible to user.
+ """
+ # all items are accessible to an admin
+ if trans.user and trans.user_is_admin():
+ return hda
+ if check_ownership:
+ hda = self.check_ownership( trans, hda )
+ if check_accessible:
+ hda = self.check_accessible( trans, hda )
+ return hda
+
+ def can_access_dataset( self, trans, hda ):
+ current_user_roles = trans.get_current_user_roles()
+ return trans.app.security_agent.can_access_dataset( current_user_roles, hda.dataset )
+
+ #TODO: is_owner, is_accessible
+
+ def check_ownership( self, trans, hda ):
+ if not trans.user:
+ #if hda.history == trans.history:
+ # return hda
+ raise exceptions.AuthenticationRequired( "Must be logged in to manage Galaxy datasets", type='error' )
+ if trans.user_is_admin():
+ return hda
+ # check for ownership of the containing history and accessibility of the underlying dataset
+ if( self.histories_mgr.is_owner( trans, hda.history )
+ and self.can_access_dataset( trans, hda ) ):
+ return hda
+ raise exceptions.ItemOwnershipException(
+ "HistoryDatasetAssociation is not owned by the current user", type='error' )
+
+ def check_accessible( self, trans, hda ):
+ if trans.user and trans.user_is_admin():
+ return hda
+ # check for access of the containing history...
+ self.histories_mgr.check_accessible( trans, hda.history )
+ # ...then the underlying dataset
+ if self.can_access_dataset( trans, hda ):
+ return hda
+ raise exceptions.ItemAccessibilityException(
+ "HistoryDatasetAssociation is not accessible to the current user", type='error' )
+
+ def err_if_uploading( self, trans, hda ):
+ if hda.state == trans.model.Dataset.states.UPLOAD:
+ raise exceptions.Conflict( "Please wait until this dataset finishes uploading" )
+ return hda
diff -r 9dbd0de27e53a2cac3c604c0aa6fb70ffb5ac7d1 -r 56dd83576ce67763863b61ad85104f8d14d978e0 lib/galaxy/managers/histories.py
--- /dev/null
+++ b/lib/galaxy/managers/histories.py
@@ -0,0 +1,93 @@
+from galaxy import exceptions
+from galaxy.model import orm
+
+
+class HistoryManager( object ):
+ #TODO: all the following would be more useful if passed the user instead of defaulting to trans.user
+
+ def get( self, trans, unencoded_id, check_ownership=True, check_accessible=True, deleted=None ):
+ """
+ Get a History from the database by id, verifying ownership.
+ """
+ # this is a replacement for UsesHistoryMixin because mixins are a bad soln/structure
+ history = trans.sa_session.query( trans.app.model.History ).get( unencoded_id )
+ if history is None:
+ raise exceptions.ObjectNotFound()
+ if deleted is True and not history.deleted:
+ raise exceptions.ItemDeletionException( 'History "%s" is not deleted' % ( history.name ), type="error" )
+ elif deleted is False and history.deleted:
+ raise exceptions.ItemDeletionException( 'History "%s" is deleted' % ( history.name ), type="error" )
+
+ history = self.secure( trans, history, check_ownership, check_accessible )
+ return history
+
+ def by_user( self, trans, user=None, include_deleted=False, only_deleted=False ):
+ """
+ Get all the histories for a given user (defaulting to `trans.user`)
+ ordered by update time and filtered on whether they've been deleted.
+ """
+ # handle default and/or anonymous user (which still may not have a history yet)
+ user = user or trans.user
+ if not user:
+ current_history = trans.get_history()
+ return [ current_history ] if current_history else []
+
+ history_model = trans.model.History
+ query = ( trans.sa_session.query( history_model )
+ .filter( history_model.user == user )
+ .order_by( orm.desc( history_model.table.c.update_time ) ) )
+ if only_deleted:
+ query = query.filter( history_model.deleted == True )
+ elif not include_deleted:
+ query = query.filter( history_model.deleted == False )
+ return query.all()
+
+ def secure( self, trans, history, check_ownership=True, check_accessible=True ):
+ """
+ checks if (a) user owns item or (b) item is accessible to user.
+ """
+ # all items are accessible to an admin
+ if trans.user and trans.user_is_admin():
+ return history
+ if check_ownership:
+ history = self.check_ownership( trans, history )
+ if check_accessible:
+ history = self.check_accessible( trans, history )
+ return history
+
+ def is_current( self, trans, history ):
+ return trans.history == history
+
+ def is_owner( self, trans, history ):
+ # anon users are only allowed to view their current history
+ if not trans.user:
+ return self.is_current( trans, history )
+ return trans.user == history.user
+
+ def check_ownership( self, trans, history ):
+ if trans.user and trans.user_is_admin():
+ return history
+ if not trans.user and not self.is_current( trans, history ):
+ raise exceptions.AuthenticationRequired( "Must be logged in to manage Galaxy histories", type='error' )
+ if self.is_owner( trans, history ):
+ return history
+ raise exceptions.ItemOwnershipException( "History is not owned by the current user", type='error' )
+
+ def is_accessible( self, trans, history ):
+ # admin always have access
+ if trans.user and trans.user_is_admin():
+ return True
+ # owner has implicit access
+ if self.is_owner( trans, history ):
+ return True
+ # importable and shared histories are always accessible
+ if history.importable:
+ return True
+ if trans.user in history.users_shared_with_dot_users:
+ return True
+ return False
+
+ def check_accessible( self, trans, history ):
+ if self.is_accessible( trans, history ):
+ return history
+ raise exceptions.ItemAccessibilityException( "History is not accessible to the current user", type='error' )
diff -r 9dbd0de27e53a2cac3c604c0aa6fb70ffb5ac7d1 -r 56dd83576ce67763863b61ad85104f8d14d978e0 lib/galaxy/webapps/galaxy/api/histories.py
--- a/lib/galaxy/webapps/galaxy/api/histories.py
+++ b/lib/galaxy/webapps/galaxy/api/histories.py
@@ -18,7 +18,7 @@
from galaxy.web.base.controller import ExportsHistoryMixin
from galaxy.web.base.controller import ImportsHistoryMixin
-from galaxy.model import orm
+from galaxy.managers import histories
from galaxy import util
from galaxy.util import string_as_bool
@@ -35,7 +35,7 @@
def __init__( self, app ):
super( HistoriesController, self ).__init__( app )
self.mgrs = util.bunch.Bunch(
- histories = HistoryManager()
+ histories=histories.HistoryManager()
)
def _decode_id( self, trans, id ):
@@ -404,96 +404,3 @@
pass
#log.warn( 'unknown key: %s', str( key ) )
return validated_payload
-
-
-
-
-class HistoryManager( object ):
- #TODO: all the following would be more useful if passed the user instead of defaulting to trans.user
-
- def get( self, trans, unencoded_id, check_ownership=True, check_accessible=True, deleted=None ):
- """
- Get a History from the database by id, verifying ownership.
- """
- # this is a replacement for UsesHistoryMixin because mixins are a bad soln/structure
- history = trans.sa_session.query( trans.app.model.History ).get( unencoded_id )
- if history is None:
- raise exceptions.ObjectNotFound()
- if deleted == True and not history.deleted:
- raise exceptions.ItemDeletionException( 'History "%s" is not deleted' % ( history.name ), type="error" )
- elif deleted == False and history.deleted:
- raise exceptions.ItemDeletionException( 'History "%s" is deleted' % ( history.name ), type="error" )
-
- history = self.secure( trans, history, check_ownership, check_accessible )
- return history
-
- def by_user( self, trans, user=None, include_deleted=False, only_deleted=False ):
- """
- Get all the histories for a given user (defaulting to `trans.user`)
- ordered by update time and filtered on whether they've been deleted.
- """
- # handle default and/or anonymous user (which still may not have a history yet)
- user = user or trans.user
- if not user:
- current_history = trans.get_history()
- return [ current_history ] if current_history else []
-
- history_model = trans.model.History
- query = ( trans.sa_session.query( history_model )
- .filter( history_model.user == user )
- .order_by( orm.desc( history_model.table.c.update_time ) ) )
- if only_deleted:
- query = query.filter( history_model.deleted == True )
- elif not include_deleted:
- query = query.filter( history_model.deleted == False )
- return query.all()
-
- def secure( self, trans, history, check_ownership=True, check_accessible=True ):
- """
- checks if (a) user owns item or (b) item is accessible to user.
- """
- # all items are accessible to an admin
- if trans.user and trans.user_is_admin():
- return history
- if check_ownership:
- history = self.check_ownership( trans, history )
- if check_accessible:
- history = self.check_accessible( trans, history )
- return history
-
- def is_current( self, trans, history ):
- return trans.history == history
-
- def is_owner( self, trans, history ):
- # anon users are only allowed to view their current history
- if not trans.user:
- return self.is_current( trans, history )
- return trans.user == history.user
-
- def check_ownership( self, trans, history ):
- if trans.user and trans.user_is_admin():
- return history
- if not trans.user and not self.is_current( trans, history ):
- raise exceptions.AuthenticationRequired( "Must be logged in to manage Galaxy histories", type='error' )
- if self.is_owner( trans, history ):
- return history
- raise exceptions.ItemOwnershipException( "History is not owned by the current user", type='error' )
-
- def is_accessible( self, trans, history ):
- # admin always have access
- if trans.user and trans.user_is_admin():
- return True
- # owner has implicit access
- if self.is_owner( trans, history ):
- return True
- # importable and shared histories are always accessible
- if history.importable:
- return True
- if trans.user in history.users_shared_with_dot_users:
- return True
- return False
-
- def check_accessible( self, trans, history ):
- if self.is_accessible( trans, history ):
- return history
- raise exceptions.ItemAccessibilityException( "History is not accessible to the current user", type='error' )
diff -r 9dbd0de27e53a2cac3c604c0aa6fb70ffb5ac7d1 -r 56dd83576ce67763863b61ad85104f8d14d978e0 lib/galaxy/webapps/galaxy/api/history_contents.py
--- a/lib/galaxy/webapps/galaxy/api/history_contents.py
+++ b/lib/galaxy/webapps/galaxy/api/history_contents.py
@@ -7,7 +7,6 @@
from galaxy.web import _future_expose_api as expose_api
from galaxy.web import _future_expose_api_anonymous as expose_api_anonymous
-from galaxy.web import _future_expose_api_raw as expose_api_raw
from galaxy.web.base.controller import BaseAPIController
from galaxy.web.base.controller import UsesHistoryDatasetAssociationMixin
@@ -18,7 +17,8 @@
from galaxy.web.base.controller import url_for
-from galaxy.webapps.galaxy.api import histories
+from galaxy.managers import histories
+from galaxy.managers import hdas
import logging
log = logging.getLogger( __name__ )
@@ -30,8 +30,8 @@
def __init__( self, app ):
super( HistoryContentsController, self ).__init__( app )
self.mgrs = util.bunch.Bunch(
- histories = histories.HistoryManager(),
- hdas = HDAManager()
+ histories=histories.HistoryManager(),
+ hdas=hdas.HDAManager()
)
def _decode_id( self, trans, id ):
@@ -434,67 +434,3 @@
def __handle_unknown_contents_type( self, trans, contents_type ):
raise exceptions.UnknownContentsType('Unknown contents type: %s' % type)
-
-class HDAManager( object ):
-
- def __init__( self ):
- self.histories_mgr = histories.HistoryManager()
-
- def get( self, trans, unencoded_id, check_ownership=True, check_accessible=True ):
- """
- """
- # this is a replacement for UsesHistoryDatasetAssociationMixin because mixins are a bad soln/structure
- hda = trans.sa_session.query( trans.app.model.HistoryDatasetAssociation ).get( unencoded_id )
- if hda is None:
- raise exceptions.ObjectNotFound()
- hda = self.secure( trans, hda, check_ownership, check_accessible )
- return hda
-
- def secure( self, trans, hda, check_ownership=True, check_accessible=True ):
- """
- checks if (a) user owns item or (b) item is accessible to user.
- """
- # all items are accessible to an admin
- if trans.user and trans.user_is_admin():
- return hda
- if check_ownership:
- hda = self.check_ownership( trans, hda )
- if check_accessible:
- hda = self.check_accessible( trans, hda )
- return hda
-
- def can_access_dataset( self, trans, hda ):
- current_user_roles = trans.get_current_user_roles()
- return trans.app.security_agent.can_access_dataset( current_user_roles, hda.dataset )
-
- #TODO: is_owner, is_accessible
-
- def check_ownership( self, trans, hda ):
- if not trans.user:
- #if hda.history == trans.history:
- # return hda
- raise exceptions.AuthenticationRequired( "Must be logged in to manage Galaxy datasets", type='error' )
- if trans.user_is_admin():
- return hda
- # check for ownership of the containing history and accessibility of the underlying dataset
- if( self.histories_mgr.is_owner( trans, hda.history )
- and self.can_access_dataset( trans, hda ) ):
- return hda
- raise exceptions.ItemOwnershipException(
- "HistoryDatasetAssociation is not owned by the current user", type='error' )
-
- def check_accessible( self, trans, hda ):
- if trans.user and trans.user_is_admin():
- return hda
- # check for access of the containing history...
- self.histories_mgr.check_accessible( trans, hda.history )
- # ...then the underlying dataset
- if self.can_access_dataset( trans, hda ):
- return hda
- raise exceptions.ItemAccessibilityException(
- "HistoryDatasetAssociation is not accessible to the current user", type='error' )
-
- def err_if_uploading( self, trans, hda ):
- if hda.state == trans.model.Dataset.states.UPLOAD:
- raise exceptions.Conflict( "Please wait until this dataset finishes uploading" )
- return hda
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
3 new commits in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/4d4ad2a65454/
Changeset: 4d4ad2a65454
User: jmchilton
Date: 2014-04-27 00:52:08
Summary: Tools API Tests - Add another test with repeat.
Adding abstractions reused heavily in collections and multi-execution tests downstream.
Affected #: 1 file
diff -r 03efdcca196906f3aac9939517096da445ff0bf3 -r 4d4ad2a654545e461c3b41c903a53657a640c07d test/functional/api/test_tools.py
--- a/test/functional/api/test_tools.py
+++ b/test/functional/api/test_tools.py
@@ -54,28 +54,69 @@
self.assertEquals( result_content, table )
def test_run_cat1( self ):
+ # Run simple non-upload tool with an input data parameter.
history_id = self._new_history()
- new_dataset = self._new_dataset( history_id )
- dataset_id = new_dataset[ 'id' ]
+ new_dataset = self._new_dataset( history_id, content='Cat1Test' )
+ inputs = dict(
+ input1=dataset_to_param( new_dataset ),
+ )
+ outputs = self._cat1_outputs( history_id, inputs=inputs )
+ self.assertEquals( len( outputs ), 1 )
+ self._wait_for_history( history_id, assert_ok=True )
+ output1 = outputs[ 0 ]
+ output1_content = self._get_content( history_id, dataset=output1 )
+ self.assertEqual( output1_content.strip(), "Cat1Test" )
+
+ def test_run_cat1_with_two_inputs( self ):
+ # Run tool with an multiple data parameter and grouping (repeat)
+ history_id = self._new_history()
+ new_dataset1 = self._new_dataset( history_id, content='Cat1Test' )
+ new_dataset2 = self._new_dataset( history_id, content='Cat2Test' )
+ inputs = {
+ 'input1': dataset_to_param( new_dataset1 ),
+ 'queries_0|input2': dataset_to_param( new_dataset2 )
+ }
+ outputs = self._cat1_outputs( history_id, inputs=inputs )
+ self.assertEquals( len( outputs ), 1 )
+ self._wait_for_history( history_id, assert_ok=True )
+ output1 = outputs[ 0 ]
+ output1_content = self._get_content( history_id, dataset=output1 )
+ self.assertEqual( output1_content.strip(), "Cat1Test\nCat2Test" )
+
+ def _cat1_outputs( self, history_id, inputs ):
+ create_response = self._run_cat1( history_id, inputs )
+ self._assert_status_code_is( create_response, 200 )
+ create = create_response.json()
+ self._assert_has_keys( create, 'outputs' )
+ return create[ 'outputs' ]
+
+ def _run_cat1( self, history_id, inputs ):
payload = self._run_tool_payload(
tool_id='cat1',
- inputs=dict(
- input1=dict(
- src='hda',
- id=dataset_id
- ),
- ),
+ inputs=inputs,
history_id=history_id,
)
create_response = self._post( "tools", data=payload )
- self._assert_status_code_is( create_response, 200 )
- self._assert_has_keys( create_response.json(), 'outputs' )
- self._wait_for_history( history_id, assert_ok=True )
+ return create_response
def _upload_and_get_content( self, content, **upload_kwds ):
history_id = self._new_history()
new_dataset = self._new_dataset( history_id, content=content, **upload_kwds )
self._wait_for_history( history_id, assert_ok=True )
- display_response = self._get( "histories/%s/contents/%s/display" % ( history_id, new_dataset[ "id" ] ) )
+ return self._get_content( history_id, dataset=new_dataset )
+
+ def _get_content( self, history_id, **kwds ):
+ if "dataset_id" in kwds:
+ dataset_id = kwds[ "dataset_id" ]
+ else:
+ dataset_id = kwds[ "dataset" ][ "id" ]
+ display_response = self._get( "histories/%s/contents/%s/display" % ( history_id, dataset_id ) )
self._assert_status_code_is( display_response, 200 )
return display_response.content
+
+
+def dataset_to_param( dataset ):
+ return dict(
+ src='hda',
+ id=dataset[ 'id' ]
+ )
https://bitbucket.org/galaxy/galaxy-central/commits/a05d14c84adb/
Changeset: a05d14c84adb
User: jmchilton
Date: 2014-04-27 00:52:08
Summary: Tools API Tests - Refactor away from deprecated mixin toward DatasetPopulator class.
Affected #: 2 files
diff -r 4d4ad2a654545e461c3b41c903a53657a640c07d -r a05d14c84adb736daaeb80323269964a0fab97ff test/functional/api/helpers.py
--- a/test/functional/api/helpers.py
+++ b/test/functional/api/helpers.py
@@ -9,6 +9,8 @@
# row - first grabbing 8 lines at random and then 6.
workflow_random_x2_str = resource_string( __name__, "test_workflow_2.ga" )
+DEFAULT_HISTORY_TIMEOUT = 5 # Secs to wait on history to turn ok
+
# Deprecated mixin, use dataset populator instead.
# TODO: Rework existing tests to target DatasetPopulator in a setup method instead.
@@ -40,8 +42,8 @@
run_response = self.galaxy_interactor.post( "tools", data=payload )
return run_response.json()["outputs"][0]
- def wait_for_history( self, history_id, assert_ok=False ):
- wait_on_state( lambda: self.galaxy_interactor.get( "histories/%s" % history_id ), assert_ok=assert_ok )
+ def wait_for_history( self, history_id, assert_ok=False, timeout=DEFAULT_HISTORY_TIMEOUT ):
+ wait_on_state( lambda: self.galaxy_interactor.get( "histories/%s" % history_id ), assert_ok=assert_ok, timeout=timeout )
def new_history( self, **kwds ):
name = kwds.get( "name", "API Test History" )
diff -r 4d4ad2a654545e461c3b41c903a53657a640c07d -r a05d14c84adb736daaeb80323269964a0fab97ff test/functional/api/test_tools.py
--- a/test/functional/api/test_tools.py
+++ b/test/functional/api/test_tools.py
@@ -3,10 +3,14 @@
from base import api
from operator import itemgetter
-from .helpers import TestsDatasets
+from .helpers import DatasetPopulator
-class ToolsTestCase( api.ApiTestCase, TestsDatasets ):
+class ToolsTestCase( api.ApiTestCase ):
+
+ def setUp( self ):
+ super( ToolsTestCase, self ).setUp( )
+ self.dataset_populator = DatasetPopulator( self.galaxy_interactor )
def test_index( self ):
index = self._get( "tools" )
@@ -27,8 +31,8 @@
assert "cat1" in tool_ids
def test_upload1_paste( self ):
- history_id = self._new_history()
- payload = self._upload_payload( history_id, 'Hello World' )
+ history_id = self.dataset_populator.new_history()
+ payload = self.dataset_populator.upload_payload( history_id, 'Hello World' )
create_response = self._post( "tools", data=payload )
self._assert_has_keys( create_response.json(), 'outputs' )
@@ -55,30 +59,30 @@
def test_run_cat1( self ):
# Run simple non-upload tool with an input data parameter.
- history_id = self._new_history()
- new_dataset = self._new_dataset( history_id, content='Cat1Test' )
+ history_id = self.dataset_populator.new_history()
+ new_dataset = self.dataset_populator.new_dataset( history_id, content='Cat1Test' )
inputs = dict(
input1=dataset_to_param( new_dataset ),
)
outputs = self._cat1_outputs( history_id, inputs=inputs )
self.assertEquals( len( outputs ), 1 )
- self._wait_for_history( history_id, assert_ok=True )
+ self.dataset_populator.wait_for_history( history_id, assert_ok=True )
output1 = outputs[ 0 ]
output1_content = self._get_content( history_id, dataset=output1 )
self.assertEqual( output1_content.strip(), "Cat1Test" )
def test_run_cat1_with_two_inputs( self ):
# Run tool with an multiple data parameter and grouping (repeat)
- history_id = self._new_history()
- new_dataset1 = self._new_dataset( history_id, content='Cat1Test' )
- new_dataset2 = self._new_dataset( history_id, content='Cat2Test' )
+ history_id = self.dataset_populator.new_history()
+ new_dataset1 = self.dataset_populator.new_dataset( history_id, content='Cat1Test' )
+ new_dataset2 = self.dataset_populator.new_dataset( history_id, content='Cat2Test' )
inputs = {
'input1': dataset_to_param( new_dataset1 ),
'queries_0|input2': dataset_to_param( new_dataset2 )
}
outputs = self._cat1_outputs( history_id, inputs=inputs )
self.assertEquals( len( outputs ), 1 )
- self._wait_for_history( history_id, assert_ok=True )
+ self.dataset_populator.wait_for_history( history_id, assert_ok=True )
output1 = outputs[ 0 ]
output1_content = self._get_content( history_id, dataset=output1 )
self.assertEqual( output1_content.strip(), "Cat1Test\nCat2Test" )
@@ -91,7 +95,7 @@
return create[ 'outputs' ]
def _run_cat1( self, history_id, inputs ):
- payload = self._run_tool_payload(
+ payload = self.dataset_populator.run_tool_payload(
tool_id='cat1',
inputs=inputs,
history_id=history_id,
@@ -100,9 +104,9 @@
return create_response
def _upload_and_get_content( self, content, **upload_kwds ):
- history_id = self._new_history()
- new_dataset = self._new_dataset( history_id, content=content, **upload_kwds )
- self._wait_for_history( history_id, assert_ok=True )
+ history_id = self.dataset_populator.new_history()
+ new_dataset = self.dataset_populator.new_dataset( history_id, content=content, **upload_kwds )
+ self.dataset_populator.wait_for_history( history_id, assert_ok=True )
return self._get_content( history_id, dataset=new_dataset )
def _get_content( self, history_id, **kwds ):
https://bitbucket.org/galaxy/galaxy-central/commits/9dbd0de27e53/
Changeset: 9dbd0de27e53
User: jmchilton
Date: 2014-04-27 00:52:08
Summary: Workflow Editor Unit Tests - Improvements to input terminal canAccept tests.
Use real connectors, add tests for logic related to multiple input data parameters.
Affected #: 1 file
diff -r a05d14c84adb736daaeb80323269964a0fab97ff -r 9dbd0de27e53a2cac3c604c0aa6fb70ffb5ac7d1 test/qunit/tests/workflow_editor_tests.js
--- a/test/qunit/tests/workflow_editor_tests.js
+++ b/test/qunit/tests/workflow_editor_tests.js
@@ -60,20 +60,27 @@
};
module( "Input terminal model test", {
- setup: function() {
- this.node = { };
- this.element = $( "<div>" );
- var input = { extensions: [ "txt" ], multiple: false };
- this.input_terminal = new InputTerminal( { element: this.element, input: input } );
+ setup: function( ) {
+ this.node = new Node( { } );
+ this.input = { extensions: [ "txt" ], multiple: false };
+ this.input_terminal = new InputTerminal( { input: this.input } );
this.input_terminal.node = this.node;
},
- test_connector: function( attr ) {
- var connector = attr || {};
- this.input_terminal.connectors.push( connector );
+ multiple: function( ) {
+ this.input.multiple = true;
+ this.input_terminal.update( this.input );
+ },
+ test_connector: function( ) {
+ var outputTerminal = new OutputTerminal( { datatypes: [ 'input' ] } );
+ var inputTerminal = this.input_terminal;
+ var connector;
+ with_workflow_global( function() {
+ connector = new Connector( outputTerminal, inputTerminal );
+ } );
return connector;
},
- with_test_connector: function( attr, f ) {
- this.test_connector( attr );
+ with_test_connector: function( f ) {
+ this.test_connector( );
f();
this.reset_connectors();
},
@@ -116,7 +123,7 @@
test( "test disconnect", function() {
this.node.markChanged = sinon.spy();
- var connector = this.test_connector( {} );
+ var connector = this.test_connector( );
this.input_terminal.disconnect( connector );
// Assert node markChanged called
@@ -126,17 +133,19 @@
} );
test( "test redraw", function() {
- var connector = this.test_connector( { redraw: sinon.spy() } );
+ var connector = this.test_connector( );
+ connector.redraw = sinon.spy();
this.input_terminal.redraw();
// Assert connectors were redrawn
ok( connector.redraw.called );
} );
test( "test destroy", function() {
- var connector = this.test_connector( { destroy: sinon.spy() } );
+ var connector = this.test_connector();
+ connector.destroy = sinon.spy();
this.input_terminal.destroy();
- // Assert connectors were redrawn
+ // Assert connectors were destroyed
ok( connector.destroy.called );
} );
@@ -189,11 +198,29 @@
test( "cannot accept when already connected", function() {
var self = this;
// If other is subtype but already connected, cannot accept
- this.with_test_connector( {}, function() {
+ this.with_test_connector( function() {
ok( ! self.test_accept() );
} );
} );
+ test( "can accept already connected inputs if input is multiple", function() {
+ var self = this;
+ this.multiple();
+ this.with_test_connector( function() {
+ ok( self.test_accept() );
+ } );
+ } );
+
+ test( "cannot accept already connected inputs if input is multiple but datatypes don't match", function() {
+ var other = { node: {}, datatypes: [ "binary" ] }; // binary is not txt
+
+ var self = this;
+ this.multiple();
+ this.with_test_connector( function() {
+ ok( ! self.test_accept( other ) );
+ } );
+ } );
+
module( "Connector test", {
} );
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: data libraries API: improved deleted folder items handling, pydocs
by commits-noreply@bitbucket.org 25 Apr '14
by commits-noreply@bitbucket.org 25 Apr '14
25 Apr '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/03efdcca1969/
Changeset: 03efdcca1969
User: martenson
Date: 2014-04-25 23:44:50
Summary: data libraries API: improved deleted folder items handling, pydocs
Affected #: 1 file
diff -r de882c9035116eccd7563c9f89aec586a017ce2f -r 03efdcca196906f3aac9939517096da445ff0bf3 lib/galaxy/webapps/galaxy/api/folder_contents.py
--- a/lib/galaxy/webapps/galaxy/api/folder_contents.py
+++ b/lib/galaxy/webapps/galaxy/api/folder_contents.py
@@ -2,6 +2,7 @@
API operations on the contents of a library folder.
"""
from galaxy import web
+from galaxy import util
from galaxy import exceptions
from galaxy.web import _future_expose_api as expose_api
from galaxy.web import _future_expose_api_anonymous as expose_api_anonymous
@@ -21,10 +22,32 @@
def index( self, trans, folder_id, **kwd ):
"""
GET /api/folders/{encoded_folder_id}/contents
- Displays a collection (list) of a folder's contents (files and folders).
- Encoded folder ID is prepended with 'F' if it is a folder as opposed to a data set which does not have it.
- Full path is provided in response as a separate object providing data for breadcrumb path building.
+
+ Displays a collection (list) of a folder's contents
+ (files and folders). Encoded folder ID is prepended
+ with 'F' if it is a folder as opposed to a data set
+ which does not have it. Full path is provided in
+ response as a separate object providing data for
+ breadcrumb path building.
+
+ :param folder_id: encoded ID of the folder which
+ contents should be library_dataset_dict
+ :type folder_id: encoded string
+
+ :param kwd: keyword dictionary with other params
+ :type kwd: dict
+
+ :returns: dictionary containing all items and metadata
+ :type: dict
+
+ :raises: MalformedId, InconsistentDatabase, ObjectNotFound,
+ InternalServerError
"""
+ deleted = kwd.get( 'deleted', 'missing' )
+ try:
+ deleted = util.asbool( deleted )
+ except ValueError:
+ deleted = False
if ( len( folder_id ) == 17 and folder_id.startswith( 'F' ) ):
try:
@@ -69,7 +92,14 @@
def build_path( folder ):
"""
- Search the path upwards recursively and load the whole route of names and ids for breadcrumb building purposes.
+ Search the path upwards recursively and load the whole route of
+ names and ids for breadcrumb building purposes.
+
+ :param folder: current folder for navigating up
+ :param type: Galaxy LibraryFolder
+
+ :returns: list consisting of full path to the library
+ :type: list
"""
path_to_root = []
# We are almost in root
@@ -89,7 +119,7 @@
update_time = ''
create_time = ''
# Go through every accessible item in the folder and include its meta-data.
- for content_item in self._load_folder_contents( trans, folder ):
+ for content_item in self._load_folder_contents( trans, folder, deleted ):
can_access = trans.app.security_agent.can_access_library_item( current_user_roles, content_item, trans.user )
if ( can_access or ( content_item.api_type == 'folder' and trans.app.security_agent.folder_is_unrestricted( content_item ) ) ):
return_item = {}
@@ -119,31 +149,74 @@
type = content_item.api_type,
name = content_item.name,
update_time = update_time,
- create_time = create_time
+ create_time = create_time,
+ deleted = content_item.deleted
) )
folder_contents.append( return_item )
return { 'metadata' : { 'full_path' : full_path, 'can_add_library_item': can_add_library_item, 'folder_name': folder.name }, 'folder_contents' : folder_contents }
- def _load_folder_contents( self, trans, folder ):
+ def _load_folder_contents( self, trans, folder, include_deleted ):
"""
- Loads all contents of the folder (folders and data sets) but only in the first level.
+ Loads all contents of the folder (folders and data sets) but only
+ in the first level. Include deleted if the flag is set and if the
+ user has access to undelete it.
+
+ :param folder: the folder which contents are being loaded
+ :type folder: Galaxy LibraryFolder
+
+ :param include_deleted: flag, when true the items that are deleted
+ and can be undeleted by current user are shown
+ :type include_deleted: boolean
+
+ :returns: a list containing the requested items
+ :type: list
"""
current_user_roles = trans.get_current_user_roles()
is_admin = trans.user_is_admin()
content_items = []
for subfolder in folder.active_folders:
- if not is_admin:
- can_access, folder_ids = trans.app.security_agent.check_folder_contents( trans.user, current_user_roles, subfolder )
- if (is_admin or can_access) and not subfolder.deleted:
- subfolder.api_type = 'folder'
- content_items.append( subfolder )
+ if subfolder.deleted:
+ if include_deleted:
+ if is_admin:
+ subfolder.api_type = 'folder'
+ content_items.append( subfolder )
+ else:
+ can_modify = trans.app.security_agent.can_modify_library_item( current_user_roles, subfolder )
+ if can_modify:
+ subfolder.api_type = 'folder'
+ content_items.append( subfolder )
+ else:
+ if is_admin:
+ subfolder.api_type = 'folder'
+ content_items.append( subfolder )
+ else:
+ can_access, folder_ids = trans.app.security_agent.check_folder_contents( trans.user, current_user_roles, subfolder )
+ if can_access:
+ subfolder.api_type = 'folder'
+ content_items.append( subfolder )
+
for dataset in folder.datasets:
- if not is_admin:
- can_access = trans.app.security_agent.can_access_dataset( current_user_roles, dataset.library_dataset_dataset_association.dataset )
- if (is_admin or can_access) and not dataset.deleted:
- dataset.api_type = 'file'
- content_items.append( dataset )
+ if dataset.deleted:
+ if include_deleted:
+ if is_admin:
+ dataset.api_type = 'file'
+ content_items.append( dataset )
+ else:
+ can_modify = trans.app.security_agent.can_modify_library_item( current_user_roles, dataset )
+ if can_modify:
+ dataset.api_type = 'file'
+ content_items.append( dataset )
+ else:
+ if is_admin:
+ dataset.api_type = 'file'
+ content_items.append( dataset )
+ else:
+ can_access, folder_ids = trans.app.security_agent.can_access_dataset( current_user_roles, dataset.library_dataset_dataset_association.dataset )
+ if can_access:
+ dataset.api_type = 'file'
+ content_items.append( dataset )
+
return content_items
@expose_api
@@ -157,15 +230,22 @@
:type payload: dict
* folder_id: the parent folder of the new item
- * from_hda_id: (optional) the id of an accessible HDA to copy into the library
- * ldda_message: (optional) the new message attribute of the LDDA created
- * extended_metadata: (optional) dub-dictionary containing any extended
- metadata to associate with the item
+ * from_hda_id: (optional) the id of an accessible HDA to copy
+ into the library
+ * ldda_message: (optional) the new message attribute of the LDDA
+ created
+ * extended_metadata: (optional) dub-dictionary containing any
+ extended metadata to associate with the item
- :returns: a dictionary containing the id, name, and 'show' url of the new item
+ :returns: a dictionary containing the id, name,
+ and 'show' url of the new item
:rtype: dict
+
+ :raises: ObjectAttributeInvalidException,
+ InsufficientPermissionsException, ItemAccessibilityException,
+ InternalServerError
"""
- class_name, encoded_folder_id_16 = self.__decode_library_content_id( trans, encoded_folder_id )
+ encoded_folder_id_16 = self.__decode_library_content_id( trans, encoded_folder_id )
from_hda_id, ldda_message = ( payload.pop( 'from_hda_id', None ), payload.pop( 'ldda_message', '' ) )
if ldda_message:
ldda_message = util.sanitize_html.sanitize_html( ldda_message, 'utf-8' )
@@ -200,8 +280,21 @@
return rval
def __decode_library_content_id( self, trans, encoded_folder_id ):
+ """
+ Identifies whether the id provided is properly encoded
+ LibraryFolder.
+
+ :param encoded_folder_id: encoded id of Galaxy LibraryFolder
+ :type encoded_folder_id: encoded string
+
+ :returns: last 16 chars of the encoded id in case it was Folder
+ (had 'F' prepended)
+ :type: string
+
+ :raises: MalformedId
+ """
if ( len( encoded_folder_id ) == 17 and encoded_folder_id.startswith( 'F' )):
- return 'LibraryFolder', encoded_folder_id[1:]
+ return encoded_folder_id[1:]
else:
raise exceptions.MalformedId( 'Malformed folder id ( %s ) specified, unable to decode.' % str( encoded_folder_id ) )
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: Jeremy Goecks: Do not propagate keyboard events in JS editable text plugin; this prevents unwanted side effects with other elmements on the page using keyboard events.
by commits-noreply@bitbucket.org 25 Apr '14
by commits-noreply@bitbucket.org 25 Apr '14
25 Apr '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/de882c903511/
Changeset: de882c903511
User: Jeremy Goecks
Date: 2014-04-25 22:58:21
Summary: Do not propagate keyboard events in JS editable text plugin; this prevents unwanted side effects with other elmements on the page using keyboard events.
Affected #: 1 file
diff -r 986d7190844d5f7b68804242699a8049af80a937 -r de882c9035116eccd7563c9f89aec586a017ce2f static/scripts/galaxy.base.js
--- a/static/scripts/galaxy.base.js
+++ b/static/scripts/galaxy.base.js
@@ -356,6 +356,9 @@
// Enter key.
set_text($(this).val());
}
+
+ // Do not propogate event to avoid unwanted side effects.
+ e.stopPropagation();
});
}
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: data libraries: improved folder rendering flow
by commits-noreply@bitbucket.org 25 Apr '14
by commits-noreply@bitbucket.org 25 Apr '14
25 Apr '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/986d7190844d/
Changeset: 986d7190844d
User: martenson
Date: 2014-04-25 21:36:39
Summary: data libraries: improved folder rendering flow
Affected #: 8 files
diff -r 4fa2b864adca65df5ac73a3fa60e5a4d98b1461c -r 986d7190844d5f7b68804242699a8049af80a937 static/scripts/mvc/library/library-folderlist-view.js
--- a/static/scripts/mvc/library/library-folderlist-view.js
+++ b/static/scripts/mvc/library/library-folderlist-view.js
@@ -12,7 +12,6 @@
mod_library_folderrow_view) {
var FolderListView = Backbone.View.extend({
- // main element definition
el : '#folder_items_element',
// progress percentage
progress: 0,
@@ -32,29 +31,31 @@
},
initialize : function(options){
- var that = this;
- this.options = _.defaults(this.options || {}, options);
- this.collection = new mod_library_model.Folder();
+ this.options = _.defaults(this.options || {}, options);
+ this.collection = new mod_library_model.Folder();
+ // start to listen if someone adds a model to the collection
+ this.listenTo(this.collection, 'add', this.renderOne);
+ this.fetchFolder();
+ },
- // start to listen if someone adds a model to the collection
- this.listenTo(this.collection, 'add', this.addOne);
-
- this.folderContainer = new mod_library_model.FolderContainer({id: this.options.id});
- this.folderContainer.url = this.folderContainer.attributes.urlRoot + this.options.id + '/contents';
- this.folderContainer.fetch({
- success: function (folder_container) {
- that.render();
- var items = folder_container.get('folder').models;
- that.addAll(items);
- },
- error: function(model, response){
- if (typeof response.responseJSON !== "undefined"){
- mod_toastr.error(response.responseJSON.err_msg);
- } else {
- mod_toastr.error('An error ocurred :(');
- }
+ fetchFolder: function(){
+ var that = this;
+ this.folderContainer = new mod_library_model.FolderContainer({id: this.options.id});
+ this.folderContainer.url = this.folderContainer.attributes.urlRoot + this.options.id + '/contents';
+ this.folderContainer.fetch({
+ success: function(folder_container) {
+ that.folder_container = folder_container;
+ that.render();
+ that.addAll(folder_container.get('folder').models)
+ },
+ error: function(model, response){
+ if (typeof response.responseJSON !== "undefined"){
+ mod_toastr.error(response.responseJSON.err_msg);
+ } else {
+ mod_toastr.error('An error ocurred :(');
}
- });
+ }
+ });
},
render: function (options) {
@@ -83,16 +84,33 @@
$("#center").css('overflow','auto');
},
- /** Adds all given models to the collection. */
- addAll:function(items){
- _.each(items.reverse(), function(item) {
- Galaxy.libraries.folderListView.collection.add(item);
+ /**
+ * Adds all given models to the collection.
+ * @param {array of Item or FolderAsModel} array of models that should
+ * be added to the view's collection.
+ */
+ addAll: function(models){
+ _.each(models.reverse(), function(model) {
+ Galaxy.libraries.folderListView.collection.add(model);
});
this.checkEmptiness();
},
- /** Creates a view for the given model and adds it to the folder view. */
- addOne: function(model){
+ /**
+ * Renders whole collection of models as views
+ */
+ renderAll: function(){
+ var that = this;
+ _.each(this.collection.models.reverse(), function(model) {
+ that.renderOne(model);
+ });
+ },
+
+ /**
+ * Creates a view for the given model and adds it to the folder view.
+ * @param {Item or FolderAsModel} model of the view that will be rendered
+ */
+ renderOne: function(model){
if (model.get('data_type') !== 'folder'){
this.options.contains_file = true;
model.set('readable_size', this.size_to_string(model.get('file_size')));
@@ -124,34 +142,42 @@
this.sort = 'asc';
}
this.render();
+ this.renderAll();
},
- /** Sorts the underlying collection according to the parameters received.
- * Currently supports only sorting by name. */
+ /**
+ * Sorts the underlying collection according to the parameters received.
+ * Currently supports only sorting by name.
+ */
sortFolder: function(sort_by, order){
if (sort_by === 'name'){
if (order === 'asc'){
- this.collection.sortByNameAsc();
+ return this.collection.sortByNameAsc();
} else if (order === 'desc'){
- this.collection.sortByNameDesc();
+ return this.collection.sortByNameDesc();
}
}
},
- /** convert size to nice string */
+ /**
+ * convert size to nice string
+ * @param {int} size
+ * @return {string} readable representation of size with units
+ */
size_to_string : function (size){
- // identify unit
var unit = "";
if (size >= 100000000000) { size = size / 100000000000; unit = "TB"; } else
if (size >= 100000000) { size = size / 100000000; unit = "GB"; } else
if (size >= 100000) { size = size / 100000; unit = "MB"; } else
if (size >= 100) { size = size / 100; unit = "KB"; } else
{ size = size * 10; unit = "b"; }
- // return formatted string
return (Math.round(size) / 10) + unit;
},
- /** User clicked the checkbox in the table heading */
+ /**
+ * User clicked the checkbox in the table heading
+ * @param {context} event
+ */
selectAll : function (event) {
var selected = event.target.checked;
that = this;
@@ -168,8 +194,10 @@
});
},
- /** Check checkbox if user clicks on the whole row or
- * on the checkbox itself */
+ /**
+ * Check checkbox if user clicks on the whole row or
+ * on the checkbox itself
+ */
selectClickedRow : function (event) {
var checkbox = '';
var $row;
diff -r 4fa2b864adca65df5ac73a3fa60e5a4d98b1461c -r 986d7190844d5f7b68804242699a8049af80a937 static/scripts/mvc/library/library-foldertoolbar-view.js
--- a/static/scripts/mvc/library/library-foldertoolbar-view.js
+++ b/static/scripts/mvc/library/library-foldertoolbar-view.js
@@ -396,14 +396,15 @@
tmpl_array.push('<div class="library_style_container">');
tmpl_array.push('<h3>Data Libraries Beta Test. This is work in progress. Please report problems & ideas via <a href="mailto:galaxy-bugs@bx.psu.edu?Subject=DataLibrariesBeta_Feedback" target="_blank">email</a> and <a href="https://trello.com/c/nwYQNFPK/56-data-library-ui-progressive-display-of-fol…" target="_blank">Trello</a>.</h3>');
// TOOLBAR
- tmpl_array.push('<div id="library_folder_toolbar" >');
+ tmpl_array.push('<div id="library_folder_toolbar">');
+ tmpl_array.push('<span data-toggle="tooltip" data-placement="top" title="Include deleted datasets"><input id="include_deleted_datasets_chk" style="margin: 0;" type="checkbox"><span class="fa fa-trash-o fa-lg"></span></input></span>');
tmpl_array.push('<div class="btn-group">');
tmpl_array.push(' <button data-toggle="tooltip" data-placement="top" title="Create New Folder" id="toolbtn_create_folder" class="btn btn-default primary-button" type="button" style="display:none;"><span class="fa fa-plus"></span><span class="fa fa-folder"></span></button>');
tmpl_array.push(' <button data-toggle="tooltip" data-placement="top" title="Add Datasets to Current Folder" id="toolbtn_add_files" class="btn btn-default toolbtn_add_files primary-button" type="button" style="display:none;"><span class="fa fa-plus"></span><span class="fa fa-file"></span></span></button>');
tmpl_array.push('</div>');
tmpl_array.push(' <button data-toggle="tooltip" data-placement="top" title="Import selected datasets into history" id="toolbtn_bulk_import" class="primary-button" style="margin-left: 0.5em; " type="button"><span class="fa fa-book"></span> to history</button>');
tmpl_array.push(' <div id="toolbtn_dl" class="btn-group" style="margin-left: 0.5em; ">');
- tmpl_array.push(' <button title="Download selected datasets" id="drop_toggle" type="button" class="primary-button dropdown-toggle" data-toggle="dropdown">');
+ tmpl_array.push(' <button title="Download selected datasets as archive" id="drop_toggle" type="button" class="primary-button dropdown-toggle" data-toggle="dropdown">');
tmpl_array.push(' <span class="fa fa-download"></span> download <span class="caret"></span>');
tmpl_array.push(' </button>');
tmpl_array.push(' <ul class="dropdown-menu" role="menu">');
@@ -412,6 +413,7 @@
tmpl_array.push(' <li id="download_archive"><a href="#/folders/<%= id %>/download/zip">.zip</a></li>');
tmpl_array.push(' </ul>');
tmpl_array.push(' </div>');
+ tmpl_array.push(' <button data-toggle="tooltip" data-placement="top" title="Mark selected datasets deleted" id="toolbtn_bulk_delete" class="primary-button" style="margin-left: 0.5em; " type="button"><span class="fa fa-trash-o"></span> delete</button>');
tmpl_array.push(' </div>');
tmpl_array.push(' <div id="folder_items_element">');
// library items will append here
diff -r 4fa2b864adca65df5ac73a3fa60e5a4d98b1461c -r 986d7190844d5f7b68804242699a8049af80a937 static/scripts/mvc/library/library-librarytoolbar-view.js
--- a/static/scripts/mvc/library/library-librarytoolbar-view.js
+++ b/static/scripts/mvc/library/library-librarytoolbar-view.js
@@ -1,6 +1,9 @@
define([],
function() {
-
+/**
+ * This view represents the top part of the library page.
+ * It contains the tool bar with buttons.
+ */
var LibraryToolbarView = Backbone.View.extend({
el: '#center',
@@ -30,7 +33,7 @@
},
delegate_modal: function(event){
- // probably should refactor to have this functionality in this view, not in the library list view
+ // TODO probably should refactor to have this functionality in this view, not in the library list view
Galaxy.libraries.libraryListView.show_library_modal(event);
},
diff -r 4fa2b864adca65df5ac73a3fa60e5a4d98b1461c -r 986d7190844d5f7b68804242699a8049af80a937 static/scripts/packed/mvc/library/library-folderlist-view.js
--- a/static/scripts/packed/mvc/library/library-folderlist-view.js
+++ b/static/scripts/packed/mvc/library/library-folderlist-view.js
@@ -1,1 +1,1 @@
-define(["galaxy.masthead","utils/utils","libs/toastr","mvc/library/library-model","mvc/library/library-folderrow-view"],function(c,e,f,d,a){var b=Backbone.View.extend({el:"#folder_items_element",progress:0,progressStep:1,modal:null,folderContainer:null,sort:"asc",events:{"click #select-all-checkboxes":"selectAll","click .dataset_row":"selectClickedRow","click .sort-folder-link":"sort_clicked"},initialize:function(g){var h=this;this.options=_.defaults(this.options||{},g);this.collection=new d.Folder();this.listenTo(this.collection,"add",this.addOne);this.folderContainer=new d.FolderContainer({id:this.options.id});this.folderContainer.url=this.folderContainer.attributes.urlRoot+this.options.id+"/contents";this.folderContainer.fetch({success:function(i){h.render();var j=i.get("folder").models;h.addAll(j)},error:function(j,i){if(typeof i.responseJSON!=="undefined"){f.error(i.responseJSON.err_msg)}else{f.error("An error ocurred :(")}}})},render:function(g){this.options=_.defaults(this.options||{},g);var i=this.templateFolder();var j=this.folderContainer.attributes.metadata.full_path;var k;if(j.length===1){k=0}else{k=j[j.length-2][0]}this.$el.html(i({path:this.folderContainer.attributes.metadata.full_path,id:this.options.id,upper_folder_id:k,order:this.sort}));var h=this.folderContainer.attributes.metadata;h.contains_file=this.options.contains_file;Galaxy.libraries.folderToolbarView.configureElements(h);$("#center [data-toggle]").tooltip();$("#center").css("overflow","auto")},addAll:function(g){_.each(g.reverse(),function(h){Galaxy.libraries.folderListView.collection.add(h)});this.checkEmptiness()},addOne:function(h){if(h.get("data_type")!=="folder"){this.options.contains_file=true;h.set("readable_size",this.size_to_string(h.get("file_size")))}var g=new a.FolderRowView(h);this.$el.find("#first_folder_item").after(g.el);this.checkEmptiness()},checkEmptiness:function(){if((this.$el.find(".dataset_row").length===0)&&(this.$el.find(".folder_row").length===0)){var g=this.templateEmptyFolder();this.$el.find("#folder_list_body").append(g())}else{this.$el.find("#empty_folder_message").remove()}},sort_clicked:function(g){g.preventDefault();if(this.sort==="asc"){this.sortFolder("name","desc");this.sort="desc"}else{this.sortFolder("name","asc");this.sort="asc"}this.render()},sortFolder:function(h,g){if(h==="name"){if(g==="asc"){this.collection.sortByNameAsc()}else{if(g==="desc"){this.collection.sortByNameDesc()}}}},size_to_string:function(g){var h="";if(g>=100000000000){g=g/100000000000;h="TB"}else{if(g>=100000000){g=g/100000000;h="GB"}else{if(g>=100000){g=g/100000;h="MB"}else{if(g>=100){g=g/100;h="KB"}else{g=g*10;h="b"}}}}return(Math.round(g)/10)+h},selectAll:function(h){var g=h.target.checked;that=this;$(":checkbox").each(function(){this.checked=g;$row=$(this.parentElement.parentElement);if(g){that.makeDarkRow($row)}else{that.makeWhiteRow($row)}})},selectClickedRow:function(h){var j="";var g;var i;if(h.target.localName==="input"){j=h.target;g=$(h.target.parentElement.parentElement);i="input"}else{if(h.target.localName==="td"){j=$("#"+h.target.parentElement.id).find(":checkbox")[0];g=$(h.target.parentElement);i="td"}}if(j.checked){if(i==="td"){j.checked="";this.makeWhiteRow(g)}else{if(i==="input"){this.makeDarkRow(g)}}}else{if(i==="td"){j.checked="selected";this.makeDarkRow(g)}else{if(i==="input"){this.makeWhiteRow(g)}}}},makeDarkRow:function(g){g.removeClass("light");g.find("a").removeClass("light");g.addClass("dark");g.find("a").addClass("dark");g.find("span").removeClass("fa-file-o");g.find("span").addClass("fa-file")},makeWhiteRow:function(g){g.removeClass("dark");g.find("a").removeClass("dark");g.addClass("light");g.find("a").addClass("light");g.find("span").addClass("fa-file-o");g.find("span").removeClass("fa-file")},templateFolder:function(){var g=[];g.push('<ol class="breadcrumb">');g.push(' <li><a title="Return to the list of libraries" href="#">Libraries</a></li>');g.push(" <% _.each(path, function(path_item) { %>");g.push(" <% if (path_item[0] != id) { %>");g.push(' <li><a title="Return to this folder" href="#/folders/<%- path_item[0] %>"><%- path_item[1] %></a></li> ');g.push("<% } else { %>");g.push(' <li class="active"><span title="You are in this folder"><%- path_item[1] %></span></li>');g.push(" <% } %>");g.push(" <% }); %>");g.push("</ol>");g.push('<table id="folder_table" class="grid table table-condensed">');g.push(" <thead>");g.push(' <th class="button_heading"></th>');g.push(' <th style="text-align: center; width: 20px; " title="Check to select all datasets"><input id="select-all-checkboxes" style="margin: 0;" type="checkbox"></th>');g.push(' <th><a class="sort-folder-link" title="Click to reverse order" href="#">name</a><span title="Sorted alphabetically" class="fa fa-sort-alpha-<%- order %>"></span></th>');g.push(" <th>data type</th>");g.push(" <th>size</th>");g.push(" <th>time updated (UTC)</th>");g.push(" </thead>");g.push(' <tbody id="folder_list_body">');g.push(' <tr id="first_folder_item">');g.push(' <td><a href="#<% if (upper_folder_id !== 0){ print("folders/" + upper_folder_id)} %>" title="Go to parent folder" class="btn_open_folder btn btn-default btn-xs">..<a></td>');g.push(" <td></td>");g.push(" <td></td>");g.push(" <td></td>");g.push(" <td></td>");g.push(" <td></td>");g.push(" </tr>");g.push(" </tbody>");g.push("</table>");return _.template(g.join(""))},templateEmptyFolder:function(){var g=[];g.push('<tr id="empty_folder_message">');g.push('<td colspan="6" style="text-align:center">');g.push("This folder is either empty or you do not have proper access permissions to see the contents.");g.push("</td>");g.push("</tr>");return _.template(g.join(""))}});return{FolderListView:b}});
\ No newline at end of file
+define(["galaxy.masthead","utils/utils","libs/toastr","mvc/library/library-model","mvc/library/library-folderrow-view"],function(c,e,f,d,a){var b=Backbone.View.extend({el:"#folder_items_element",progress:0,progressStep:1,modal:null,folderContainer:null,sort:"asc",events:{"click #select-all-checkboxes":"selectAll","click .dataset_row":"selectClickedRow","click .sort-folder-link":"sort_clicked"},initialize:function(g){this.options=_.defaults(this.options||{},g);this.collection=new d.Folder();this.listenTo(this.collection,"add",this.renderOne);this.fetchFolder()},fetchFolder:function(){var g=this;this.folderContainer=new d.FolderContainer({id:this.options.id});this.folderContainer.url=this.folderContainer.attributes.urlRoot+this.options.id+"/contents";this.folderContainer.fetch({success:function(h){g.folder_container=h;g.render();g.addAll(h.get("folder").models)},error:function(i,h){if(typeof h.responseJSON!=="undefined"){f.error(h.responseJSON.err_msg)}else{f.error("An error ocurred :(")}}})},render:function(g){this.options=_.defaults(this.options||{},g);var i=this.templateFolder();var j=this.folderContainer.attributes.metadata.full_path;var k;if(j.length===1){k=0}else{k=j[j.length-2][0]}this.$el.html(i({path:this.folderContainer.attributes.metadata.full_path,id:this.options.id,upper_folder_id:k,order:this.sort}));var h=this.folderContainer.attributes.metadata;h.contains_file=this.options.contains_file;Galaxy.libraries.folderToolbarView.configureElements(h);$("#center [data-toggle]").tooltip();$("#center").css("overflow","auto")},addAll:function(g){_.each(g.reverse(),function(h){Galaxy.libraries.folderListView.collection.add(h)});this.checkEmptiness()},renderAll:function(){var g=this;_.each(this.collection.models.reverse(),function(h){g.renderOne(h)})},renderOne:function(h){if(h.get("data_type")!=="folder"){this.options.contains_file=true;h.set("readable_size",this.size_to_string(h.get("file_size")))}var g=new a.FolderRowView(h);this.$el.find("#first_folder_item").after(g.el);this.checkEmptiness()},checkEmptiness:function(){if((this.$el.find(".dataset_row").length===0)&&(this.$el.find(".folder_row").length===0)){var g=this.templateEmptyFolder();this.$el.find("#folder_list_body").append(g())}else{this.$el.find("#empty_folder_message").remove()}},sort_clicked:function(g){g.preventDefault();if(this.sort==="asc"){this.sortFolder("name","desc");this.sort="desc"}else{this.sortFolder("name","asc");this.sort="asc"}this.render();this.renderAll()},sortFolder:function(h,g){if(h==="name"){if(g==="asc"){return this.collection.sortByNameAsc()}else{if(g==="desc"){return this.collection.sortByNameDesc()}}}},size_to_string:function(g){var h="";if(g>=100000000000){g=g/100000000000;h="TB"}else{if(g>=100000000){g=g/100000000;h="GB"}else{if(g>=100000){g=g/100000;h="MB"}else{if(g>=100){g=g/100;h="KB"}else{g=g*10;h="b"}}}}return(Math.round(g)/10)+h},selectAll:function(h){var g=h.target.checked;that=this;$(":checkbox").each(function(){this.checked=g;$row=$(this.parentElement.parentElement);if(g){that.makeDarkRow($row)}else{that.makeWhiteRow($row)}})},selectClickedRow:function(h){var j="";var g;var i;if(h.target.localName==="input"){j=h.target;g=$(h.target.parentElement.parentElement);i="input"}else{if(h.target.localName==="td"){j=$("#"+h.target.parentElement.id).find(":checkbox")[0];g=$(h.target.parentElement);i="td"}}if(j.checked){if(i==="td"){j.checked="";this.makeWhiteRow(g)}else{if(i==="input"){this.makeDarkRow(g)}}}else{if(i==="td"){j.checked="selected";this.makeDarkRow(g)}else{if(i==="input"){this.makeWhiteRow(g)}}}},makeDarkRow:function(g){g.removeClass("light");g.find("a").removeClass("light");g.addClass("dark");g.find("a").addClass("dark");g.find("span").removeClass("fa-file-o");g.find("span").addClass("fa-file")},makeWhiteRow:function(g){g.removeClass("dark");g.find("a").removeClass("dark");g.addClass("light");g.find("a").addClass("light");g.find("span").addClass("fa-file-o");g.find("span").removeClass("fa-file")},templateFolder:function(){var g=[];g.push('<ol class="breadcrumb">');g.push(' <li><a title="Return to the list of libraries" href="#">Libraries</a></li>');g.push(" <% _.each(path, function(path_item) { %>");g.push(" <% if (path_item[0] != id) { %>");g.push(' <li><a title="Return to this folder" href="#/folders/<%- path_item[0] %>"><%- path_item[1] %></a></li> ');g.push("<% } else { %>");g.push(' <li class="active"><span title="You are in this folder"><%- path_item[1] %></span></li>');g.push(" <% } %>");g.push(" <% }); %>");g.push("</ol>");g.push('<table id="folder_table" class="grid table table-condensed">');g.push(" <thead>");g.push(' <th class="button_heading"></th>');g.push(' <th style="text-align: center; width: 20px; " title="Check to select all datasets"><input id="select-all-checkboxes" style="margin: 0;" type="checkbox"></th>');g.push(' <th><a class="sort-folder-link" title="Click to reverse order" href="#">name</a><span title="Sorted alphabetically" class="fa fa-sort-alpha-<%- order %>"></span></th>');g.push(" <th>data type</th>");g.push(" <th>size</th>");g.push(" <th>time updated (UTC)</th>");g.push(" </thead>");g.push(' <tbody id="folder_list_body">');g.push(' <tr id="first_folder_item">');g.push(' <td><a href="#<% if (upper_folder_id !== 0){ print("folders/" + upper_folder_id)} %>" title="Go to parent folder" class="btn_open_folder btn btn-default btn-xs">..<a></td>');g.push(" <td></td>");g.push(" <td></td>");g.push(" <td></td>");g.push(" <td></td>");g.push(" <td></td>");g.push(" </tr>");g.push(" </tbody>");g.push("</table>");return _.template(g.join(""))},templateEmptyFolder:function(){var g=[];g.push('<tr id="empty_folder_message">');g.push('<td colspan="6" style="text-align:center">');g.push("This folder is either empty or you do not have proper access permissions to see the contents.");g.push("</td>");g.push("</tr>");return _.template(g.join(""))}});return{FolderListView:b}});
\ No newline at end of file
diff -r 4fa2b864adca65df5ac73a3fa60e5a4d98b1461c -r 986d7190844d5f7b68804242699a8049af80a937 static/scripts/packed/mvc/library/library-foldertoolbar-view.js
--- a/static/scripts/packed/mvc/library/library-foldertoolbar-view.js
+++ b/static/scripts/packed/mvc/library/library-foldertoolbar-view.js
@@ -1,1 +1,1 @@
-define(["galaxy.masthead","utils/utils","libs/toastr","mvc/library/library-model"],function(b,d,e,c){var a=Backbone.View.extend({el:"#center",events:{"click #toolbtn_create_folder":"createFolderFromModal","click #toolbtn_bulk_import":"modalBulkImport","click .toolbtn_add_files":"addFilesToFolderModal"},defaults:{can_add_library_item:false,contains_file:false,chain_call_control:{total_number:0,failed_number:0}},modal:null,histories:null,initialize:function(f){this.options=_.defaults(f||{},this.defaults);this.render()},render:function(f){this.options=_.extend(this.options,f);var h=this.templateToolBar();var g=false;if(Galaxy.currUser){g=Galaxy.currUser.isAdmin()}this.$el.html(h({id:this.options.id,admin_user:g}))},configureElements:function(f){this.options=_.extend(this.options,f);if(this.options.can_add_library_item===true){$("#toolbtn_create_folder").show();$(".toolbtn_add_files").show()}if(this.options.contains_file===true){$("#toolbtn_bulk_import").show();$("#toolbtn_dl").show()}this.$el.find("[data-toggle]").tooltip()},createFolderFromModal:function(){event.preventDefault();event.stopPropagation();var f=this;var g=this.templateNewFolderInModal();this.modal=Galaxy.modal;this.modal.show({closing_events:true,title:"Create New Folder",body:g(),buttons:{Create:function(){f.create_new_folder_event()},Close:function(){Galaxy.modal.hide()}}})},create_new_folder_event:function(){var f=this.serialize_new_folder();if(this.validate_new_folder(f)){var g=new c.FolderAsModel();url_items=Backbone.history.fragment.split("/");current_folder_id=url_items[url_items.length-1];g.url=g.urlRoot+"/"+current_folder_id;g.save(f,{success:function(h){Galaxy.modal.hide();e.success("Folder created");h.set({type:"folder"});Galaxy.libraries.folderListView.collection.add(h)},error:function(i,h){Galaxy.modal.hide();if(typeof h.responseJSON!=="undefined"){e.error(h.responseJSON.err_msg)}else{e.error("An error ocurred :(")}}})}else{e.error("Folder's name is missing")}return false},serialize_new_folder:function(){return{name:$("input[name='Name']").val(),description:$("input[name='Description']").val()}},validate_new_folder:function(f){return f.name!==""},modalBulkImport:function(){var f=$("#folder_table").find(":checked");if(f.length===0){e.info("You have to select some datasets first")}else{this.refreshUserHistoriesList(function(g){var h=g.templateBulkImportInModal();g.modal=Galaxy.modal;g.modal.show({closing_events:true,title:"Import into History",body:h({histories:g.histories.models}),buttons:{Import:function(){g.importAllIntoHistory()},Close:function(){Galaxy.modal.hide()}}})})}},refreshUserHistoriesList:function(g){var f=this;this.histories=new c.GalaxyHistories();this.histories.fetch({success:function(){g(f)},error:function(i,h){if(typeof h.responseJSON!=="undefined"){e.error(h.responseJSON.err_msg)}else{e.error("An error ocurred :(")}}})},importAllIntoHistory:function(){this.modal.disableButton("Import");this.options.chain_call_control.total_number=0;this.options.chain_call_control.failed_number=0;var j=$("select[name=dataset_import_bulk] option:selected").val();this.options.last_used_history_id=j;var m=$("select[name=dataset_import_bulk] option:selected").text();var o=[];$("#folder_table").find(":checked").each(function(){if(this.parentElement.parentElement.id!==""){o.push(this.parentElement.parentElement.id)}});var n=this.templateImportIntoHistoryProgressBar();this.modal.$el.find(".modal-body").html(n({history_name:m}));var k=100/o.length;this.initProgress(k);var f=[];for(var g=o.length-1;g>=0;g--){var h=o[g];var l=new c.HistoryItem();l.url=l.urlRoot+j+"/contents";l.content=h;l.source="library";f.push(l)}this.options.chain_call_control.total_number=f.length;this.chainCall(f,m)},chainCall:function(g,j){var f=this;var h=g.pop();if(typeof h==="undefined"){if(this.options.chain_call_control.failed_number===0){e.success("Selected datasets imported into history")}else{if(this.options.chain_call_control.failed_number===this.options.chain_call_control.total_number){e.error("There was an error and no datasets were imported into history.")}else{if(this.options.chain_call_control.failed_number<this.options.chain_call_control.total_number){e.warning("Some of the datasets could not be imported into history")}}}Galaxy.modal.hide();return}var i=$.when(h.save({content:h.content,source:h.source}));i.done(function(){f.updateProgress();f.chainCall(g,j)}).fail(function(){f.options.chain_call_control.failed_number+=1;f.updateProgress();f.chainCall(g,j)})},initProgress:function(f){this.progress=0;this.progressStep=f},updateProgress:function(){this.progress+=this.progressStep;$(".progress-bar-import").width(Math.round(this.progress)+"%");txt_representation=Math.round(this.progress)+"% Complete";$(".completion_span").text(txt_representation)},download:function(f,j){var h=[];$("#folder_table").find(":checked").each(function(){if(this.parentElement.parentElement.id!==""){h.push(this.parentElement.parentElement.id)}});var g="/api/libraries/datasets/download/"+j;var i={ldda_ids:h};this.processDownload(g,i,"get")},processDownload:function(g,h,i){if(g&&h){h=typeof h==="string"?h:$.param(h);var f="";$.each(h.split("&"),function(){var j=this.split("=");f+='<input type="hidden" name="'+j[0]+'" value="'+j[1]+'" />'});$('<form action="'+g+'" method="'+(i||"post")+'">'+f+"</form>").appendTo("body").submit().remove();e.info("Your download will begin soon")}},addFilesToFolderModal:function(){this.refreshUserHistoriesList(function(f){f.modal=Galaxy.modal;var g=f.templateAddFilesInModal();f.modal.show({closing_events:true,title:"Add datasets from history to "+f.options.folder_name,body:g({histories:f.histories.models}),buttons:{Add:function(){f.addAllDatasetsFromHistory()},Close:function(){Galaxy.modal.hide()}}});if(f.histories.models.length>0){f.fetchAndDisplayHistoryContents(f.histories.models[0].id);$("#dataset_add_bulk").change(function(h){f.fetchAndDisplayHistoryContents(h.target.value)})}else{e.error("An error ocurred :(")}})},fetchAndDisplayHistoryContents:function(h){var g=new c.HistoryContents({id:h});var f=this;g.fetch({success:function(j){var i=f.templateHistoryContents();f.histories.get(h).set({contents:j});f.modal.$el.find("#selected_history_content").html(i({history_contents:j.models.reverse()}))},error:function(){e.error("An error ocurred :(")}})},addAllDatasetsFromHistory:function(){this.modal.disableButton("Add");this.options.chain_call_control.total_number=0;this.options.chain_call_control.failed_number=0;var f=[];this.modal.$el.find("#selected_history_content").find(":checked").each(function(){var i=$(this.parentElement).data("id");if(i){f.push(i)}});var l=this.options.folder_name;var k=this.templateAddingDatasetsProgressBar();this.modal.$el.find(".modal-body").html(k({folder_name:l}));this.progressStep=100/f.length;this.progress=0;var j=[];for(var h=f.length-1;h>=0;h--){history_dataset_id=f[h];var g=new c.Item();g.url="/api/folders/"+this.options.id+"/contents";g.set({from_hda_id:history_dataset_id});j.push(g)}this.options.chain_call_control.total_number=j.length;this.chainCallAddingHdas(j)},chainCallAddingHdas:function(g){var f=this;this.added_hdas=new c.Folder();var h=g.pop();if(typeof h==="undefined"){if(this.options.chain_call_control.failed_number===0){e.success("Selected datasets from history added to the folder")}else{if(this.options.chain_call_control.failed_number===this.options.chain_call_control.total_number){e.error("There was an error and no datasets were added to the folder.")}else{if(this.options.chain_call_control.failed_number<this.options.chain_call_control.total_number){e.warning("Some of the datasets could not be added to the folder")}}}Galaxy.modal.hide();return this.added_hdas}var i=$.when(h.save({from_hda_id:h.get("from_hda_id")}));i.done(function(j){Galaxy.libraries.folderListView.collection.add(j);f.updateProgress();f.chainCallAddingHdas(g)}).fail(function(){f.options.chain_call_control.failed_number+=1;f.updateProgress();f.chainCallAddingHdas(g)})},templateToolBar:function(){tmpl_array=[];tmpl_array.push('<div class="library_style_container">');tmpl_array.push('<h3>Data Libraries Beta Test. This is work in progress. Please report problems & ideas via <a href="mailto:galaxy-bugs@bx.psu.edu?Subject=DataLibrariesBeta_Feedback" target="_blank">email</a> and <a href="https://trello.com/c/nwYQNFPK/56-data-library-ui-progressive-display-of-fol…" target="_blank">Trello</a>.</h3>');tmpl_array.push('<div id="library_folder_toolbar" >');tmpl_array.push('<div class="btn-group">');tmpl_array.push(' <button data-toggle="tooltip" data-placement="top" title="Create New Folder" id="toolbtn_create_folder" class="btn btn-default primary-button" type="button" style="display:none;"><span class="fa fa-plus"></span><span class="fa fa-folder"></span></button>');tmpl_array.push(' <button data-toggle="tooltip" data-placement="top" title="Add Datasets to Current Folder" id="toolbtn_add_files" class="btn btn-default toolbtn_add_files primary-button" type="button" style="display:none;"><span class="fa fa-plus"></span><span class="fa fa-file"></span></span></button>');tmpl_array.push("</div>");tmpl_array.push(' <button data-toggle="tooltip" data-placement="top" title="Import selected datasets into history" id="toolbtn_bulk_import" class="primary-button" style="margin-left: 0.5em; " type="button"><span class="fa fa-book"></span> to history</button>');tmpl_array.push(' <div id="toolbtn_dl" class="btn-group" style="margin-left: 0.5em; ">');tmpl_array.push(' <button title="Download selected datasets" id="drop_toggle" type="button" class="primary-button dropdown-toggle" data-toggle="dropdown">');tmpl_array.push(' <span class="fa fa-download"></span> download <span class="caret"></span>');tmpl_array.push(" </button>");tmpl_array.push(' <ul class="dropdown-menu" role="menu">');tmpl_array.push(' <li id="download_archive"><a href="#/folders/<%= id %>/download/tgz">.tar.gz</a></li>');tmpl_array.push(' <li id="download_archive"><a href="#/folders/<%= id %>/download/tbz">.tar.bz</a></li>');tmpl_array.push(' <li id="download_archive"><a href="#/folders/<%= id %>/download/zip">.zip</a></li>');tmpl_array.push(" </ul>");tmpl_array.push(" </div>");tmpl_array.push(" </div>");tmpl_array.push(' <div id="folder_items_element">');tmpl_array.push(" </div>");tmpl_array.push("</div>");return _.template(tmpl_array.join(""))},templateNewFolderInModal:function(){tmpl_array=[];tmpl_array.push('<div id="new_folder_modal">');tmpl_array.push("<form>");tmpl_array.push('<input type="text" name="Name" value="" placeholder="Name">');tmpl_array.push('<input type="text" name="Description" value="" placeholder="Description">');tmpl_array.push("</form>");tmpl_array.push("</div>");return _.template(tmpl_array.join(""))},templateBulkImportInModal:function(){var f=[];f.push('<span id="history_modal_combo_bulk" style="width:90%; margin-left: 1em; margin-right: 1em; ">');f.push("Select history: ");f.push('<select id="dataset_import_bulk" name="dataset_import_bulk" style="width:50%; margin-bottom: 1em; "> ');f.push(" <% _.each(histories, function(history) { %>");f.push(' <option value="<%= _.escape(history.get("id")) %>"><%= _.escape(history.get("name")) %></option>');f.push(" <% }); %>");f.push("</select>");f.push("</span>");return _.template(f.join(""))},templateImportIntoHistoryProgressBar:function(){var f=[];f.push('<div class="import_text">');f.push("Importing selected datasets to history <b><%= _.escape(history_name) %></b>");f.push("</div>");f.push('<div class="progress">');f.push(' <div class="progress-bar progress-bar-import" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" style="width: 00%;">');f.push(' <span class="completion_span">0% Complete</span>');f.push(" </div>");f.push("</div>");f.push("");return _.template(f.join(""))},templateAddingDatasetsProgressBar:function(){var f=[];f.push('<div class="import_text">');f.push("Adding selected datasets from history to library folder <b><%= _.escape(folder_name) %></b>");f.push("</div>");f.push('<div class="progress">');f.push(' <div class="progress-bar progress-bar-import" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" style="width: 00%;">');f.push(' <span class="completion_span">0% Complete</span>');f.push(" </div>");f.push("</div>");f.push("");return _.template(f.join(""))},templateAddFilesInModal:function(){var f=[];f.push('<div id="add_files_modal">');f.push('<div id="history_modal_combo_bulk">');f.push("Select history: ");f.push('<select id="dataset_add_bulk" name="dataset_add_bulk" style="width:66%; "> ');f.push(" <% _.each(histories, function(history) { %>");f.push(' <option value="<%= _.escape(history.get("id")) %>"><%= _.escape(history.get("name")) %></option>');f.push(" <% }); %>");f.push("</select>");f.push("</div>");f.push('<div id="selected_history_content">');f.push("</div>");f.push("</div>");return _.template(f.join(""))},templateHistoryContents:function(){var f=[];f.push("Choose the datasets to import:");f.push("<ul>");f.push(" <% _.each(history_contents, function(history_item) { %>");f.push(' <li data-id="<%= _.escape(history_item.get("id")) %>">');f.push(' <input style="margin: 0;" type="checkbox"><%= _.escape(history_item.get("hid")) %>: <%= _.escape(history_item.get("name")) %>');f.push(" </li>");f.push(" <% }); %>");f.push("</ul>");return _.template(f.join(""))}});return{FolderToolbarView:a}});
\ No newline at end of file
+define(["galaxy.masthead","utils/utils","libs/toastr","mvc/library/library-model"],function(b,d,e,c){var a=Backbone.View.extend({el:"#center",events:{"click #toolbtn_create_folder":"createFolderFromModal","click #toolbtn_bulk_import":"modalBulkImport","click .toolbtn_add_files":"addFilesToFolderModal"},defaults:{can_add_library_item:false,contains_file:false,chain_call_control:{total_number:0,failed_number:0}},modal:null,histories:null,initialize:function(f){this.options=_.defaults(f||{},this.defaults);this.render()},render:function(f){this.options=_.extend(this.options,f);var h=this.templateToolBar();var g=false;if(Galaxy.currUser){g=Galaxy.currUser.isAdmin()}this.$el.html(h({id:this.options.id,admin_user:g}))},configureElements:function(f){this.options=_.extend(this.options,f);if(this.options.can_add_library_item===true){$("#toolbtn_create_folder").show();$(".toolbtn_add_files").show()}if(this.options.contains_file===true){$("#toolbtn_bulk_import").show();$("#toolbtn_dl").show()}this.$el.find("[data-toggle]").tooltip()},createFolderFromModal:function(){event.preventDefault();event.stopPropagation();var f=this;var g=this.templateNewFolderInModal();this.modal=Galaxy.modal;this.modal.show({closing_events:true,title:"Create New Folder",body:g(),buttons:{Create:function(){f.create_new_folder_event()},Close:function(){Galaxy.modal.hide()}}})},create_new_folder_event:function(){var f=this.serialize_new_folder();if(this.validate_new_folder(f)){var g=new c.FolderAsModel();url_items=Backbone.history.fragment.split("/");current_folder_id=url_items[url_items.length-1];g.url=g.urlRoot+"/"+current_folder_id;g.save(f,{success:function(h){Galaxy.modal.hide();e.success("Folder created");h.set({type:"folder"});Galaxy.libraries.folderListView.collection.add(h)},error:function(i,h){Galaxy.modal.hide();if(typeof h.responseJSON!=="undefined"){e.error(h.responseJSON.err_msg)}else{e.error("An error ocurred :(")}}})}else{e.error("Folder's name is missing")}return false},serialize_new_folder:function(){return{name:$("input[name='Name']").val(),description:$("input[name='Description']").val()}},validate_new_folder:function(f){return f.name!==""},modalBulkImport:function(){var f=$("#folder_table").find(":checked");if(f.length===0){e.info("You have to select some datasets first")}else{this.refreshUserHistoriesList(function(g){var h=g.templateBulkImportInModal();g.modal=Galaxy.modal;g.modal.show({closing_events:true,title:"Import into History",body:h({histories:g.histories.models}),buttons:{Import:function(){g.importAllIntoHistory()},Close:function(){Galaxy.modal.hide()}}})})}},refreshUserHistoriesList:function(g){var f=this;this.histories=new c.GalaxyHistories();this.histories.fetch({success:function(){g(f)},error:function(i,h){if(typeof h.responseJSON!=="undefined"){e.error(h.responseJSON.err_msg)}else{e.error("An error ocurred :(")}}})},importAllIntoHistory:function(){this.modal.disableButton("Import");this.options.chain_call_control.total_number=0;this.options.chain_call_control.failed_number=0;var j=$("select[name=dataset_import_bulk] option:selected").val();this.options.last_used_history_id=j;var m=$("select[name=dataset_import_bulk] option:selected").text();var o=[];$("#folder_table").find(":checked").each(function(){if(this.parentElement.parentElement.id!==""){o.push(this.parentElement.parentElement.id)}});var n=this.templateImportIntoHistoryProgressBar();this.modal.$el.find(".modal-body").html(n({history_name:m}));var k=100/o.length;this.initProgress(k);var f=[];for(var g=o.length-1;g>=0;g--){var h=o[g];var l=new c.HistoryItem();l.url=l.urlRoot+j+"/contents";l.content=h;l.source="library";f.push(l)}this.options.chain_call_control.total_number=f.length;this.chainCall(f,m)},chainCall:function(g,j){var f=this;var h=g.pop();if(typeof h==="undefined"){if(this.options.chain_call_control.failed_number===0){e.success("Selected datasets imported into history")}else{if(this.options.chain_call_control.failed_number===this.options.chain_call_control.total_number){e.error("There was an error and no datasets were imported into history.")}else{if(this.options.chain_call_control.failed_number<this.options.chain_call_control.total_number){e.warning("Some of the datasets could not be imported into history")}}}Galaxy.modal.hide();return}var i=$.when(h.save({content:h.content,source:h.source}));i.done(function(){f.updateProgress();f.chainCall(g,j)}).fail(function(){f.options.chain_call_control.failed_number+=1;f.updateProgress();f.chainCall(g,j)})},initProgress:function(f){this.progress=0;this.progressStep=f},updateProgress:function(){this.progress+=this.progressStep;$(".progress-bar-import").width(Math.round(this.progress)+"%");txt_representation=Math.round(this.progress)+"% Complete";$(".completion_span").text(txt_representation)},download:function(f,j){var h=[];$("#folder_table").find(":checked").each(function(){if(this.parentElement.parentElement.id!==""){h.push(this.parentElement.parentElement.id)}});var g="/api/libraries/datasets/download/"+j;var i={ldda_ids:h};this.processDownload(g,i,"get")},processDownload:function(g,h,i){if(g&&h){h=typeof h==="string"?h:$.param(h);var f="";$.each(h.split("&"),function(){var j=this.split("=");f+='<input type="hidden" name="'+j[0]+'" value="'+j[1]+'" />'});$('<form action="'+g+'" method="'+(i||"post")+'">'+f+"</form>").appendTo("body").submit().remove();e.info("Your download will begin soon")}},addFilesToFolderModal:function(){this.refreshUserHistoriesList(function(f){f.modal=Galaxy.modal;var g=f.templateAddFilesInModal();f.modal.show({closing_events:true,title:"Add datasets from history to "+f.options.folder_name,body:g({histories:f.histories.models}),buttons:{Add:function(){f.addAllDatasetsFromHistory()},Close:function(){Galaxy.modal.hide()}}});if(f.histories.models.length>0){f.fetchAndDisplayHistoryContents(f.histories.models[0].id);$("#dataset_add_bulk").change(function(h){f.fetchAndDisplayHistoryContents(h.target.value)})}else{e.error("An error ocurred :(")}})},fetchAndDisplayHistoryContents:function(h){var g=new c.HistoryContents({id:h});var f=this;g.fetch({success:function(j){var i=f.templateHistoryContents();f.histories.get(h).set({contents:j});f.modal.$el.find("#selected_history_content").html(i({history_contents:j.models.reverse()}))},error:function(){e.error("An error ocurred :(")}})},addAllDatasetsFromHistory:function(){this.modal.disableButton("Add");this.options.chain_call_control.total_number=0;this.options.chain_call_control.failed_number=0;var f=[];this.modal.$el.find("#selected_history_content").find(":checked").each(function(){var i=$(this.parentElement).data("id");if(i){f.push(i)}});var l=this.options.folder_name;var k=this.templateAddingDatasetsProgressBar();this.modal.$el.find(".modal-body").html(k({folder_name:l}));this.progressStep=100/f.length;this.progress=0;var j=[];for(var h=f.length-1;h>=0;h--){history_dataset_id=f[h];var g=new c.Item();g.url="/api/folders/"+this.options.id+"/contents";g.set({from_hda_id:history_dataset_id});j.push(g)}this.options.chain_call_control.total_number=j.length;this.chainCallAddingHdas(j)},chainCallAddingHdas:function(g){var f=this;this.added_hdas=new c.Folder();var h=g.pop();if(typeof h==="undefined"){if(this.options.chain_call_control.failed_number===0){e.success("Selected datasets from history added to the folder")}else{if(this.options.chain_call_control.failed_number===this.options.chain_call_control.total_number){e.error("There was an error and no datasets were added to the folder.")}else{if(this.options.chain_call_control.failed_number<this.options.chain_call_control.total_number){e.warning("Some of the datasets could not be added to the folder")}}}Galaxy.modal.hide();return this.added_hdas}var i=$.when(h.save({from_hda_id:h.get("from_hda_id")}));i.done(function(j){Galaxy.libraries.folderListView.collection.add(j);f.updateProgress();f.chainCallAddingHdas(g)}).fail(function(){f.options.chain_call_control.failed_number+=1;f.updateProgress();f.chainCallAddingHdas(g)})},templateToolBar:function(){tmpl_array=[];tmpl_array.push('<div class="library_style_container">');tmpl_array.push('<h3>Data Libraries Beta Test. This is work in progress. Please report problems & ideas via <a href="mailto:galaxy-bugs@bx.psu.edu?Subject=DataLibrariesBeta_Feedback" target="_blank">email</a> and <a href="https://trello.com/c/nwYQNFPK/56-data-library-ui-progressive-display-of-fol…" target="_blank">Trello</a>.</h3>');tmpl_array.push('<div id="library_folder_toolbar">');tmpl_array.push('<span data-toggle="tooltip" data-placement="top" title="Include deleted datasets"><input id="include_deleted_datasets_chk" style="margin: 0;" type="checkbox"><span class="fa fa-trash-o fa-lg"></span></input></span>');tmpl_array.push('<div class="btn-group">');tmpl_array.push(' <button data-toggle="tooltip" data-placement="top" title="Create New Folder" id="toolbtn_create_folder" class="btn btn-default primary-button" type="button" style="display:none;"><span class="fa fa-plus"></span><span class="fa fa-folder"></span></button>');tmpl_array.push(' <button data-toggle="tooltip" data-placement="top" title="Add Datasets to Current Folder" id="toolbtn_add_files" class="btn btn-default toolbtn_add_files primary-button" type="button" style="display:none;"><span class="fa fa-plus"></span><span class="fa fa-file"></span></span></button>');tmpl_array.push("</div>");tmpl_array.push(' <button data-toggle="tooltip" data-placement="top" title="Import selected datasets into history" id="toolbtn_bulk_import" class="primary-button" style="margin-left: 0.5em; " type="button"><span class="fa fa-book"></span> to history</button>');tmpl_array.push(' <div id="toolbtn_dl" class="btn-group" style="margin-left: 0.5em; ">');tmpl_array.push(' <button title="Download selected datasets as archive" id="drop_toggle" type="button" class="primary-button dropdown-toggle" data-toggle="dropdown">');tmpl_array.push(' <span class="fa fa-download"></span> download <span class="caret"></span>');tmpl_array.push(" </button>");tmpl_array.push(' <ul class="dropdown-menu" role="menu">');tmpl_array.push(' <li id="download_archive"><a href="#/folders/<%= id %>/download/tgz">.tar.gz</a></li>');tmpl_array.push(' <li id="download_archive"><a href="#/folders/<%= id %>/download/tbz">.tar.bz</a></li>');tmpl_array.push(' <li id="download_archive"><a href="#/folders/<%= id %>/download/zip">.zip</a></li>');tmpl_array.push(" </ul>");tmpl_array.push(" </div>");tmpl_array.push(' <button data-toggle="tooltip" data-placement="top" title="Mark selected datasets deleted" id="toolbtn_bulk_delete" class="primary-button" style="margin-left: 0.5em; " type="button"><span class="fa fa-trash-o"></span> delete</button>');tmpl_array.push(" </div>");tmpl_array.push(' <div id="folder_items_element">');tmpl_array.push(" </div>");tmpl_array.push("</div>");return _.template(tmpl_array.join(""))},templateNewFolderInModal:function(){tmpl_array=[];tmpl_array.push('<div id="new_folder_modal">');tmpl_array.push("<form>");tmpl_array.push('<input type="text" name="Name" value="" placeholder="Name">');tmpl_array.push('<input type="text" name="Description" value="" placeholder="Description">');tmpl_array.push("</form>");tmpl_array.push("</div>");return _.template(tmpl_array.join(""))},templateBulkImportInModal:function(){var f=[];f.push('<span id="history_modal_combo_bulk" style="width:90%; margin-left: 1em; margin-right: 1em; ">');f.push("Select history: ");f.push('<select id="dataset_import_bulk" name="dataset_import_bulk" style="width:50%; margin-bottom: 1em; "> ');f.push(" <% _.each(histories, function(history) { %>");f.push(' <option value="<%= _.escape(history.get("id")) %>"><%= _.escape(history.get("name")) %></option>');f.push(" <% }); %>");f.push("</select>");f.push("</span>");return _.template(f.join(""))},templateImportIntoHistoryProgressBar:function(){var f=[];f.push('<div class="import_text">');f.push("Importing selected datasets to history <b><%= _.escape(history_name) %></b>");f.push("</div>");f.push('<div class="progress">');f.push(' <div class="progress-bar progress-bar-import" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" style="width: 00%;">');f.push(' <span class="completion_span">0% Complete</span>');f.push(" </div>");f.push("</div>");f.push("");return _.template(f.join(""))},templateAddingDatasetsProgressBar:function(){var f=[];f.push('<div class="import_text">');f.push("Adding selected datasets from history to library folder <b><%= _.escape(folder_name) %></b>");f.push("</div>");f.push('<div class="progress">');f.push(' <div class="progress-bar progress-bar-import" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" style="width: 00%;">');f.push(' <span class="completion_span">0% Complete</span>');f.push(" </div>");f.push("</div>");f.push("");return _.template(f.join(""))},templateAddFilesInModal:function(){var f=[];f.push('<div id="add_files_modal">');f.push('<div id="history_modal_combo_bulk">');f.push("Select history: ");f.push('<select id="dataset_add_bulk" name="dataset_add_bulk" style="width:66%; "> ');f.push(" <% _.each(histories, function(history) { %>");f.push(' <option value="<%= _.escape(history.get("id")) %>"><%= _.escape(history.get("name")) %></option>');f.push(" <% }); %>");f.push("</select>");f.push("</div>");f.push('<div id="selected_history_content">');f.push("</div>");f.push("</div>");return _.template(f.join(""))},templateHistoryContents:function(){var f=[];f.push("Choose the datasets to import:");f.push("<ul>");f.push(" <% _.each(history_contents, function(history_item) { %>");f.push(' <li data-id="<%= _.escape(history_item.get("id")) %>">');f.push(' <input style="margin: 0;" type="checkbox"><%= _.escape(history_item.get("hid")) %>: <%= _.escape(history_item.get("name")) %>');f.push(" </li>");f.push(" <% }); %>");f.push("</ul>");return _.template(f.join(""))}});return{FolderToolbarView:a}});
\ No newline at end of file
diff -r 4fa2b864adca65df5ac73a3fa60e5a4d98b1461c -r 986d7190844d5f7b68804242699a8049af80a937 static/style/blue/base.css
--- a/static/style/blue/base.css
+++ b/static/style/blue/base.css
@@ -1309,7 +1309,7 @@
.modal_table th{border:none !important}
.modal_table td{border:none !important}
th.button_heading{width:2em}
-#library_folder_toolbar{margin-bottom:1em}
+#library_folder_toolbar{margin-bottom:1em}#library_folder_toolbar span{margin-right:0.2em}
#library_toolbar{margin-bottom:1em}#library_toolbar span{margin-right:0.2em}
img.expanderIcon{padding-right:4px}
input.datasetCheckbox,li,ul{padding:0;margin:0}
diff -r 4fa2b864adca65df5ac73a3fa60e5a4d98b1461c -r 986d7190844d5f7b68804242699a8049af80a937 static/style/blue/library.css
--- a/static/style/blue/library.css
+++ b/static/style/blue/library.css
@@ -20,7 +20,7 @@
.modal_table th{border:none !important}
.modal_table td{border:none !important}
th.button_heading{width:2em}
-#library_folder_toolbar{margin-bottom:1em}
+#library_folder_toolbar{margin-bottom:1em}#library_folder_toolbar span{margin-right:0.2em}
#library_toolbar{margin-bottom:1em}#library_toolbar span{margin-right:0.2em}
img.expanderIcon{padding-right:4px}
input.datasetCheckbox,li,ul{padding:0;margin:0}
diff -r 4fa2b864adca65df5ac73a3fa60e5a4d98b1461c -r 986d7190844d5f7b68804242699a8049af80a937 static/style/src/less/library.less
--- a/static/style/src/less/library.less
+++ b/static/style/src/less/library.less
@@ -99,6 +99,9 @@
#library_folder_toolbar {
margin-bottom: 1em;
+ span {
+ margin-right: 0.2em;
+ }
}
#library_toolbar {
margin-bottom: 1em;
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: davebgx: Fix library security functional tests.
by commits-noreply@bitbucket.org 25 Apr '14
by commits-noreply@bitbucket.org 25 Apr '14
25 Apr '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/4fa2b864adca/
Changeset: 4fa2b864adca
User: davebgx
Date: 2014-04-25 21:29:56
Summary: Fix library security functional tests.
Affected #: 4 files
diff -r 267d03b5c9cdcad228fd40e12340f01c45f12c60 -r 4fa2b864adca65df5ac73a3fa60e5a4d98b1461c test-data/library/3.bed
--- /dev/null
+++ b/test-data/library/3.bed
@@ -0,0 +1,25 @@
+chr1 147962006 147975713 NM_005997 0 - 147962192 147975670 0 6 574,145,177,115,153,160, 0,1543,7859,9048,9340,13547,
+chr1 147984101 148035079 BC007833 0 + 147984545 148033414 0 14 529,32,81,131,118,153,300,206,84,49,85,130,46,1668, 0,25695,28767,33118,33695,33998,35644,38005,39629,40577,41402,43885,48367,49310,
+chr1 148077485 148111797 NM_002651 0 - 148078400 148111728 0 12 1097,121,133,266,124,105,110,228,228,45,937,77, 0,2081,2472,6871,9907,10257,11604,14199,15637,18274,23636,34235,
+chr1 148185113 148187485 NM_002796 0 + 148185136 148187378 0 7 163,207,147,82,117,89,120, 0,416,877,1199,1674,1977,2252,
+chr2 118288484 118306183 NM_006773 0 + 118288583 118304530 0 14 184,285,144,136,101,200,115,140,162,153,114,57,178,1796, 0,2765,4970,6482,6971,7183,7468,9890,10261,10768,11590,14270,14610,15903,
+chr2 118389378 118390700 BC005078 0 - 118390395 118390500 0 1 1322, 0,
+chr2 220108603 220116964 NM_001927 0 + 220108689 220116217 0 9 664,61,96,162,126,221,44,83,789, 0,1718,1874,2118,2451,2963,5400,7286,7572,
+chr2 220229182 220233943 NM_024536 0 - 220229609 220233765 0 4 1687,180,574,492, 0,1990,2660,4269,
+chr5 131170738 131357870 AF099740 0 - 131311206 131357817 0 31 112,124,120,81,65,40,120,129,61,88,94,79,72,102,144,117,89,73,96,135,135,78,74,52,33,179,100,102,65,115,248, 0,11593,44117,47607,104668,109739,114675,126366,135488,137518,138009,140437,152389,153373,155388,159269,160793,162981,164403,165577,166119,167611,169501,178260,179675,180901,181658,182260,182953,183706,186884,
+chr5 131424245 131426795 NM_000588 0 + 131424298 131426383 0 5 215,42,90,42,535, 0,313,1658,1872,2015,
+chr5 131556201 131590458 NM_004199 0 - 131556601 131582218 0 15 471,97,69,66,54,100,71,177,194,240,138,152,97,100,170, 0,2316,2802,5596,6269,11138,11472,15098,16528,17674,21306,24587,25142,25935,34087,
+chr5 131621285 131637046 NM_003687 0 + 131621326 131635821 0 7 134,152,82,179,164,118,1430, 0,4915,8770,13221,13609,14097,14331,
+chr6 108298214 108386086 NM_007214 0 - 108299600 108385906 0 21 1530,105,99,102,159,174,60,83,148,155,93,133,95,109,51,59,62,113,115,100,304, 0,2490,6246,10831,12670,23164,23520,27331,31052,32526,34311,36130,36365,38609,41028,42398,43048,51479,54500,59097,87568,
+chr6 108593954 108616704 NM_003269 0 + 108594662 108615360 0 9 733,146,88,236,147,97,150,106,1507, 0,5400,8778,10445,12037,14265,14749,15488,21243,
+chr6 108639410 108689143 NM_152827 0 - 108640045 108688818 0 3 741,125,487, 0,2984,49246,
+chr6 108722790 108950942 NM_145315 0 + 108722976 108950321 0 13 325,224,52,102,131,100,59,83,71,101,141,114,750, 0,28931,52094,60760,61796,71339,107102,152319,181970,182297,215317,224802,227402,
+chr7 113320332 113924911 AK131266 0 + 113862563 113893433 0 20 285,91,178,90,58,75,138,51,201,178,214,105,88,84,77,102,122,70,164,1124, 0,201692,340175,448290,451999,484480,542213,543265,543478,545201,556083,558358,565876,567599,573029,573245,575738,577123,577946,603455,
+chr7 116511232 116557294 NM_003391 0 - 116512159 116556994 0 5 1157,265,278,227,383, 0,20384,37843,43339,45679,
+chr7 116713967 116902666 NM_000492 0 + 116714099 116901113 0 27 185,111,109,216,90,164,126,247,93,183,192,95,87,724,129,38,251,80,151,228,101,249,156,90,173,106,1754, 0,24290,29071,50936,54313,55285,56585,60137,62053,68678,79501,107776,110390,111971,114967,122863,123569,126711,130556,131618,134650,147559,162475,172879,184725,185496,186945,
+chr7 116944658 117107512 AF377960 0 - 116945541 116979926 0 23 1129,102,133,64,186,206,179,188,153,100,87,80,96,276,118,255,151,100,204,1654,225,108,173, 0,7364,8850,10413,13893,14398,17435,24259,24615,35177,35359,45901,47221,49781,56405,66857,69787,72208,73597,80474,100111,150555,162681,
+chr8 118880786 119193239 NM_000127 0 - 118881131 119192466 0 11 531,172,161,90,96,119,133,120,108,94,1735, 0,5355,7850,13505,19068,20309,23098,30863,36077,37741,310718,
+chr9 128763240 128783870 NM_174933 0 + 128764156 128783586 0 12 261,118,74,159,76,48,56,63,129,117,127,370, 0,522,875,5630,12374,12603,15040,15175,18961,19191,20037,20260,
+chr9 128787362 128789566 NM_014908 0 - 128787519 128789136 0 1 2204, 0,
+chr9 128789530 128848928 NM_015354 0 + 128789552 128848511 0 44 54,55,74,85,81,45,93,120,212,115,201,90,66,120,127,153,127,88,77,115,121,67,129,140,107,207,170,70,68,196,78,86,146,182,201,93,159,138,75,228,132,74,130,594, 0,1491,5075,8652,9254,10312,11104,11317,20808,21702,23060,25462,31564,32908,33566,34851,35204,35595,35776,37202,38860,39111,39891,40349,42422,45499,45827,46675,47158,47621,50453,50840,51474,51926,53831,54186,55119,55619,57449,57605,57947,58352,58541,58804,
+chr9 128849867 128870133 NM_020145 0 - 128850516 128869987 0 11 757,241,101,90,24,63,93,134,129,142,209, 0,1071,1736,2085,2635,4201,6376,6736,13056,14247,20057,
diff -r 267d03b5c9cdcad228fd40e12340f01c45f12c60 -r 4fa2b864adca65df5ac73a3fa60e5a4d98b1461c test-data/library/4.bed
--- /dev/null
+++ b/test-data/library/4.bed
@@ -0,0 +1,1 @@
+chr22 30128507 31828507 uc003bnx.1_cds_2_0_chr22_29227_f 0 +
diff -r 267d03b5c9cdcad228fd40e12340f01c45f12c60 -r 4fa2b864adca65df5ac73a3fa60e5a4d98b1461c test-data/library/5.bed
--- /dev/null
+++ b/test-data/library/5.bed
@@ -0,0 +1,134 @@
+chr7 115444712 115444739 CCDS5763.1_cds_0_0_chr7_115444713_f 0 +
+chr7 115468538 115468624 CCDS5763.1_cds_1_0_chr7_115468539_f 0 +
+chr7 115483024 115483277 CCDS5763.1_cds_2_0_chr7_115483025_f 0 +
+chr7 115484165 115484501 CCDS5763.1_cds_3_0_chr7_115484166_f 0 +
+chr7 115485764 115485980 CCDS5763.1_cds_4_0_chr7_115485765_f 0 +
+chr7 115486322 115486481 CCDS5763.1_cds_5_0_chr7_115486323_f 0 +
+chr7 115491298 115491487 CCDS5763.1_cds_6_0_chr7_115491299_f 0 +
+chr7 115468538 115468624 CCDS5764.1_cds_0_0_chr7_115468539_f 0 +
+chr7 115483024 115483277 CCDS5764.1_cds_1_0_chr7_115483025_f 0 +
+chr7 115484165 115484501 CCDS5764.1_cds_2_0_chr7_115484166_f 0 +
+chr7 115485764 115485980 CCDS5764.1_cds_3_0_chr7_115485765_f 0 +
+chr7 115486322 115486481 CCDS5764.1_cds_4_0_chr7_115486323_f 0 +
+chr7 115491298 115491487 CCDS5764.1_cds_5_0_chr7_115491299_f 0 +
+chr7 115733786 115733936 CCDS5766.1_cds_0_0_chr7_115733787_f 0 +
+chr7 115734264 115734452 CCDS5766.1_cds_1_0_chr7_115734265_f 0 +
+chr7 115739975 115740126 CCDS5766.1_cds_2_0_chr7_115739976_f 0 +
+chr7 115733786 115733936 CCDS5765.1_cds_0_0_chr7_115733787_f 0 +
+chr7 115739975 115740164 CCDS5765.1_cds_1_0_chr7_115739976_f 0 +
+chr7 115759067 115759097 CCDS5767.1_cds_0_0_chr7_115759068_f 0 +
+chr7 115760529 115760694 CCDS5767.1_cds_1_0_chr7_115760530_f 0 +
+chr7 115792950 115793292 CCDS5767.1_cds_2_0_chr7_115792951_f 0 +
+chr7 116096616 116096655 CCDS5768.1_cds_0_0_chr7_116096617_f 0 +
+chr7 116122131 116122195 CCDS5768.1_cds_1_0_chr7_116122132_f 0 +
+chr7 116126998 116127050 CCDS5768.1_cds_2_0_chr7_116126999_f 0 +
+chr7 116132776 116132840 CCDS5768.1_cds_3_0_chr7_116132777_f 0 +
+chr7 116138181 116138388 CCDS5768.1_cds_4_0_chr7_116138182_f 0 +
+chr7 116140267 116140347 CCDS5768.1_cds_5_0_chr7_116140268_f 0 +
+chr7 116144237 116144316 CCDS5768.1_cds_6_0_chr7_116144238_f 0 +
+chr7 116146073 116146145 CCDS5768.1_cds_7_0_chr7_116146074_f 0 +
+chr7 116150064 116150127 CCDS5768.1_cds_8_0_chr7_116150065_f 0 +
+chr7 116151731 116151872 CCDS5768.1_cds_9_0_chr7_116151732_f 0 +
+chr7 116187545 116187696 CCDS5770.1_cds_0_0_chr7_116187546_f 0 +
+chr7 116333766 116333849 CCDS5770.1_cds_1_0_chr7_116333767_f 0 +
+chr7 116353565 116353725 CCDS5770.1_cds_2_0_chr7_116353566_f 0 +
+chr7 116363797 116363852 CCDS5770.1_cds_3_0_chr7_116363798_f 0 +
+chr7 116364495 116364611 CCDS5770.1_cds_4_0_chr7_116364496_f 0 +
+chr7 116365889 116365965 CCDS5770.1_cds_5_0_chr7_116365890_f 0 +
+chr7 116368128 116368197 CCDS5770.1_cds_6_0_chr7_116368129_f 0 +
+chr7 116370085 116370240 CCDS5770.1_cds_7_0_chr7_116370086_f 0 +
+chr7 116372439 116372537 CCDS5770.1_cds_8_0_chr7_116372440_f 0 +
+chr7 116404866 116404981 CCDS5770.1_cds_9_0_chr7_116404867_f 0 +
+chr7 116423325 116423398 CCDS5770.1_cds_10_0_chr7_116423326_f 0 +
+chr7 116424838 116424941 CCDS5770.1_cds_11_0_chr7_116424839_f 0 +
+chr7 116443791 116443942 CCDS5770.1_cds_12_0_chr7_116443792_f 0 +
+chr7 116453088 116453181 CCDS5770.1_cds_13_0_chr7_116453089_f 0 +
+chr7 116455927 116456067 CCDS5770.1_cds_14_0_chr7_116455928_f 0 +
+chr7 116456865 116456985 CCDS5770.1_cds_15_0_chr7_116456866_f 0 +
+chr7 116187545 116187696 CCDS5769.1_cds_0_0_chr7_116187546_f 0 +
+chr7 116333766 116333849 CCDS5769.1_cds_1_0_chr7_116333767_f 0 +
+chr7 116353565 116353725 CCDS5769.1_cds_2_0_chr7_116353566_f 0 +
+chr7 116363797 116363852 CCDS5769.1_cds_3_0_chr7_116363798_f 0 +
+chr7 116364495 116364611 CCDS5769.1_cds_4_0_chr7_116364496_f 0 +
+chr7 116365889 116365965 CCDS5769.1_cds_5_0_chr7_116365890_f 0 +
+chr7 116370085 116370240 CCDS5769.1_cds_6_0_chr7_116370086_f 0 +
+chr7 116372439 116372537 CCDS5769.1_cds_7_0_chr7_116372440_f 0 +
+chr7 116404866 116404981 CCDS5769.1_cds_8_0_chr7_116404867_f 0 +
+chr7 116423325 116423398 CCDS5769.1_cds_9_0_chr7_116423326_f 0 +
+chr7 116424838 116424941 CCDS5769.1_cds_10_0_chr7_116424839_f 0 +
+chr7 116443791 116443942 CCDS5769.1_cds_11_0_chr7_116443792_f 0 +
+chr7 116453088 116453181 CCDS5769.1_cds_12_0_chr7_116453089_f 0 +
+chr7 116455927 116456067 CCDS5769.1_cds_13_0_chr7_116455928_f 0 +
+chr7 116463766 116463862 CCDS5769.1_cds_14_0_chr7_116463767_f 0 +
+chr7 116512159 116512389 CCDS5771.1_cds_0_0_chr7_116512160_r 0 -
+chr7 116531616 116531881 CCDS5771.1_cds_1_0_chr7_116531617_r 0 -
+chr7 116549075 116549353 CCDS5771.1_cds_2_0_chr7_116549076_r 0 -
+chr7 116554571 116554798 CCDS5771.1_cds_3_0_chr7_116554572_r 0 -
+chr7 116556911 116556994 CCDS5771.1_cds_4_0_chr7_116556912_r 0 -
+chr7 116597600 116597753 CCDS5772.1_cds_0_0_chr7_116597601_r 0 -
+chr7 116601356 116601470 CCDS5772.1_cds_1_0_chr7_116601357_r 0 -
+chr7 116602616 116602722 CCDS5772.1_cds_2_0_chr7_116602617_r 0 -
+chr7 116613942 116614052 CCDS5772.1_cds_3_0_chr7_116613943_r 0 -
+chr7 116615015 116615072 CCDS5772.1_cds_4_0_chr7_116615016_r 0 -
+chr7 116616073 116616149 CCDS5772.1_cds_5_0_chr7_116616074_r 0 -
+chr7 116616990 116617115 CCDS5772.1_cds_6_0_chr7_116616991_r 0 -
+chr7 116618730 116618865 CCDS5772.1_cds_7_0_chr7_116618731_r 0 -
+chr7 116619702 116619814 CCDS5772.1_cds_8_0_chr7_116619703_r 0 -
+chr7 116654167 116654279 CCDS5772.1_cds_9_0_chr7_116654168_r 0 -
+chr7 116656241 116656364 CCDS5772.1_cds_10_0_chr7_116656242_r 0 -
+chr7 116660840 116660940 CCDS5772.1_cds_11_0_chr7_116660841_r 0 -
+chr7 116661360 116661465 CCDS5772.1_cds_12_0_chr7_116661361_r 0 -
+chr7 116714099 116714152 CCDS5773.1_cds_0_0_chr7_116714100_f 0 +
+chr7 116738257 116738368 CCDS5773.1_cds_1_0_chr7_116738258_f 0 +
+chr7 116743038 116743147 CCDS5773.1_cds_2_0_chr7_116743039_f 0 +
+chr7 116764903 116765119 CCDS5773.1_cds_3_0_chr7_116764904_f 0 +
+chr7 116768280 116768370 CCDS5773.1_cds_4_0_chr7_116768281_f 0 +
+chr7 116769252 116769416 CCDS5773.1_cds_5_0_chr7_116769253_f 0 +
+chr7 116770552 116770678 CCDS5773.1_cds_6_0_chr7_116770553_f 0 +
+chr7 116774104 116774351 CCDS5773.1_cds_7_0_chr7_116774105_f 0 +
+chr7 116776020 116776113 CCDS5773.1_cds_8_0_chr7_116776021_f 0 +
+chr7 116782645 116782828 CCDS5773.1_cds_9_0_chr7_116782646_f 0 +
+chr7 116793468 116793660 CCDS5773.1_cds_10_0_chr7_116793469_f 0 +
+chr7 116821743 116821838 CCDS5773.1_cds_11_0_chr7_116821744_f 0 +
+chr7 116824357 116824444 CCDS5773.1_cds_12_0_chr7_116824358_f 0 +
+chr7 116825938 116826662 CCDS5773.1_cds_13_0_chr7_116825939_f 0 +
+chr7 116828934 116829063 CCDS5773.1_cds_14_0_chr7_116828935_f 0 +
+chr7 116836830 116836868 CCDS5773.1_cds_15_0_chr7_116836831_f 0 +
+chr7 116837536 116837787 CCDS5773.1_cds_16_0_chr7_116837537_f 0 +
+chr7 116840678 116840758 CCDS5773.1_cds_17_0_chr7_116840679_f 0 +
+chr7 116844523 116844674 CCDS5773.1_cds_18_0_chr7_116844524_f 0 +
+chr7 116845585 116845813 CCDS5773.1_cds_19_0_chr7_116845586_f 0 +
+chr7 116848617 116848718 CCDS5773.1_cds_20_0_chr7_116848618_f 0 +
+chr7 116861526 116861775 CCDS5773.1_cds_21_0_chr7_116861527_f 0 +
+chr7 116876442 116876598 CCDS5773.1_cds_22_0_chr7_116876443_f 0 +
+chr7 116886846 116886936 CCDS5773.1_cds_23_0_chr7_116886847_f 0 +
+chr7 116898692 116898865 CCDS5773.1_cds_24_0_chr7_116898693_f 0 +
+chr7 116899463 116899569 CCDS5773.1_cds_25_0_chr7_116899464_f 0 +
+chr7 116900912 116901113 CCDS5773.1_cds_26_0_chr7_116900913_f 0 +
+chr7 116945541 116945787 CCDS5774.1_cds_0_0_chr7_116945542_r 0 -
+chr7 116952022 116952124 CCDS5774.1_cds_1_0_chr7_116952023_r 0 -
+chr7 116953508 116953641 CCDS5774.1_cds_2_0_chr7_116953509_r 0 -
+chr7 116955071 116955135 CCDS5774.1_cds_3_0_chr7_116955072_r 0 -
+chr7 116958551 116958737 CCDS5774.1_cds_4_0_chr7_116958552_r 0 -
+chr7 116959056 116959262 CCDS5774.1_cds_5_0_chr7_116959057_r 0 -
+chr7 116962093 116962272 CCDS5774.1_cds_6_0_chr7_116962094_r 0 -
+chr7 116968917 116969105 CCDS5774.1_cds_7_0_chr7_116968918_r 0 -
+chr7 116969273 116969426 CCDS5774.1_cds_8_0_chr7_116969274_r 0 -
+chr7 116979835 116979935 CCDS5774.1_cds_9_0_chr7_116979836_r 0 -
+chr7 116980017 116980104 CCDS5774.1_cds_10_0_chr7_116980018_r 0 -
+chr7 116990559 116990639 CCDS5774.1_cds_11_0_chr7_116990560_r 0 -
+chr7 116991879 116991975 CCDS5774.1_cds_12_0_chr7_116991880_r 0 -
+chr7 116994439 116994715 CCDS5774.1_cds_13_0_chr7_116994440_r 0 -
+chr7 117001063 117001181 CCDS5774.1_cds_14_0_chr7_117001064_r 0 -
+chr7 117011515 117011770 CCDS5774.1_cds_15_0_chr7_117011516_r 0 -
+chr7 117014445 117014596 CCDS5774.1_cds_16_0_chr7_117014446_r 0 -
+chr7 117016866 117016966 CCDS5774.1_cds_17_0_chr7_117016867_r 0 -
+chr7 117018255 117018459 CCDS5774.1_cds_18_0_chr7_117018256_r 0 -
+chr7 117025132 117026786 CCDS5774.1_cds_19_0_chr7_117025133_r 0 -
+chr7 117044769 117044994 CCDS5774.1_cds_20_0_chr7_117044770_r 0 -
+chr7 117095213 117095321 CCDS5774.1_cds_21_0_chr7_117095214_r 0 -
+chr7 117107339 117107420 CCDS5774.1_cds_22_0_chr7_117107340_r 0 -
+chr5 131424298 131424460 CCDS4149.1_cds_0_0_chr5_131424299_f 0 +
+chr5 131424558 131424600 CCDS4149.1_cds_1_0_chr5_131424559_f 0 +
+chr5 131425903 131425993 CCDS4149.1_cds_2_0_chr5_131425904_f 0 +
+chr5 131426117 131426159 CCDS4149.1_cds_3_0_chr5_131426118_f 0 +
diff -r 267d03b5c9cdcad228fd40e12340f01c45f12c60 -r 4fa2b864adca65df5ac73a3fa60e5a4d98b1461c test/base/twilltestcase.py
--- a/test/base/twilltestcase.py
+++ b/test/base/twilltestcase.py
@@ -2254,7 +2254,7 @@
# NOTE: due to the library_wait() method call at the end of this method, no tests should be done
# for strings_displayed_after_submit.
params = dict( cntrller=cntrller, library_id=library_id, folder_id=folder_id )
- url = "%s/library_common/upload_library_dataset" % self.url
+ url = "/library_common/upload_library_dataset"
if replace_id:
# If we're uploading a new version of a library dataset, we have to include the replace_id param in the
# request because the form field named replace_id will not be displayed on the upload form if we dont.
@@ -2309,17 +2309,15 @@
def ldda_permissions( self, cntrller, library_id, folder_id, id, role_ids_str,
permissions_in=[], permissions_out=[], strings_displayed=[], ldda_name='' ):
# role_ids_str must be a comma-separated string of role ids
- url = "%s/library_common/ldda_permissions?cntrller=%s&library_id=%s&folder_id=%s&id=%s" % \
- ( self.url, cntrller, library_id, folder_id, id )
+ params = dict( cntrller=cntrller, library_id=library_id, folder_id=folder_id, id=id )
+ url = "/library_common/ldda_permissions"
for po in permissions_out:
- key = '%s_out' % po
- url = "%s&%s=%s" % ( url, key, role_ids_str )
+ params[ '%s_out' % po ] = role_ids_str
for pi in permissions_in:
- key = '%s_in' % pi
- url = "%s&%s=%s" % ( url, key, role_ids_str )
+ params[ '%s_in' % pi ] = role_ids_str
if permissions_in or permissions_out:
- url += "&update_roles_button=Save"
- self.visit_url( url )
+ params[ 'update_roles_button' ] = 'Save'
+ self.visit_url( url, params )
if not strings_displayed:
strings_displayed = [ "Permissions updated for dataset '%s'." % ldda_name ]
for check_str in strings_displayed:
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: davebgx: Fix tool shed functional test for repository dependency handling.
by commits-noreply@bitbucket.org 25 Apr '14
by commits-noreply@bitbucket.org 25 Apr '14
25 Apr '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/267d03b5c9cd/
Changeset: 267d03b5c9cd
User: davebgx
Date: 2014-04-25 20:28:17
Summary: Fix tool shed functional test for repository dependency handling.
Affected #: 1 file
diff -r 666a75d94ee91091d94b65ffbfe700224ad58f15 -r 267d03b5c9cdcad228fd40e12340f01c45f12c60 test/base/twilltestcase.py
--- a/test/base/twilltestcase.py
+++ b/test/base/twilltestcase.py
@@ -18,6 +18,7 @@
from galaxy.web import security
from galaxy.web.framework.helpers import iff
from galaxy.util.json import from_json_string
+from galaxy.util import asbool
from base.asserts import verify_assertions
from galaxy import eggs
@@ -1325,11 +1326,25 @@
params[ key ] = value
if params:
url += '?%s' % urllib.urlencode( params )
+ checked_boxes = dict()
+ unchecked_boxes = dict()
if checkbox_params is not None:
+ for checkbox_field in checkbox_params:
+ if checkbox_field in checked_boxes or checkbox_field in unchecked_boxes:
+ continue
+ if asbool( checkbox_params[ checkbox_field ] ):
+ checked_boxes[ checkbox_field ] = True
+ else:
+ unchecked_boxes[ checkbox_field ] = False
+ # Any checkbox field that is found twice in the controller's incoming parameters is considered checked,
+ # while any field that only appears once is considered unchecked.
+ checkbox_params = '&'.join( [ urllib.urlencode( checked_boxes ),
+ urllib.urlencode( checked_boxes ),
+ urllib.urlencode( unchecked_boxes ) ] )
if params or parsed_url.query:
- url += '&%s&%s' % ( urllib.urlencode( checkbox_params ), urllib.urlencode( checkbox_params ) )
+ url += '&%s' % checkbox_params
else:
- url += '?%s&%s' % ( urllib.urlencode( checkbox_params ), urllib.urlencode( checkbox_params ) )
+ url += '?%s' % checkbox_params
new_url = tc.go( url )
return_code = tc.browser.get_code()
assert return_code in allowed_codes, 'Invalid HTTP return code %s, allowed codes: %s' % \
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: davebgx: Fix for persisting data table entries generated by installed data managers.
by commits-noreply@bitbucket.org 25 Apr '14
by commits-noreply@bitbucket.org 25 Apr '14
25 Apr '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/666a75d94ee9/
Changeset: 666a75d94ee9
User: davebgx
Date: 2014-04-25 19:21:32
Summary: Fix for persisting data table entries generated by installed data managers.
Affected #: 1 file
diff -r dda514ffa5e99b1b13bc3d88dbf35c1fb336742d -r 666a75d94ee91091d94b65ffbfe700224ad58f15 lib/galaxy/tools/data_manager/manager.py
--- a/lib/galaxy/tools/data_manager/manager.py
+++ b/lib/galaxy/tools/data_manager/manager.py
@@ -134,15 +134,15 @@
tool_shed_url = tool_elem.find( 'tool_shed' ).text
# Handle protocol changes.
tool_shed_url = common_util.get_tool_shed_url_from_tool_shed_registry( self.data_managers.app, tool_shed_url )
+ # The protocol is not stored in the database.
+ tool_shed = common_util.remove_protocol_from_tool_shed_url( tool_shed_url )
repository_name = tool_elem.find( 'repository_name' ).text
repository_owner = tool_elem.find( 'repository_owner' ).text
installed_changeset_revision = tool_elem.find( 'installed_changeset_revision' ).text
- self.tool_shed_repository_info_dict = dict( tool_shed_url=tool_shed_url,
+ self.tool_shed_repository_info_dict = dict( tool_shed=tool_shed,
name=repository_name,
owner=repository_owner,
installed_changeset_revision=installed_changeset_revision )
- # The protocol is not stored in the database.
- tool_shed = common_util.remove_protocol_from_tool_shed_url( tool_shed_url )
tool_shed_repository = \
suc.get_tool_shed_repository_by_shed_name_owner_installed_changeset_revision( self.data_managers.app,
tool_shed,
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: greg: Add support for 3 new tool dependency installation recipe action tag types: assert_directory_exists, assert_file_exists and assert_file_executable.
by commits-noreply@bitbucket.org 25 Apr '14
by commits-noreply@bitbucket.org 25 Apr '14
25 Apr '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/dda514ffa5e9/
Changeset: dda514ffa5e9
User: greg
Date: 2014-04-25 16:58:15
Summary: Add support for 3 new tool dependency installation recipe action tag types: assert_directory_exists, assert_file_exists and assert_file_executable.
Affected #: 4 files
diff -r 2edce562ccaa8bdd12e40b2263646f7b9cf93966 -r dda514ffa5e99b1b13bc3d88dbf35c1fb336742d 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,6 +4,8 @@
from galaxy import eggs
eggs.require( 'Fabric' )
+eggs.require( 'ssh' )
+eggs.require( 'paramiko' )
from fabric.api import env
from fabric.api import lcd
diff -r 2edce562ccaa8bdd12e40b2263646f7b9cf93966 -r dda514ffa5e99b1b13bc3d88dbf35c1fb336742d lib/tool_shed/galaxy_install/tool_dependencies/recipe/recipe_manager.py
--- a/lib/tool_shed/galaxy_install/tool_dependencies/recipe/recipe_manager.py
+++ b/lib/tool_shed/galaxy_install/tool_dependencies/recipe/recipe_manager.py
@@ -13,6 +13,8 @@
# TODO: eliminate the use of fabric here.
from galaxy import eggs
eggs.require( 'Fabric' )
+eggs.require( 'ssh' )
+eggs.require( 'paramiko' )
from fabric.operations import _AttributeString
from fabric import state
@@ -412,7 +414,10 @@
return tool_dependency, filtered_actions, dir
def load_step_handlers( self ):
- step_handlers_by_type = dict( autoconf=step_handler.Autoconf(),
+ step_handlers_by_type = dict( assert_directory_exists=step_handler.AssertDirectoryExists(),
+ assert_file_executable=step_handler.AssertFileExecutable(),
+ assert_file_exists=step_handler.AssertFileExists(),
+ autoconf=step_handler.Autoconf(),
change_directory=step_handler.ChangeDirectory(),
chmod=step_handler.Chmod(),
download_binary=step_handler.DownloadBinary(),
diff -r 2edce562ccaa8bdd12e40b2263646f7b9cf93966 -r dda514ffa5e99b1b13bc3d88dbf35c1fb336742d lib/tool_shed/galaxy_install/tool_dependencies/recipe/step_handler.py
--- a/lib/tool_shed/galaxy_install/tool_dependencies/recipe/step_handler.py
+++ b/lib/tool_shed/galaxy_install/tool_dependencies/recipe/step_handler.py
@@ -14,6 +14,9 @@
# TODO: eliminate the use of fabric here.
from galaxy import eggs
eggs.require( 'Fabric' )
+eggs.require( 'ssh' )
+eggs.require( 'paramiko' )
+
from fabric.api import settings
from fabric.api import lcd
@@ -33,6 +36,105 @@
raise "Unimplemented Method"
+class AssertDirectoryExists( RecipeStep ):
+
+ def __init__( self ):
+ self.type = 'assert_directory_exists'
+
+ def execute_step( self, app, tool_dependency, package_name, actions, action_dict, filtered_actions, env_file_builder,
+ install_environment, work_dir, install_dir, current_dir=None, initial_download=False ):
+ """
+ Make sure a directory on disk exists. Since this class is not used in the initial download stage,
+ no recipe step filtering is performed here, and None values are always returned for filtered_actions
+ and dir.
+ """
+ if os.path.isabs( action_dict[ 'full_path' ] ):
+ full_path = action_dict[ 'full_path' ]
+ else:
+ full_path = os.path.join( current_dir, action_dict[ 'full_path' ] )
+ if not td_common_util.assert_directory_exists( full_path=full_path ):
+ status = app.install_model.ToolDependency.installation_status.ERROR
+ error_message = 'The required directory %s does not exist.' % str( full_path )
+ tool_dependency = tool_dependency_util.set_tool_dependency_attributes( app,
+ tool_dependency,
+ status=status,
+ error_message=error_message,
+ remove_from_disk=False )
+ return tool_dependency, None, None
+
+ def prepare_step( self, app, tool_dependency, action_elem, action_dict, install_dir, is_binary_download ):
+ # <action type="make_directory">$INSTALL_DIR/mira</action>
+ if action_elem.text:
+ action_dict[ 'full_path' ] = td_common_util.evaluate_template( action_elem.text, install_dir )
+ return action_dict
+
+
+class AssertFileExecutable( RecipeStep ):
+
+ def __init__( self ):
+ self.type = 'assert_file_executable'
+
+ def execute_step( self, app, tool_dependency, package_name, actions, action_dict, filtered_actions, env_file_builder,
+ install_environment, work_dir, install_dir, current_dir=None, initial_download=False ):
+ """
+ Make sure a file on disk exists and is executable. Since this class is not used in the initial
+ download stage, no recipe step filtering is performed here, and None values are always returned
+ for filtered_actions and dir.
+ """
+ if os.path.isabs( action_dict[ 'full_path' ] ):
+ full_path = action_dict[ 'full_path' ]
+ else:
+ full_path = os.path.join( current_dir, action_dict[ 'full_path' ] )
+ if not td_common_util.assert_file_executable( full_path=full_path ):
+ status = app.install_model.ToolDependency.installation_status.ERROR
+ error_message = 'The file %s is not executable by the owner.' % str( full_path )
+ tool_dependency = tool_dependency_util.set_tool_dependency_attributes( app,
+ tool_dependency,
+ status=status,
+ error_message=error_message,
+ remove_from_disk=False )
+ return tool_dependency, None, None
+
+ def prepare_step( self, app, tool_dependency, action_elem, action_dict, install_dir, is_binary_download ):
+ # <action type="assert_executable">$INSTALL_DIR/mira/my_file</action>
+ if action_elem.text:
+ action_dict[ 'full_path' ] = td_common_util.evaluate_template( action_elem.text, install_dir )
+ return action_dict
+
+
+class AssertFileExists( RecipeStep ):
+
+ def __init__( self ):
+ self.type = 'assert_file_exists'
+
+ def execute_step( self, app, tool_dependency, package_name, actions, action_dict, filtered_actions, env_file_builder,
+ install_environment, work_dir, install_dir, current_dir=None, initial_download=False ):
+ """
+ Make sure a file on disk exists. Since this class is not used in the initial download stage,
+ no recipe step filtering is performed here, and None values are always returned for
+ filtered_actions and dir.
+ """
+ if os.path.isabs( action_dict[ 'full_path' ] ):
+ full_path = action_dict[ 'full_path' ]
+ else:
+ full_path = os.path.join( current_dir, action_dict[ 'full_path' ] )
+ if not td_common_util.assert_file_exists( full_path=full_path ):
+ status = app.install_model.ToolDependency.installation_status.ERROR
+ error_message = 'The required file %s does not exist.' % str( full_path )
+ tool_dependency = tool_dependency_util.set_tool_dependency_attributes( app,
+ tool_dependency,
+ status=status,
+ error_message=error_message,
+ remove_from_disk=False )
+ return tool_dependency, None, None
+
+ def prepare_step( self, app, tool_dependency, action_elem, action_dict, install_dir, is_binary_download ):
+ # <action type="assert_on_path">$INSTALL_DIR/mira/my_file</action>
+ if action_elem.text:
+ action_dict[ 'full_path' ] = td_common_util.evaluate_template( action_elem.text, install_dir )
+ return action_dict
+
+
class Autoconf( RecipeStep ):
def __init__( self ):
diff -r 2edce562ccaa8bdd12e40b2263646f7b9cf93966 -r dda514ffa5e99b1b13bc3d88dbf35c1fb336742d lib/tool_shed/galaxy_install/tool_dependencies/td_common_util.py
--- a/lib/tool_shed/galaxy_install/tool_dependencies/td_common_util.py
+++ b/lib/tool_shed/galaxy_install/tool_dependencies/td_common_util.py
@@ -2,6 +2,7 @@
import os
import re
import shutil
+import stat
import sys
import tarfile
import time
@@ -110,6 +111,31 @@
def open_zip( self, filepath, mode ):
return zipfile.ZipFile( filepath, mode )
+def assert_directory_exists( full_path ):
+ """Return True if a directory exists and is not a symbolic link."""
+ if os.path.islink( full_path ):
+ return False
+ if os.path.is_dir( full_path ):
+ return True
+ return False
+
+def assert_file_exists( full_path ):
+ """Return True if a file exists. This will work for both symbolic linke and files."""
+ if os.path.exists( full_path ):
+ return True
+ return False
+
+def assert_file_executable( full_path ):
+ """Return True if a file exists and is executable."""
+ if os.path.islink( full_path ):
+ return False
+ if os.path.is_file( full_path ):
+ # Make sure the owner has execute permission on the file.
+ # See http://docs.python.org/2/library/stat.html
+ if stat.S_IXUSR & os.stat( full_path )[ stat.ST_MODE ] == 64:
+ return True
+ return False
+
def create_env_var_dict( elem, tool_dependency_install_dir=None, tool_shed_repository_install_dir=None ):
env_var_name = elem.get( 'name', 'PATH' )
env_var_action = elem.get( 'action', 'prepend_to' )
@@ -155,6 +181,10 @@
regex = regex.replace( r"\'", "'" )
return regex
+def evaluate_template( text, install_dir ):
+ """ Substitute variables defined in XML blocks from dependencies file."""
+ return Template( text ).safe_substitute( get_env_var_values( install_dir ) )
+
def format_traceback():
ex_type, ex, tb = sys.exc_info()
return ''.join( traceback.format_tb( tb ) )
@@ -444,6 +474,10 @@
continue
return actions_elem_tuples
+def __shellquote( s ):
+ """Quote and escape the supplied string for use in shell expressions."""
+ return "'" + s.replace( "'", "'\\''" ) + "'"
+
def url_download( install_dir, downloaded_file_name, download_url, extract=True ):
file_path = os.path.join( install_dir, downloaded_file_name )
src = None
@@ -494,11 +528,3 @@
if not member_path.startswith( basename ):
return False
return True
-
-def __shellquote(s):
- """Quote and escape the supplied string for use in shell expressions."""
- return "'" + s.replace( "'", "'\\''" ) + "'"
-
-def evaluate_template( text, install_dir ):
- """ Substitute variables defined in XML blocks from dependencies file."""
- return Template( text ).safe_substitute( get_env_var_values( install_dir ) )
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: Jeremy Goecks: BAM data provider: hash to create read guids. This is line with other data providers and decreases payload size slightly.
by commits-noreply@bitbucket.org 25 Apr '14
by commits-noreply@bitbucket.org 25 Apr '14
25 Apr '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/2edce562ccaa/
Changeset: 2edce562ccaa
User: Jeremy Goecks
Date: 2014-04-25 16:50:47
Summary: BAM data provider: hash to create read guids. This is line with other data providers and decreases payload size slightly.
Affected #: 1 file
diff -r 611117ed0a88654c736bc5722016b81874475c95 -r 2edce562ccaa8bdd12e40b2263646f7b9cf93966 lib/galaxy/visualization/data_providers/genome.py
--- a/lib/galaxy/visualization/data_providers/genome.py
+++ b/lib/galaxy/visualization/data_providers/genome.py
@@ -1018,7 +1018,7 @@
if qname in paired_pending:
# Found pair.
pair = paired_pending[qname]
- results.append( [ "%i_%s" % ( pair['start'], qname ),
+ results.append( [ hash( "%i_%s" % ( pair['start'], qname ) ),
pair['start'],
read.pos + read_len,
qname,
@@ -1033,7 +1033,7 @@
'rlen': read_len, 'strand': strand, 'cigar': read.cigar, 'mapq': read.mapq }
count += 1
else:
- results.append( [ "%i_%s" % ( read.pos, qname ),
+ results.append( [ hash( "%i_%s" % ( read.pos, qname ) ),
read.pos, read.pos + read_len, qname,
read.cigar, strand, read.seq, read.mapq ] )
count += 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