Merge pull request #1697 from martenson/merge-1601-dev

merge 16.01 into dev
This commit is contained in:
Martin Cech
2016-02-08 14:23:14 -05:00
15 changed files with 210 additions and 210 deletions
@@ -98,7 +98,7 @@ var FolderView = Backbone.View.extend({
_serializeRoles : function(role_list){
var selected_roles = [];
for (var i = 0; i < role_list.length; i++) {
selected_roles.push(role_list[i] + ':' + role_list[i]);
selected_roles.push(role_list[i][1] + ':' + role_list[i][0]);
}
return selected_roles;
},
@@ -156,7 +156,7 @@ var FolderView = Backbone.View.extend({
$(element.val().split(",")).each(function() {
var item = this.split(':');
data.push({
id: item[1],
id: item[0],
name: item[1]
});
});
+5 -5
View File
@@ -747,7 +747,7 @@ input[type="submit"], button {
// Messages
.errormessagelarge, .warningmessagelarge, .donemessagelarge, .infomessagelarge, .toolHelpBody .error, .toolHelpBody .warning, .toolHelpBody .note {
.errormessagelarge, .warningmessagelarge, .donemessagelarge, .infomessagelarge, .ui-form-help .error, .ui-form-help .warning, .ui-form-help .note {
.alert();
min-height: 36px;
padding-left: 52px;
@@ -785,7 +785,7 @@ input[type="submit"], button {
background-image: none;
}
.errormessage, .warningmessage, .donemessage, .infomessage, .errormessagesmall, .warningmessagesmall, .donemessagesmall, .infomessagesmall, toolHelpBody .error, .toolHelpBody .warning, .toolHelpBody .note {
.errormessage, .warningmessage, .donemessage, .infomessage, .errormessagesmall, .warningmessagesmall, .donemessagesmall, .infomessagesmall, .ui-form-help .error, .ui-form-help .warning, .ui-form-help .note {
.alert();
padding: 5px;
padding-left: 25px;
@@ -797,11 +797,11 @@ input[type="submit"], button {
background-position: 5px 5px;
}
.errormessage, .errormessagesmall, .toolHelpBody .error {
.errormessage, .errormessagesmall, .ui-form-help .error {
.alert-danger();
}
.warningmessage, .warningmessagesmall, .toolHelpBody .warning {
.warningmessage, .warningmessagesmall, .ui-form-help .warning {
.alert-warning();
background-image: url(warn_small.png);
}
@@ -811,7 +811,7 @@ input[type="submit"], button {
background-image: url(ok_small.png);
}
.infomessage, .infomessagesmall, .toolHelpBody .note {
.infomessage, .infomessagesmall, .ui-form-help .note {
.alert-info();
background-image: url(info_small.png);
}
+42 -13
View File
@@ -29,10 +29,13 @@ Upon startup (with ``run.sh``), the startup scripts will:
3. Replace that virtualenv's pip with `Galaxy pip`_.
4. Download and install wheels from the Galaxy project wheel server,
4. If applicable, create a ``binary-compatibility.cfg`` (see the `Galaxy pip
and wheel`_ section for an explanation of this file).
5. Download and install wheels from the Galaxy project wheel server,
`wheels.galaxyproject.org`_, using pip.
5. Start Galaxy using ``.venv/bin/python``.
6. Start Galaxy using ``.venv/bin/python``.
.. _virtualenv: https://virtualenv.readthedocs.org/
.. _wheels.galaxyproject.org: https://wheels.galaxyproject.org/
@@ -194,13 +197,14 @@ dependencies. Because of this, it's necessary to make sure the metadata
detection step runs in Galaxy's virtualenv. If you run a relatively simple
Galaxy setup (e.g. single process, or multiple Python Paste processes started
using ``run.sh``) then this is assured for you automatically. In more
complicated setups (using a cluster, supervisor, and/or the "headless" Galaxy
handler) it may be necessary to make sure the handlers know where the
virtualenv (or a virtualenv containing Galaxy's dependencies) can be found.
complicated setups (supervisor, the "headless" Galaxy handler, and/or the
virtualenv used to start Galaxy is not a shared filesystem) it may be necessary
to make sure the handlers know where the virtualenv (or a virtualenv containing
Galaxy's dependencies) can be found.
If your jobs are failing due to Python ``ImportError`` exceptions, this is most
likely the problem. If your jobs run on a cluster, you can use the ``<env>``
tag in ``job_conf.xml`` to source the virtualenv. For example:
likely the problem. If so, you can use the ``<env>`` tag in ``job_conf.xml`` to
source the virtualenv. For example:
.. code-block:: xml
@@ -523,7 +527,6 @@ explanation of the problem.
.. _PEP 513: https://www.python.org/dev/peps/pep-0513/
.. _pip pull request #3075: https://github.com/pypa/pip/pull/3075
.. _binary-compatibility.cfg: https://mail.python.org/pipermail/distutils-sig/2015-July/026617.html
Galaxy pip and wheel
--------------------
@@ -551,11 +554,6 @@ Two different types of wheels can be created:
wheels carry a ``linux_{arch}_{distro}_{version}`` platform tag (e.g.
``linux_x86_ubuntu_14_04``) and can be created using `Galaxy wheel`_.
Galaxy pip and Galaxy wheel also include support for the proposed
`binary-compatibility.cfg`_ file. This file allows distributions that are
binary compatibile (e.g. Red Hat Enterprise Linux 6 and CentOS 6) to use the
same wheels.
The `manylinux`_ project implements the "Simple" wheels in a more clearly
defined way and allows for the inclusion of "non-standard" external
dependencies directly into the wheel. Galaxy will officially support any
@@ -566,6 +564,37 @@ complete.
.. _manylinux: https://github.com/manylinux/manylinux/
.. _psycopg2: http://initd.org/psycopg/
Wheel platform compatibility
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Galaxy pip and Galaxy wheel also include support for the proposed
`binary-compatibility.cfg`_ file. This file allows distributions that are
binary compatibile (e.g. Red Hat Enterprise Linux 6 and CentOS 6) to use the
same wheels.
This is a JSON format file which can be installed in ``/etc/python`` or the
root of a virtualenv (`common_startup.sh`_ creates it here) and provides a
mapping between `PEP 425`_ platform tags. For example, the following
``binary-compatibility.cfg`` indicates that wheels built on the platform
``linux_x86_centos_6_7`` will have their platform tag overridden to
``linux_x86_rhel_6``. In addition, wheels tagged with ``linux_x86_64_rhel_6_7``
and ``linux_x86_64_rhel_6`` will be installable on a ``linux_x86_centos_6_7``
system:
.. code-block:: json
{
"linux_x86_64_centos_6_7": {
"build": "linux_x86_64_rhel_6",
"install": ["linux_x86_64_rhel_6_7", "linux_x86_64_rhel_6"]
}
}
Currently, Scientific Linux, CentOS, and Red Hat Enterprise Linux will be set
as binary compatible by `common_startup.sh`_.
.. _binary-compatibility.cfg: https://mail.python.org/pipermail/distutils-sig/2015-July/026617.html
Adding additional wheels as Galaxy dependencies
-----------------------------------------------
+2 -2
View File
@@ -91,9 +91,9 @@ class Ipynb( Json ):
config = trans.app.config
trust = getattr( config, 'trust_ipython_notebook_conversion', False )
if trust:
return self._display_data_trusted(trans, dataset, preview=preview, fileame=filename, to_ext=to_ext, chunk=chunk, **kwd)
return self._display_data_trusted(trans, dataset, preview=preview, filename=filename, to_ext=to_ext, chunk=chunk, **kwd)
else:
return super(Ipynb, self).display_data( trans, dataset, preview=preview, fileame=filename, to_ext=to_ext, chunk=chunk, **kwd )
return super(Ipynb, self).display_data( trans, dataset, preview=preview, filename=filename, to_ext=to_ext, chunk=chunk, **kwd )
def _display_data_trusted(self, trans, dataset, preview=False, filename=None, to_ext=None, chunk=None, **kwd):
preview = string_as_bool( preview )
@@ -240,23 +240,21 @@ class FolderContentsController( BaseAPIController, UsesLibraryMixin, UsesLibrary
@expose_api
def create( self, trans, encoded_folder_id, payload, **kwd ):
"""
create( self, trans, library_id, payload, **kwd )
* POST /api/folders/{encoded_id}/contents
create a new library file from an HDA
:param encoded_folder_id: the encoded id of the folder to import dataset(s) to
:type encoded_folder_id: an encoded id string
:param payload: dictionary structure containing:
:param from_hda_id: (optional) the id of an accessible HDA to copy into the library
:type from_hda_id: encoded id
:param ldda_message: (optional) the new message attribute of the LDDA created
:type ldda_message: str
:param extended_metadata: (optional) dub-dictionary containing any extended metadata to associate with the item
:type extended_metadata: dict
: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
: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,
+53 -77
View File
@@ -3,11 +3,9 @@ API operations on library folders.
"""
from galaxy import util
from galaxy import exceptions
from galaxy.managers import folders
from galaxy.managers import folders, roles
from galaxy.web import _future_expose_api as expose_api
from galaxy.web.base.controller import BaseAPIController, UsesLibraryMixin, UsesLibraryMixinItems
from sqlalchemy.orm.exc import MultipleResultsFound
from sqlalchemy.orm.exc import NoResultFound
import logging
log = logging.getLogger( __name__ )
@@ -18,6 +16,7 @@ class FoldersController( BaseAPIController, UsesLibraryMixin, UsesLibraryMixinIt
def __init__( self, app ):
super( FoldersController, self ).__init__( app )
self.folder_manager = folders.FolderManager()
self.role_manager = roles.RoleManager( app )
@expose_api
def index( self, trans, **kwd ):
@@ -48,35 +47,29 @@ class FoldersController( BaseAPIController, UsesLibraryMixin, UsesLibraryMixinIt
return return_dict
@expose_api
def create( self, trans, encoded_parent_folder_id, **kwd ):
def create( self, trans, encoded_parent_folder_id, payload=None, **kwd ):
"""
create( self, trans, encoded_parent_folder_id, **kwd )
*POST /api/folders/{encoded_parent_folder_id}
Create a new folder object underneath the one specified in the parameters.
Create a new folder object underneath the one specified in the parameters.
:param encoded_parent_folder_id: the parent folder's id (required)
:param encoded_parent_folder_id: (required) the parent folder's id
:type encoded_parent_folder_id: an encoded id string (should be prefixed by 'F')
:param name: the name of the new folder (required)
:type name: str
:param description: the description of the new folder
:type description: str
:param payload: dictionary structure containing:
:param name: (required) the name of the new folder
:type name: str
:param description: the description of the new folder
:type description: str
:type dictionary
:returns: information about newly created folder, notably including ID
:rtype: dictionary
:raises: RequestParameterMissingException
"""
payload = kwd.get( 'payload', None )
if payload is None:
raise exceptions.RequestParameterMissingException( "Missing required parameter 'name'." )
name = payload.get( 'name', None )
if payload:
kwd.update(payload)
name = kwd.get( 'name', None )
if name is None:
raise exceptions.RequestParameterMissingException( "Missing required parameter 'name'." )
description = payload.get( 'description', '' )
description = kwd.get( 'description', '' )
decoded_parent_folder_id = self.folder_manager.cut_and_decode( trans, encoded_parent_folder_id )
parent_folder = self.folder_manager.get( trans, decoded_parent_folder_id )
new_folder = self.folder_manager.create( trans, parent_folder.id, name, description )
@@ -98,7 +91,7 @@ class FoldersController( BaseAPIController, UsesLibraryMixin, UsesLibraryMixinIt
:returns: dictionary with all applicable permissions' values
:rtype: dictionary
:raises: ObjectNotFound, InsufficientPermissionsException
:raises: InsufficientPermissionsException
"""
current_user_roles = trans.get_current_user_roles()
is_admin = trans.user_is_admin()
@@ -134,35 +127,32 @@ class FoldersController( BaseAPIController, UsesLibraryMixin, UsesLibraryMixinIt
raise exceptions.RequestParameterInvalidException( "The value of 'scope' parameter is invalid. Alllowed values: current, available" )
@expose_api
def set_permissions( self, trans, encoded_folder_id, **kwd ):
def set_permissions( self, trans, encoded_folder_id, payload=None, **kwd ):
"""
def set_permissions( self, trans, encoded_folder_id, **kwd ):
*POST /api/folders/{encoded_folder_id}/permissions
*POST /api/folders/{encoded_folder_id}/permissions
Set permissions of the given folder to the given role ids.
:param encoded_folder_id: the encoded id of the folder to set the permissions of
:type encoded_folder_id: an encoded id string
:param action: (required) describes what action should be performed
available actions: set_permissions
:type action: string
:param add_ids[]: list of Role.id defining roles that should have add item permission on the folder
:type add_ids[]: string or list
:param manage_ids[]: list of Role.id defining roles that should have manage permission on the folder
:type manage_ids[]: string or list
:param modify_ids[]: list of Role.id defining roles that should have modify permission on the folder
:type modify_ids[]: string or list
:rtype: dictionary
:param payload: dictionary structure containing:
:param action: (required) describes what action should be performed
:type action: string
:param add_ids[]: list of Role.id defining roles that should have add item permission on the folder
:type add_ids[]: string or list
:param manage_ids[]: list of Role.id defining roles that should have manage permission on the folder
:type manage_ids[]: string or list
:param modify_ids[]: list of Role.id defining roles that should have modify permission on the folder
:type modify_ids[]: string or list
:type dictionary
:returns: dict of current roles for all available permission types.
:raises: RequestParameterInvalidException, ObjectNotFound, InsufficientPermissionsException, InternalServerError
RequestParameterMissingException
:rtype: dictionary
:raises: RequestParameterInvalidException, InsufficientPermissionsException, RequestParameterMissingException
"""
if payload:
kwd.update(payload)
is_admin = trans.user_is_admin()
current_user_roles = trans.get_current_user_roles()
decoded_folder_id = self.folder_manager.decode_folder_id( trans, self.folder_manager.cut_the_prefix( encoded_folder_id ) )
decoded_folder_id = self.folder_manager.cut_and_decode( trans, encoded_folder_id )
folder = self.folder_manager.get( trans, decoded_folder_id )
if not ( is_admin or trans.app.security_agent.can_manage_library_item( current_user_roles, folder ) ):
raise exceptions.InsufficientPermissionsException( 'You do not have proper permission to modify permissions of this folder.' )
@@ -180,7 +170,7 @@ class FoldersController( BaseAPIController, UsesLibraryMixin, UsesLibraryMixinIt
valid_add_roles = []
invalid_add_roles_names = []
for role_id in new_add_roles_ids:
role = self._load_role( trans, role_id )
role = self.role_manager.get( trans, self.__decode_id( trans, role_id, 'role' ) )
# Check whether role is in the set of allowed roles
valid_roles, total_roles = trans.app.security_agent.get_valid_roles( trans, folder )
if role in valid_roles:
@@ -194,7 +184,7 @@ class FoldersController( BaseAPIController, UsesLibraryMixin, UsesLibraryMixinIt
valid_manage_roles = []
invalid_manage_roles_names = []
for role_id in new_manage_roles_ids:
role = self._load_role( trans, role_id )
role = self.role_manager.get( trans, self.__decode_id( trans, role_id, 'role' ) )
# Check whether role is in the set of allowed roles
valid_roles, total_roles = trans.app.security_agent.get_valid_roles( trans, folder )
if role in valid_roles:
@@ -208,7 +198,7 @@ class FoldersController( BaseAPIController, UsesLibraryMixin, UsesLibraryMixinIt
valid_modify_roles = []
invalid_modify_roles_names = []
for role_id in new_modify_roles_ids:
role = self._load_role( trans, role_id )
role = self.role_manager.get( trans, self.__decode_id( trans, role_id, 'role' ) )
# Check whether role is in the set of allowed roles
valid_roles, total_roles = trans.app.security_agent.get_valid_roles( trans, folder )
if role in valid_roles:
@@ -254,59 +244,45 @@ class FoldersController( BaseAPIController, UsesLibraryMixin, UsesLibraryMixinIt
return folder_dict
@expose_api
def update( self, trans, encoded_folder_id, **kwd ):
def update( self, trans, encoded_folder_id, payload=None, **kwd ):
"""
* PATCH /api/folders/{encoded_folder_id}
Updates the folder defined by an ``encoded_folder_id`` with the data in the payload.
Update the folder defined by an ``encoded_folder_id`` with the data in the payload.
.. note:: Currently, only admin users can update library folders. Also the folder must not be `deleted`.
:param id: the encoded id of the folder
:type id: an encoded id string
:param payload: (required) dictionary structure containing::
'name': new folder's name, cannot be empty
'description': new folder's description
:type payload: dict
:returns: detailed folder information
:rtype: dict
:raises: RequestParameterMissingException
"""
decoded_folder_id = self.folder_manager.cut_and_decode( trans, encoded_folder_id )
folder = self.folder_manager.get( trans, decoded_folder_id )
payload = kwd.get( 'payload', None )
if payload:
name = payload.get( 'name', None )
if not name:
raise exceptions.RequestParameterMissingException( "Parameter 'name' of library folder is required. You cannot remove it." )
description = payload.get( 'description', None )
else:
raise exceptions.RequestParameterMissingException( "You did not specify any payload." )
kwd.update(payload)
name = kwd.get( 'name', None )
if not name:
raise exceptions.RequestParameterMissingException( "Parameter 'name' of library folder is required. You cannot remove it." )
description = kwd.get( 'description', None )
updated_folder = self.folder_manager.update( trans, folder, name, description )
folder_dict = self.folder_manager.get_folder_dict( trans, updated_folder )
return folder_dict
# TODO move to Role manager
def _load_role( self, trans, role_name ):
def __decode_id( self, trans, encoded_id, object_name=None ):
"""
Method loads the role from the DB based on the given role name.
Try to decode the id.
:param role_name: name of the role to load from the DB
:type role_name: string
:rtype: Role
:returns: the loaded Role object
:raises: InconsistentDatabase, RequestParameterInvalidException, InternalServerError
:param object_name: Name of the object the id belongs to. (optional)
:type object_name: str
"""
try:
role = trans.sa_session.query( trans.app.model.Role ).filter( trans.model.Role.table.c.name == role_name ).one()
except MultipleResultsFound:
raise exceptions.InconsistentDatabase( 'Multiple roles found with the same name. Name: ' + str( role_name ) )
except NoResultFound:
raise exceptions.RequestParameterInvalidException( 'No role found with the name provided. Name: ' + str( role_name ) )
except Exception, e:
raise exceptions.InternalServerError( 'Error loading from the database.' + str(e))
return role
return trans.security.decode_id( encoded_id )
except TypeError:
raise exceptions.MalformedId( 'Malformed %s id specified, unable to decode.' % object_name if object_name is not None else '' )
except ValueError:
raise exceptions.MalformedId( 'Wrong %s id specified, unable to decode.' % object_name if object_name is not None else '' )
+21 -18
View File
@@ -400,9 +400,8 @@ class LibraryDatasetsController( BaseAPIController, UsesVisualizationMixin ):
return rval
@expose_api
def load( self, trans, **kwd ):
def load( self, trans, payload=None, **kwd ):
"""
load( self, trans, **kwd ):
* POST /api/libraries/datasets
Load dataset from the given source into the library.
Source can be:
@@ -413,25 +412,29 @@ class LibraryDatasetsController( BaseAPIController, UsesVisualizationMixin ):
example path: path/to/galaxy/$library_import_dir/{admin can browse everything here}
(admin)any absolute or relative path - option allowed with "allow_library_path_paste" in galaxy.ini
:param encoded_folder_id: the encoded id of the folder to import dataset(s) to
:type encoded_folder_id: an encoded id string
:param source: source the datasets should be loaded from
:type source: str
:param link_data: flag whether to link the dataset to data or copy it to Galaxy, defaults to copy
while linking is set to True all symlinks will be resolved _once_
:type link_data: bool
:param preserve_dirs: flag whether to preserve the directory structure when importing dir
if False only datasets will be imported
:type preserve_dirs: bool
:param file_type: file type of the loaded datasets, defaults to 'auto' (autodetect)
:type file_type: str
:param dbkey: dbkey of the loaded genome, defaults to '?' (unknown)
:type dbkey: str
:param payload: dictionary structure containing:
:param encoded_folder_id: the encoded id of the folder to import dataset(s) to
:type encoded_folder_id: an encoded id string
:param source: source the datasets should be loaded from
:type source: str
:param link_data: flag whether to link the dataset to data or copy it to Galaxy, defaults to copy
while linking is set to True all symlinks will be resolved _once_
:type link_data: bool
:param preserve_dirs: flag whether to preserve the directory structure when importing dir
if False only datasets will be imported
:type preserve_dirs: bool
:param file_type: file type of the loaded datasets, defaults to 'auto' (autodetect)
:type file_type: str
:param dbkey: dbkey of the loaded genome, defaults to '?' (unknown)
:type dbkey: str
:type dictionary
:returns: dict containing information about the created upload job
:rtype: dictionary
:raises: RequestParameterMissingException, AdminRequiredException, ConfigDoesNotAllowException, RequestParameterInvalidException
InsufficientPermissionsException, ObjectNotFound
"""
if payload:
kwd.update(payload)
kwd[ 'space_to_tab' ] = 'False'
kwd[ 'to_posix_lines' ] = 'True'
kwd[ 'dbkey' ] = kwd.get( 'dbkey', '?' )
+59 -62
View File
@@ -54,6 +54,8 @@ class LibrariesController( BaseAPIController ):
return trans.security.decode_id( encoded_id )
except TypeError:
raise exceptions.MalformedId( 'Malformed %s id specified, unable to decode.' % object_name if object_name is not None else '' )
except ValueError:
raise exceptions.MalformedId( 'Wrong %s id specified, unable to decode.' % object_name if object_name is not None else '' )
@expose_api_anonymous
def show( self, trans, id, deleted='False', **kwd ):
@@ -81,31 +83,32 @@ class LibrariesController( BaseAPIController ):
return library_dict
@expose_api
def create( self, trans, payload, **kwd ):
def create( self, trans, payload=None, **kwd ):
"""
create( self, trans, payload, **kwd )
* POST /api/libraries:
Creates a new library. Only ``name`` parameter is required.
Creates a new library.
.. note:: Currently, only admin users can create libraries.
:param payload: dictionary structure containing::
'name': the new library's name (required)
'description': the new library's description (optional)
'synopsis': the new library's synopsis (optional)
:param name: (required) the new library's name
:type name: str
:param description: the new library's description
:type description: str
:param synopsis: the new library's synopsis
:type synopsis: str
:type payload: dict
:returns: detailed library information
:rtype: dict
:raises: ItemAccessibilityException, RequestParameterMissingException
:raises: RequestParameterMissingException
"""
params = util.Params( payload )
name = util.restore_text( params.get( 'name', None ) )
if payload:
kwd.update(payload)
name = kwd.get('name', None)
if not name:
raise exceptions.RequestParameterMissingException( "Missing required parameter 'name'." )
description = util.restore_text( params.get( 'description', '' ) )
synopsis = util.restore_text( params.get( 'synopsis', '' ) )
description = kwd.get( 'description', '' )
synopsis = kwd.get( 'synopsis', '' )
if synopsis in [ 'None', None ]:
synopsis = ''
library = self.library_manager.create( trans, name, description, synopsis )
@@ -113,7 +116,7 @@ class LibrariesController( BaseAPIController ):
return library_dict
@expose_api
def update( self, trans, id, **kwd ):
def update( self, trans, id, payload=None, **kwd ):
"""
* PATCH /api/libraries/{encoded_id}
Updates the library defined by an ``encoded_id`` with the data in the payload.
@@ -122,38 +125,33 @@ class LibrariesController( BaseAPIController ):
:param id: the encoded id of the library
:type id: an encoded id string
:param payload: (required) dictionary structure containing::
'name': new library's name, cannot be empty
'description': new library's description
'synopsis': new library's synopsis
:param payload: dictionary structure containing::
:param name: new library's name, cannot be empty
:type name: str
:param description: new library's description
:type description: str
:param synopsis: new library's synopsis
:type synopsis: str
:type payload: dict
:returns: detailed library information
:rtype: dict
:raises: ItemAccessibilityException, MalformedId, ObjectNotFound, RequestParameterInvalidException, RequestParameterMissingException
:raises: RequestParameterMissingException
"""
library = self.library_manager.get( trans, self.__decode_id( trans, id, 'library' ) )
payload = kwd.get( 'payload', None )
if payload:
name = payload.get( 'name', None )
if name == '':
raise exceptions.RequestParameterMissingException( "Parameter 'name' of library is required. You cannot remove it." )
if payload.get( 'description', None ) or payload.get( 'description', None ) == '':
description = payload.get( 'description', None )
if payload.get( 'synopsis', None ) or payload.get( 'synopsis', None ) == '':
synopsis = payload.get( 'synopsis', None )
else:
raise exceptions.RequestParameterMissingException( "You did not specify any payload." )
kwd.update(payload)
name = kwd.get( 'name', None )
if name == '':
raise exceptions.RequestParameterMissingException( "Parameter 'name' of library is required. You cannot remove it." )
description = kwd.get( 'description', None )
synopsis = kwd.get( 'synopsis', None )
updated_library = self.library_manager.update( trans, library, name, description, synopsis )
library_dict = self.library_manager.get_library_dict( trans, updated_library )
return library_dict
@expose_api
def delete( self, trans, id, **kwd ):
def delete( self, trans, id, payload=None, **kwd ):
"""
delete( self, trans, id, **kwd )
* DELETE /api/libraries/{id}
marks the library with the given ``id`` as `deleted` (or removes the `deleted` mark if the `undelete` param is true)
@@ -162,16 +160,17 @@ class LibrariesController( BaseAPIController ):
:param id: the encoded id of the library to un/delete
:type id: an encoded id string
:param undelete: (optional) flag specifying whether the item should be deleted or undeleted, defaults to false:
:type undelete: bool
:param payload: dictionary structure containing:
:param undelete: (optional) flag specifying whether the item should be deleted or undeleted, defaults to false:
:type undelete: bool
:type: dictionary
:returns: detailed library information
:rtype: dictionary
.. seealso:: :attr:`galaxy.model.Library.dict_element_visible_keys`
:raises: ItemAccessibilityException, MalformedId, ObjectNotFound
"""
if payload:
kwd.update(payload)
library = self.library_manager.get( trans, self.__decode_id( trans, id, 'library' ))
undelete = util.string_as_bool( kwd.get( 'undelete', False ) )
library = self.library_manager.delete( trans, library, undelete )
@@ -197,7 +196,7 @@ class LibrariesController( BaseAPIController ):
:returns: dictionary with all applicable permissions' values
:rtype: dictionary
:raises: ObjectNotFound, InsufficientPermissionsException
:raises: InsufficientPermissionsException
"""
current_user_roles = trans.get_current_user_roles()
is_admin = trans.user_is_admin()
@@ -239,33 +238,33 @@ class LibrariesController( BaseAPIController ):
raise exceptions.RequestParameterInvalidException( "The value of 'scope' parameter is invalid. Alllowed values: current, available" )
@expose_api
def set_permissions( self, trans, encoded_library_id, **kwd ):
def set_permissions( self, trans, encoded_library_id, payload=None, **kwd ):
"""
def set_permissions( self, trans, encoded_dataset_id, **kwd ):
*POST /api/libraries/{encoded_library_id}/permissions
*POST /api/libraries/{encoded_library_id}/permissions
Set permissions of the given library to the given role ids.
:param encoded_library_id: the encoded id of the library to set the permissions of
:type encoded_library_id: an encoded id string
:param action: (required) describes what action should be performed
available actions: remove_restrictions, set_permissions
:type action: string
:param access_ids[]: list of Role.id defining roles that should have access permission on the library
:type access_ids[]: string or list
:param add_ids[]: list of Role.id defining roles that should have add item permission on the library
:type add_ids[]: string or list
:param manage_ids[]: list of Role.id defining roles that should have manage permission on the library
:type manage_ids[]: string or list
:param modify_ids[]: list of Role.id defining roles that should have modify permission on the library
:type modify_ids[]: string or list
:rtype: dictionary
:param payload: dictionary structure containing:
:param action: (required) describes what action should be performed
available actions: remove_restrictions, set_permissions
:type action: str
:param access_ids[]: list of Role.id defining roles that should have access permission on the library
:type access_ids[]: string or list
:param add_ids[]: list of Role.id defining roles that should have add item permission on the library
:type add_ids[]: string or list
:param manage_ids[]: list of Role.id defining roles that should have manage permission on the library
:type manage_ids[]: string or list
:param modify_ids[]: list of Role.id defining roles that should have modify permission on the library
:type modify_ids[]: string or list
:type: dictionary
:returns: dict of current roles for all available permission types
:raises: RequestParameterInvalidException, ObjectNotFound, InsufficientPermissionsException, InternalServerError
:rtype: dictionary
:raises: RequestParameterInvalidException, InsufficientPermissionsException, InternalServerError
RequestParameterMissingException
"""
if payload:
kwd.update(payload)
is_admin = trans.user_is_admin()
current_user_roles = trans.get_current_user_roles()
library = self.library_manager.get( trans, self.__decode_id( trans, encoded_library_id, 'library' ) )
@@ -280,8 +279,6 @@ class LibrariesController( BaseAPIController ):
action = kwd.get( 'action', None )
if action is None:
payload = kwd.get( 'payload', None )
del kwd[ 'payload' ]
if payload is not None:
return self.set_permissions_old( trans, library, payload, **kwd )
else:
+2 -1
View File
@@ -34,7 +34,8 @@ from pip.platform import get_specific_platform
compatible_platforms = {
'centos': 'rhel'
'centos': 'rhel',
'scientific': 'rhel',
}
+1 -5
View File
@@ -101,11 +101,7 @@ if [ $SET_VENV -eq 1 -a $CREATE_VENV -eq 1 ]; then
python -c "import urllib; urllib.urlretrieve('$vurl', '$vsrc')"
fi
echo "Verifying $vsrc checksum is $vsha"
if command -v sha256sum >/dev/null; then
echo "$vsha $vsrc" | sha256sum -c --strict
else
python -c "import hashlib; assert hashlib.sha256(open('$vsrc', 'rb').read()).hexdigest() == '$vsha', '$vsrc: invalid checksum'"
fi
python -c "import hashlib; assert hashlib.sha256(open('$vsrc', 'rb').read()).hexdigest() == '$vsha', '$vsrc: invalid checksum'"
tar zxf $vsrc -C $vtmp
python $vtmp/virtualenv-$vvers/virtualenv.py "$GALAXY_VIRTUAL_ENV"
rm -rf $vtmp
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long