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
January 2014
- 1 participants
- 280 discussions
commit/galaxy-central: jmchilton: PEP-8 fixes for tools/actions/__init__.py
by commits-noreply@bitbucket.org 10 Jan '14
by commits-noreply@bitbucket.org 10 Jan '14
10 Jan '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/9f55b4b37d35/
Changeset: 9f55b4b37d35
User: jmchilton
Date: 2014-01-11 04:17:39
Summary: PEP-8 fixes for tools/actions/__init__.py
Affected #: 1 file
diff -r 582d1e318dd3b604f2371a861f35c6fae1a2d36d -r 9f55b4b37d35b8366f42ab430ac4213554d83311 lib/galaxy/tools/actions/__init__.py
--- a/lib/galaxy/tools/actions/__init__.py
+++ b/lib/galaxy/tools/actions/__init__.py
@@ -3,7 +3,8 @@
from galaxy.exceptions import ObjectInvalid
from galaxy.model import LibraryDatasetDatasetAssociation
-from galaxy.tools.parameters import DataToolParameter, SelectToolParameter
+from galaxy.tools.parameters import DataToolParameter
+from galaxy.tools.parameters import SelectToolParameter
from galaxy.tools.parameters.grouping import Conditional, Repeat
from galaxy.util.json import from_json_string
from galaxy.util.json import to_json_string
@@ -15,6 +16,7 @@
import logging
log = logging.getLogger( __name__ )
+
class ToolAction( object ):
"""
The actions to be taken when a tool is run (after parameters have
@@ -23,6 +25,7 @@
def execute( self, tool, trans, incoming={}, set_output_hid=True ):
raise TypeError("Abstract method")
+
class DefaultToolAction( object ):
"""Default tool action is to run an external command"""
@@ -33,8 +36,10 @@
of the DataToolParameter type.
"""
input_datasets = dict()
- def visitor( prefix, input, value, parent = None ):
- def process_dataset( data, formats = None ):
+
+ def visitor( prefix, input, value, parent=None ):
+
+ def process_dataset( data, formats=None ):
if not data:
return data
if formats is None:
@@ -48,11 +53,11 @@
data = converted_dataset
else:
#run converter here
- new_data = data.datatype.convert_dataset( trans, data, target_ext, return_output = True, visible = False ).values()[0]
+ new_data = data.datatype.convert_dataset( trans, data, target_ext, return_output=True, visible=False ).values()[0]
new_data.hid = data.hid
new_data.name = data.name
trans.sa_session.add( new_data )
- assoc = trans.app.model.ImplicitlyConvertedDatasetAssociation( parent = data, file_type = target_ext, dataset = new_data, metadata_safe = False )
+ assoc = trans.app.model.ImplicitlyConvertedDatasetAssociation( parent=data, file_type=target_ext, dataset=new_data, metadata_safe=False )
trans.sa_session.add( assoc )
trans.sa_session.flush()
data = new_data
@@ -77,17 +82,17 @@
input_datasets[ prefix + conversion_name + str( i + 1 ) ] = new_data
conversions.append( ( conversion_name, new_data ) )
else:
- raise Exception, 'A path for explicit datatype conversion has not been found: %s --/--> %s' % ( input_datasets[ prefix + input.name + str( i + 1 ) ].extension, conversion_extensions )
+ raise Exception('A path for explicit datatype conversion has not been found: %s --/--> %s' % ( input_datasets[ prefix + input.name + str( i + 1 ) ].extension, conversion_extensions ) )
if parent:
parent[input.name][i] = input_datasets[ prefix + input.name + str( i + 1 ) ]
for conversion_name, conversion_data in conversions:
#allow explicit conversion to be stored in job_parameter table
- parent[ conversion_name ][i] = conversion_data.id #a more robust way to determine JSONable value is desired
+ parent[ conversion_name ][i] = conversion_data.id # a more robust way to determine JSONable value is desired
else:
param_values[input.name][i] = input_datasets[ prefix + input.name + str( i + 1 ) ]
for conversion_name, conversion_data in conversions:
#allow explicit conversion to be stored in job_parameter table
- param_values[ conversion_name ][i] = conversion_data.id #a more robust way to determine JSONable value is desired
+ param_values[ conversion_name ][i] = conversion_data.id # a more robust way to determine JSONable value is desired
else:
input_datasets[ prefix + input.name ] = process_dataset( value )
conversions = []
@@ -97,14 +102,14 @@
input_datasets[ prefix + conversion_name ] = new_data
conversions.append( ( conversion_name, new_data ) )
else:
- raise Exception, 'A path for explicit datatype conversion has not been found: %s --/--> %s' % ( input_datasets[ prefix + input.name ].extension, conversion_extensions )
+ raise Exception( 'A path for explicit datatype conversion has not been found: %s --/--> %s' % ( input_datasets[ prefix + input.name ].extension, conversion_extensions ) )
target_dict = parent
if not target_dict:
target_dict = param_values
target_dict[ input.name ] = input_datasets[ prefix + input.name ]
for conversion_name, conversion_data in conversions:
#allow explicit conversion to be stored in job_parameter table
- target_dict[ conversion_name ] = conversion_data.id #a more robust way to determine JSONable value is desired
+ target_dict[ conversion_name ] = conversion_data.id # a more robust way to determine JSONable value is desired
tool.visit_inputs( param_values, visitor )
return input_datasets
@@ -130,6 +135,7 @@
else:
copy_from_dict[ key ] = value
return copy_from_dict
+
def make_list_copy( from_list ):
new_list = []
for value in from_list:
@@ -140,32 +146,33 @@
else:
new_list.append( value )
return new_list
- def wrap_values( inputs, input_values, skip_missing_values = False ):
+
+ def wrap_values( inputs, input_values, skip_missing_values=False ):
# Wrap tool inputs as necessary
for input in inputs.itervalues():
if input.name not in input_values and skip_missing_values:
continue
if isinstance( input, Repeat ):
for d in input_values[ input.name ]:
- wrap_values( input.inputs, d, skip_missing_values = skip_missing_values )
+ wrap_values( input.inputs, d, skip_missing_values=skip_missing_values )
elif isinstance( input, Conditional ):
values = input_values[ input.name ]
current = values[ "__current_case__" ]
- wrap_values( input.cases[current].inputs, values, skip_missing_values = skip_missing_values )
+ wrap_values( input.cases[current].inputs, values, skip_missing_values=skip_missing_values )
elif isinstance( input, DataToolParameter ) and input.multiple:
input_values[ input.name ] = \
galaxy.tools.DatasetListWrapper( input_values[ input.name ],
- datatypes_registry = trans.app.datatypes_registry,
- tool = tool,
- name = input.name )
+ datatypes_registry=trans.app.datatypes_registry,
+ tool=tool,
+ name=input.name )
elif isinstance( input, DataToolParameter ):
input_values[ input.name ] = \
galaxy.tools.DatasetFilenameWrapper( input_values[ input.name ],
- datatypes_registry = trans.app.datatypes_registry,
- tool = tool,
- name = input.name )
+ datatypes_registry=trans.app.datatypes_registry,
+ tool=tool,
+ name=input.name )
elif isinstance( input, SelectToolParameter ):
- input_values[ input.name ] = galaxy.tools.SelectToolParameterWrapper( input, input_values[ input.name ], tool.app, other_values = incoming )
+ input_values[ input.name ] = galaxy.tools.SelectToolParameterWrapper( input, input_values[ input.name ], tool.app, other_values=incoming )
else:
input_values[ input.name ] = galaxy.tools.InputValueWrapper( input, input_values[ input.name ], incoming )
@@ -183,7 +190,7 @@
input_dbkey = incoming.get( "dbkey", "?" )
for name, data in inp_data.items():
if not data:
- data = NoneDataset( datatypes_registry = trans.app.datatypes_registry )
+ data = NoneDataset( datatypes_registry=trans.app.datatypes_registry )
continue
# Convert LDDA to an HDA.
@@ -191,7 +198,7 @@
data = data.to_history_dataset_association( None )
inp_data[name] = data
- else: # HDA
+ else: # HDA
if data.hid:
input_names.append( 'data %s' % data.hid )
input_ext = data.ext
@@ -212,9 +219,9 @@
if trans.user and ( 'dbkeys' in trans.user.preferences ) and ( input_dbkey in from_json_string( trans.user.preferences[ 'dbkeys' ] ) ):
# Custom build.
custom_build_dict = from_json_string( trans.user.preferences[ 'dbkeys' ] )[ input_dbkey ]
- # HACK: the attempt to get chrom_info below will trigger the
+ # HACK: the attempt to get chrom_info below will trigger the
# fasta-to-len converter if the dataset is not available or,
- # which will in turn create a recursive loop when
+ # which will in turn create a recursive loop when
# running the fasta-to-len tool. So, use a hack in the second
# condition below to avoid getting chrom_info when running the
# fasta-to-len converter.
@@ -248,7 +255,7 @@
on_text = ""
# Add the dbkey to the incoming parameters
incoming[ "dbkey" ] = input_dbkey
- params = None #wrapped params are used by change_format action and by output.label; only perform this wrapping once, as needed
+ params = None # wrapped params are used by change_format action and by output.label; only perform this wrapping once, as needed
# Keep track of parent / child relationships, we'll create all the
# datasets first, then create the associations
parent_to_child_pairs = []
@@ -258,10 +265,10 @@
for filter in output.filters:
try:
if not eval( filter.text.strip(), globals(), incoming ):
- break #do not create this dataset
+ break # do not create this dataset
except Exception, e:
log.debug( 'Dataset output filter failed: %s' % e )
- else: #all filters passed
+ else: # all filters passed
if output.parent:
parent_to_child_pairs.append( ( output.parent, name ) )
child_dataset_names.add( name )
@@ -291,7 +298,7 @@
if output.change_format:
if params is None:
params = make_dict_copy( incoming )
- wrap_values( tool.inputs, params, skip_missing_values = not tool.check_values )
+ wrap_values( tool.inputs, params, skip_missing_values=not tool.check_values )
for change_elem in output.change_format:
for when_elem in change_elem.findall( 'when' ):
check = when_elem.get( 'input', None )
@@ -300,9 +307,9 @@
if '$' not in check:
#allow a simple name or more complex specifications
check = '${%s}' % check
- if str( fill_template( check, context = params ) ) == when_elem.get( 'value', None ):
+ if str( fill_template( check, context=params ) ) == when_elem.get( 'value', None ):
ext = when_elem.get( 'format', ext )
- except: #bad tag input value; possibly referencing a param within a different conditional when block or other nonexistent grouping construct
+ except: # bad tag input value; possibly referencing a param within a different conditional when block or other nonexistent grouping construct
continue
else:
check = when_elem.get( 'input_dataset', None )
@@ -348,7 +355,7 @@
# <outputs>
# <data format="input" name="output" label="Blat on ${<input_param>.name}" />
# </outputs>
- wrap_values( tool.inputs, params, skip_missing_values = not tool.check_values )
+ wrap_values( tool.inputs, params, skip_missing_values=not tool.check_values )
#tool (only needing to be set once) and on_string (set differently for each label) are overwritten for each output dataset label being determined
params['tool'] = tool
params['on_string'] = on_text
@@ -356,7 +363,7 @@
else:
if params is None:
params = make_dict_copy( incoming )
- wrap_values( tool.inputs, params, skip_missing_values = not tool.check_values )
+ wrap_values( tool.inputs, params, skip_missing_values=not tool.check_values )
data.name = self._get_default_data_name( data, tool, on_text=on_text, trans=trans, incoming=incoming, history=history, params=params, job_params=job_params )
# Store output
out_data[ name ] = data
@@ -369,10 +376,10 @@
trans.sa_session.flush()
# Add all the top-level (non-child) datasets to the history unless otherwise specified
for name in out_data.keys():
- if name not in child_dataset_names and name not in incoming: #don't add children; or already existing datasets, i.e. async created
+ if name not in child_dataset_names and name not in incoming: # don't add children; or already existing datasets, i.e. async created
data = out_data[ name ]
if set_output_history:
- history.add_dataset( data, set_hid = set_output_hid )
+ history.add_dataset( data, set_hid=set_output_hid )
trans.sa_session.add( data )
trans.sa_session.flush()
# Add all the children to their parents
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: Fix message rendering for repositories with multiple heads.
by commits-noreply@bitbucket.org 10 Jan '14
by commits-noreply@bitbucket.org 10 Jan '14
10 Jan '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/582d1e318dd3/
Changeset: 582d1e318dd3
User: greg
Date: 2014-01-10 22:36:45
Summary: Fix message rendering for repositories with multiple heads.
Affected #: 2 files
diff -r 56b61e7d5bbcea1dff823cf78229289480ee15e7 -r 582d1e318dd3b604f2371a861f35c6fae1a2d36d templates/webapps/tool_shed/repository/manage_repository.mako
--- a/templates/webapps/tool_shed/repository/manage_repository.mako
+++ b/templates/webapps/tool_shed/repository/manage_repository.mako
@@ -125,7 +125,7 @@
from tool_shed.util.shed_util_common import get_revision_label_from_ctx
heads_str = ''
for ctx in heads:
- heads_str += get_revision_label_from_ctx( ctx )
+ heads_str += '%s<br/>' % get_revision_label_from_ctx( ctx )
%>
Contact the administrator of this Tool Shed as soon as possible and let them know that
this repository has the following multiple heads which must be merged.<br/>
diff -r 56b61e7d5bbcea1dff823cf78229289480ee15e7 -r 582d1e318dd3b604f2371a861f35c6fae1a2d36d templates/webapps/tool_shed/repository/view_repository.mako
--- a/templates/webapps/tool_shed/repository/view_repository.mako
+++ b/templates/webapps/tool_shed/repository/view_repository.mako
@@ -72,7 +72,7 @@
from tool_shed.util.shed_util_common import get_revision_label_from_ctx
heads_str = ''
for ctx in heads:
- heads_str += get_revision_label_from_ctx( ctx )
+ heads_str += '%s<br/>' % get_revision_label_from_ctx( ctx )
%>
Contact the administrator of this Tool Shed as soon as possible and let them know that
this repository has the following multiple heads which must be merged.<br/>
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 tool shed features for displaying repository heads and alerting users if a repository has multiple heads that require merging.
by commits-noreply@bitbucket.org 10 Jan '14
by commits-noreply@bitbucket.org 10 Jan '14
10 Jan '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/56b61e7d5bbc/
Changeset: 56b61e7d5bbc
User: greg
Date: 2014-01-10 22:30:45
Summary: Add tool shed features for displaying repository heads and alerting users if a repository has multiple heads that require merging.
Affected #: 6 files
diff -r 4ab2017348e25958bcd8babd8e110f574dff24df -r 56b61e7d5bbcea1dff823cf78229289480ee15e7 lib/galaxy/webapps/tool_shed/controllers/repository.py
--- a/lib/galaxy/webapps/tool_shed/controllers/repository.py
+++ b/lib/galaxy/webapps/tool_shed/controllers/repository.py
@@ -2255,6 +2255,7 @@
categories = suc.get_categories( trans )
selected_categories = [ rca.category_id for rca in repository.categories ]
containers_dict = container_util.build_repository_containers_for_tool_shed( trans, repository, changeset_revision, repository_dependencies, repository_metadata )
+ heads = suc.get_repository_heads( repo )
return trans.fill_template( '/webapps/tool_shed/repository/manage_repository.mako',
repo_name=repo_name,
description=description,
@@ -2262,6 +2263,7 @@
current_allow_push_list=current_allow_push_list,
allow_push_select_field=allow_push_select_field,
repo=repo,
+ heads=heads,
repository=repository,
containers_dict=containers_dict,
repository_metadata=repository_metadata,
@@ -3043,8 +3045,10 @@
status = 'error'
containers_dict = container_util.build_repository_containers_for_tool_shed( trans, repository, changeset_revision, repository_dependencies, repository_metadata )
repository_type_select_field = rt_util.build_repository_type_select_field( trans, repository=repository )
+ heads = suc.get_repository_heads( repo )
return trans.fill_template( '/webapps/tool_shed/repository/view_repository.mako',
repo=repo,
+ heads=heads,
repository=repository,
repository_metadata=repository_metadata,
metadata=metadata,
diff -r 4ab2017348e25958bcd8babd8e110f574dff24df -r 56b61e7d5bbcea1dff823cf78229289480ee15e7 lib/tool_shed/grids/admin_grids.py
--- a/lib/tool_shed/grids/admin_grids.py
+++ b/lib/tool_shed/grids/admin_grids.py
@@ -365,6 +365,7 @@
key="name",
link=( lambda item: dict( operation="view_or_manage_repository", id=item.id ) ),
attach_popup=True ),
+ RepositoryGrid.HeadsColumn( "Heads" ),
RepositoryGrid.UserColumn( "Owner",
model_class=model.User,
link=( lambda item: dict( operation="repositories_by_user", id=item.id ) ),
diff -r 4ab2017348e25958bcd8babd8e110f574dff24df -r 56b61e7d5bbcea1dff823cf78229289480ee15e7 lib/tool_shed/grids/repository_grids.py
--- a/lib/tool_shed/grids/repository_grids.py
+++ b/lib/tool_shed/grids/repository_grids.py
@@ -89,6 +89,29 @@
return escape_html( type_class.label )
+ class HeadsColumn( grids.GridColumn ):
+
+ def __init__( self, col_name ):
+ grids.GridColumn.__init__( self, col_name )
+
+ def get_value( self, trans, grid, repository ):
+ """Display the current repository heads."""
+ repo_dir = repository.repo_path( trans.app )
+ repo = hg.repository( suc.get_configured_ui(), repo_dir )
+ heads = suc.get_repository_heads( repo )
+ multiple_heads = len( heads ) > 1
+ if multiple_heads:
+ heads_str = '<font color="red">'
+ else:
+ heads_str = ''
+ for ctx in heads:
+ heads_str += '%s<br/>' % suc.get_revision_label_from_ctx( ctx )
+ heads_str.rstrip( '<br/>' )
+ if multiple_heads:
+ heads_str += '</font>'
+ return heads_str
+
+
class MetadataRevisionColumn( grids.GridColumn ):
def __init__( self, col_name ):
diff -r 4ab2017348e25958bcd8babd8e110f574dff24df -r 56b61e7d5bbcea1dff823cf78229289480ee15e7 lib/tool_shed/util/shed_util_common.py
--- a/lib/tool_shed/util/shed_util_common.py
+++ b/lib/tool_shed/util/shed_util_common.py
@@ -1108,6 +1108,11 @@
# This should never be reached - raise an exception?
return v, None
+def get_repository_heads( repo ):
+ """Return current repository heads, which are changesets with no child changesets."""
+ heads = [ repo[ h ] for h in repo.heads( None ) ]
+ return heads
+
def get_repository_ids_requiring_prior_import_or_install( trans, tsr_ids, repository_dependencies ):
"""
This method is used in the Tool Shed when exporting a repository and it's dependencies, and in Galaxy when a repository and it's dependencies
@@ -1213,18 +1218,20 @@
repo = hg.repository( get_configured_ui(), repository.repo_path( trans.app ) )
ctx = get_changectx_for_changeset( repo, changeset_revision )
if ctx:
- return '%s:%s <i><font color="#666666">(%s)</font></i>' % \
- ( str( ctx.rev() ), changeset_revision, str( get_readable_ctx_date( ctx ) ) )
+ return get_revision_label_from_ctx( ctx )
else:
return "-1:%s" % changeset_revision
+def get_revision_label_from_ctx( ctx ):
+ return '%s:%s <i><font color="#666666">(%s)</font></i>' % \
+ ( str( ctx.rev() ), str( ctx ), str( get_readable_ctx_date( ctx ) ) )
+
def get_rev_label_from_changeset_revision( repo, changeset_revision ):
"""Given a changeset revision hash, return two strings, the changeset rev and the changeset revision hash."""
ctx = get_changectx_for_changeset( repo, changeset_revision )
if ctx:
rev = '%04d' % ctx.rev()
- label = '%s:%s <i><font color="#666666">(%s)</font></i>' % \
- ( str( ctx.rev() ), changeset_revision, str( get_readable_ctx_date( ctx ) ) )
+ label = get_revision_label_from_ctx( ctx )
else:
rev = '-1'
label = "-1:%s" % changeset_revision
diff -r 4ab2017348e25958bcd8babd8e110f574dff24df -r 56b61e7d5bbcea1dff823cf78229289480ee15e7 templates/webapps/tool_shed/repository/manage_repository.mako
--- a/templates/webapps/tool_shed/repository/manage_repository.mako
+++ b/templates/webapps/tool_shed/repository/manage_repository.mako
@@ -83,6 +83,10 @@
can_render_skip_tool_test_section = True
else:
can_render_skip_tool_test_section = False
+ if heads:
+ multiple_heads = len( heads ) > 1
+ else:
+ multiple_heads = False
%><%!
@@ -115,6 +119,18 @@
<div class="warningmessage">
This repository has been marked as deprecated, so some tool shed features may be restricted.
</div>
+%elif multiple_heads:
+ <div class="warningmessage">
+ <%
+ from tool_shed.util.shed_util_common import get_revision_label_from_ctx
+ heads_str = ''
+ for ctx in heads:
+ heads_str += get_revision_label_from_ctx( ctx )
+ %>
+ Contact the administrator of this Tool Shed as soon as possible and let them know that
+ this repository has the following multiple heads which must be merged.<br/>
+ ${heads_str}
+ </div>
%endif
%if len( changeset_revision_select_field.options ) > 1:
diff -r 4ab2017348e25958bcd8babd8e110f574dff24df -r 56b61e7d5bbcea1dff823cf78229289480ee15e7 templates/webapps/tool_shed/repository/view_repository.mako
--- a/templates/webapps/tool_shed/repository/view_repository.mako
+++ b/templates/webapps/tool_shed/repository/view_repository.mako
@@ -25,6 +25,11 @@
tip_str = ''
sharable_link_label = 'Sharable link to this repository revision:'
sharable_link_changeset_revision = changeset_revision
+
+ if heads:
+ multiple_heads = len( heads ) > 1
+ else:
+ multiple_heads = False
%><%!
@@ -61,6 +66,18 @@
<div class="warningmessage">
This repository has been marked as deprecated, so some tool shed features may be restricted.
</div>
+%elif multiple_heads:
+ <div class="warningmessage">
+ <%
+ from tool_shed.util.shed_util_common import get_revision_label_from_ctx
+ heads_str = ''
+ for ctx in heads:
+ heads_str += get_revision_label_from_ctx( ctx )
+ %>
+ Contact the administrator of this Tool Shed as soon as possible and let them know that
+ this repository has the following multiple heads which must be merged.<br/>
+ ${heads_str}
+ </div>
%endif
%if len( changeset_revision_select_field.options ) > 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
commit/galaxy-central: jmchilton: PEP-8 fixes for pages API.
by commits-noreply@bitbucket.org 10 Jan '14
by commits-noreply@bitbucket.org 10 Jan '14
10 Jan '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/4ab2017348e2/
Changeset: 4ab2017348e2
User: jmchilton
Date: 2014-01-10 22:08:30
Summary: PEP-8 fixes for pages API.
Affected #: 2 files
diff -r 43a964de0758ea9deffb88fd2c59441a13cae14b -r 4ab2017348e25958bcd8babd8e110f574dff24df lib/galaxy/webapps/galaxy/api/page_revisions.py
--- a/lib/galaxy/webapps/galaxy/api/page_revisions.py
+++ b/lib/galaxy/webapps/galaxy/api/page_revisions.py
@@ -4,13 +4,12 @@
import logging
from galaxy import web
from galaxy.web.base.controller import SharableItemSecurityMixin, BaseAPIController, SharableMixin
-from galaxy.model.search import GalaxySearchEngine
from galaxy.model.item_attrs import UsesAnnotations
-from galaxy.exceptions import ItemAccessibilityException
from galaxy.util.sanitize_html import sanitize_html
log = logging.getLogger( __name__ )
+
class PageRevisionsController( BaseAPIController, SharableItemSecurityMixin, UsesAnnotations, SharableMixin ):
@web.expose_api
@@ -32,7 +31,6 @@
out.append( self.encode_all_ids( trans, page.to_dict(), True) )
return out
-
@web.expose_api
def create( self, trans, page_id, payload, **kwd ):
"""
@@ -46,11 +44,10 @@
'content' = New content of the page
:rtype: dictionary
- :returns: Dictionary with 'success' or 'error' element to indicate the result of the request
+ :returns: Dictionary with 'success' or 'error' element to indicate the result of the request
"""
- user = trans.get_user()
error_str = ""
-
+
if not page_id:
error_str = "page_id is required"
elif not payload.get("content", None):
@@ -61,7 +58,7 @@
page = trans.sa_session.query( trans.app.model.Page ).get( trans.security.decode_id(page_id) )
if page is None:
return { "error" : "page not found"}
-
+
if not self.security_check( trans, page, True, True ):
return { "error" : "page not found"}
@@ -82,6 +79,6 @@
session = trans.sa_session
session.flush()
- return {"success" : "revision posted"}
-
- return { "error" : error_str }
+ return { "success" : "revision posted" }
+
+ return { "error" : error_str }
diff -r 43a964de0758ea9deffb88fd2c59441a13cae14b -r 4ab2017348e25958bcd8babd8e110f574dff24df lib/galaxy/webapps/galaxy/api/pages.py
--- a/lib/galaxy/webapps/galaxy/api/pages.py
+++ b/lib/galaxy/webapps/galaxy/api/pages.py
@@ -4,13 +4,12 @@
import logging
from galaxy import web
from galaxy.web.base.controller import SharableItemSecurityMixin, BaseAPIController, SharableMixin
-from galaxy.model.search import GalaxySearchEngine
from galaxy.model.item_attrs import UsesAnnotations
-from galaxy.exceptions import ItemAccessibilityException
from galaxy.util.sanitize_html import sanitize_html
log = logging.getLogger( __name__ )
+
class PagesController( BaseAPIController, SharableItemSecurityMixin, UsesAnnotations, SharableMixin ):
@web.expose_api
@@ -26,7 +25,7 @@
:returns: dictionaries containing summary or detailed Page information
"""
out = []
-
+
if trans.user_is_admin():
r = trans.sa_session.query( trans.app.model.Page )
if not deleted:
@@ -48,7 +47,6 @@
return out
-
@web.expose_api
def create( self, trans, payload, **kwd ):
"""
@@ -67,7 +65,7 @@
"""
user = trans.get_user()
error_str = ""
-
+
if not payload.get("title", None):
error_str = "Page name is required"
elif not payload.get("slug", None):
@@ -85,7 +83,7 @@
page = trans.app.model.Page()
page.title = payload['title']
page.slug = payload['slug']
- page_annotation = sanitize_html( payload.get("annotation",""), 'utf-8', 'text/html' )
+ page_annotation = sanitize_html( payload.get( "annotation", "" ), 'utf-8', 'text/html' )
self.add_item_annotation( trans.sa_session, trans.get_user(), page, page_annotation )
page.user = user
# And the first (empty) page revision
@@ -99,11 +97,10 @@
session.add( page )
session.flush()
- rval = self.encode_all_ids( trans, page.to_dict(), True)
+ rval = self.encode_all_ids( trans, page.to_dict(), True )
return rval
-
- return { "error" : error_str }
+ return { "error" : error_str }
@web.expose_api
def delete( self, trans, id, **kwd ):
@@ -115,9 +112,9 @@
:param id: ID of page to be deleted
:rtype: dict
- :returns: Dictionary with 'success' or 'error' element to indicate the result of the request
+ :returns: Dictionary with 'success' or 'error' element to indicate the result of the request
"""
- page_id = id;
+ page_id = id
try:
page = trans.sa_session.query(self.app.model.Page).get(trans.security.decode_id(page_id))
except Exception, e:
@@ -130,7 +127,7 @@
#Mark a workflow as deleted
page.deleted = True
trans.sa_session.flush()
- return {"success" : "Deleted", "id" : page_id}
+ return { "success" : "Deleted", "id" : page_id }
@web.expose_api
def show( self, trans, id, **kwd ):
@@ -146,6 +143,6 @@
"""
page = trans.sa_session.query( trans.app.model.Page ).get( trans.security.decode_id( id ) )
self.security_check( trans, page, check_ownership=False, check_accessible=True)
- rval = self.encode_all_ids( trans, page.to_dict(), True)
+ rval = self.encode_all_ids( trans, page.to_dict(), True )
rval['content'] = page.latest_revision.content
- return rval
\ No newline at end of file
+ return rval
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
commit/galaxy-central: carlfeberhard: Library_contents API: Fix permissions and dataset ref on LD delete
by commits-noreply@bitbucket.org 10 Jan '14
by commits-noreply@bitbucket.org 10 Jan '14
10 Jan '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/43a964de0758/
Changeset: 43a964de0758
User: carlfeberhard
Date: 2014-01-10 22:03:04
Summary: Library_contents API: Fix permissions and dataset ref on LD delete
Affected #: 1 file
diff -r ad9661041105bbffe4772ee9bedbcf174c53eac3 -r 43a964de0758ea9deffb88fd2c59441a13cae14b lib/galaxy/webapps/galaxy/api/library_contents.py
--- a/lib/galaxy/webapps/galaxy/api/library_contents.py
+++ b/lib/galaxy/webapps/galaxy/api/library_contents.py
@@ -324,8 +324,7 @@
"""
delete( self, trans, library_id, id, **kwd )
* DELETE /api/libraries/{library_id}/contents/{id}
- delete the HDA with the given ``id``
-
+ delete the LibraryDataset with the given ``id``
:type id: str
:param id: the encoded id of the library dataset to delete
@@ -333,7 +332,7 @@
:param kwd: (optional) dictionary structure containing:
* payload: a dictionary itself containing:
- * purge: if True, purge the HDA
+ * purge: if True, purge the LD
:rtype: dict
:returns: an error object if an error occurred or a dictionary containing:
@@ -345,21 +344,34 @@
purge = False
if kwd.get( 'payload', None ):
purge = util.string_as_bool( kwd['payload'].get( 'purge', False ) )
+
rval = { 'id' : id }
try:
- hda = self.get_library_dataset( trans, id, check_ownership=False, check_accessible=True )
- hda.deleted = True
+ ld = self.get_library_dataset( trans, id, check_ownership=False, check_accessible=True )
+ user_is_admin = trans.user_is_admin()
+ can_modify = trans.app.security_agent.can_modify_library_item( trans.user.all_roles(), ld )
+ print 'is_admin: %s, can_modify: %s' % ( user_is_admin, can_modify )
+ if not ( user_is_admin or can_modify ):
+ trans.response.status = 403
+ rval.update({ 'error': 'Unauthorized to delete or purge this library dataset' })
+ return rval
+
+ ld.deleted = True
if purge:
- if not trans.app.config.allow_user_dataset_purge:
- raise exceptions.httpexceptions.HTTPForbidden(
- detail='This instance does not allow user dataset purging' )
- hda.purged = True
- trans.sa_session.add( hda )
+ ld.purged = True
+ trans.sa_session.add( ld )
trans.sa_session.flush()
- if hda.dataset.user_can_purge:
+
+ #TODO: had to change this up a bit from Dataset.user_can_purge
+ dataset = ld.library_dataset_dataset_association.dataset
+ no_history_assoc = len( dataset.history_associations ) == len( dataset.purged_history_associations )
+ no_library_assoc = dataset.library_associations == [ ld.library_dataset_dataset_association ]
+ can_purge_dataset = not dataset.purged and no_history_assoc and no_library_assoc
+
+ if can_purge_dataset:
try:
- hda.dataset.full_delete()
- trans.sa_session.add( hda.dataset )
+ ld.library_dataset_dataset_association.dataset.full_delete()
+ trans.sa_session.add( ld.dataset )
except:
pass
# flush now to preserve deleted state in case of later interruption
@@ -367,8 +379,9 @@
rval[ 'purged' ] = True
trans.sa_session.flush()
rval[ 'deleted' ] = True
+
except exceptions.httpexceptions.HTTPInternalServerError, http_server_err:
- log.exception( 'HDA API, delete: uncaught HTTPInternalServerError: %s, %s\n%s',
+ log.exception( 'Library_contents API, delete: uncaught HTTPInternalServerError: %s, %s\n%s',
id, str( kwd ), str( http_server_err ) )
raise
except exceptions.httpexceptions.HTTPException:
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: Fix tool shed functional test I just broke.
by commits-noreply@bitbucket.org 10 Jan '14
by commits-noreply@bitbucket.org 10 Jan '14
10 Jan '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/ad9661041105/
Changeset: ad9661041105
User: greg
Date: 2014-01-10 21:05:57
Summary: Fix tool shed functional test I just broke.
Affected #: 1 file
diff -r 5f6c670dca9f42d52480f66afeb91b63710e7ffb -r ad9661041105bbffe4772ee9bedbcf174c53eac3 test/tool_shed/functional/test_0000_basic_repository_features.py
--- a/test/tool_shed/functional/test_0000_basic_repository_features.py
+++ b/test/tool_shed/functional/test_0000_basic_repository_features.py
@@ -349,6 +349,6 @@
break
# Check for the changeset revision, repository name, owner username, 'repos' in the clone url, and the captured
# unicode decoding error message.
- strings_displayed = [ 'Changeset %d:%s' % ( revision_number, revision_hash ), 'filtering_0000', 'user1', 'repos', 'added:',
+ strings_displayed = [ '%d:%s' % ( revision_number, revision_hash ), 'filtering_0000', 'user1', 'repos', 'added:',
'+These characters should not' ]
- self.load_changeset_in_tool_shed( repository_id, changeset_revision, strings_displayed=strings_displayed )
\ No newline at end of file
+ self.load_changeset_in_tool_shed( repository_id, changeset_revision, strings_displayed=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: inithello: Use class instead of substrings to identify integrated tool panel tools, sections, workflows, and section labels when saving and updating the panel.
by commits-noreply@bitbucket.org 10 Jan '14
by commits-noreply@bitbucket.org 10 Jan '14
10 Jan '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/5f6c670dca9f/
Changeset: 5f6c670dca9f
User: inithello
Date: 2014-01-10 21:02:20
Summary: Use class instead of substrings to identify integrated tool panel tools, sections, workflows, and section labels when saving and updating the panel.
Affected #: 2 files
diff -r afa0a32a883dde3dee88e8cfeb2f84ba16b27f1c -r 5f6c670dca9f42d52480f66afeb91b63710e7ffb lib/galaxy/tools/__init__.py
--- a/lib/galaxy/tools/__init__.py
+++ b/lib/galaxy/tools/__init__.py
@@ -62,6 +62,7 @@
from galaxy.web import url_for
from galaxy.web.form_builder import SelectField
from galaxy.model.item_attrs import Dictifiable
+from galaxy.model import Workflow
from tool_shed.util import shed_util_common
from .loader import load_tool, template_macro_params
@@ -142,13 +143,13 @@
# 1) adjusting init_tools() and called methods to get this right
# 2) redesigning the code and/or data structure used to read/write integrated_tool_panel.xml
for key, value in self.integrated_tool_panel.iteritems():
- if key.startswith( 'section_' ):
+ if isinstance( value, ToolSection ):
for section_key, section_value in value.elems.iteritems():
if section_value is None:
- if section_key.startswith( 'tool_' ):
+ if isinstance( section_value, Tool ):
tool_id = section_key[5:]
value.elems[section_key] = self.tools_by_id.get( tool_id )
- elif section_key.startswith( 'workflow_' ):
+ elif isinstance( section_value, Workflow ):
workflow_id = section_key[9:]
value.elems[section_key] = self.workflows_by_id.get( workflow_id )
@@ -252,19 +253,19 @@
def load_tool_panel( self ):
for key, val in self.integrated_tool_panel.items():
- if key.startswith( 'tool_' ):
+ if isinstance( val, Tool ):
tool_id = key.replace( 'tool_', '', 1 )
if tool_id in self.tools_by_id:
self.__add_tool_to_tool_panel( tool_id, self.tool_panel, section=False )
- elif key.startswith( 'workflow_' ):
+ elif isinstance( val, Workflow ):
workflow_id = key.replace( 'workflow_', '', 1 )
if workflow_id in self.workflows_by_id:
workflow = self.workflows_by_id[ workflow_id ]
self.tool_panel[ key ] = workflow
log.debug( "Loaded workflow: %s %s" % ( workflow_id, workflow.name ) )
- elif key.startswith( 'label_' ):
+ elif isinstance( val, ToolSectionLabel ):
self.tool_panel[ key ] = val
- elif key.startswith( 'section_' ):
+ elif isinstance( val, ToolSection ):
elem = ElementTree.Element( 'section' )
elem.attrib[ 'id' ] = val.id or ''
elem.attrib[ 'name' ] = val.name or ''
@@ -276,13 +277,13 @@
tool_id = section_key.replace( 'tool_', '', 1 )
if tool_id in self.tools_by_id:
self.__add_tool_to_tool_panel( tool_id, section, section=True )
- elif section_key.startswith( 'workflow_' ):
+ elif isinstance( section_val, Workflow ):
workflow_id = section_key.replace( 'workflow_', '', 1 )
if workflow_id in self.workflows_by_id:
workflow = self.workflows_by_id[ workflow_id ]
section.elems[ section_key ] = workflow
log.debug( "Loaded workflow: %s %s" % ( workflow_id, workflow.name ) )
- elif section_key.startswith( 'label_' ):
+ elif isinstance( val, ToolSectionLabel ):
if section_val:
section.elems[ section_key ] = section_val
log.debug( "Loaded label: %s" % ( section_val.text ) )
@@ -315,7 +316,7 @@
elif section_elem.tag == 'label':
key = 'label_%s' % section_elem.get( 'id' )
section.elems[ key ] = None
- key = 'section_%s' % elem.get( 'id' )
+ key = elem.get( 'id' )
self.integrated_tool_panel[ key ] = section
elif elem.tag == 'label':
key = 'label_%s' % elem.get( 'id' )
@@ -331,28 +332,28 @@
os.write( fd, '<toolbox>\n' )
for key, item in self.integrated_tool_panel.items():
if item:
- if key.startswith( 'tool_' ):
+ if isinstance( item, Tool ):
os.write( fd, ' <tool id="%s" />\n' % item.id )
- elif key.startswith( 'workflow_' ):
+ elif isinstance( item, Workflow ):
os.write( fd, ' <workflow id="%s" />\n' % item.id )
- elif key.startswith( 'label_' ):
+ elif isinstance( item, ToolSectionLabel ):
label_id = item.id or ''
label_text = item.text or ''
label_version = item.version or ''
os.write( fd, ' <label id="%s" text="%s" version="%s" />\n' % ( label_id, label_text, label_version ) )
- elif key.startswith( 'section_' ):
+ elif isinstance( item, ToolSection ):
section_id = item.id or ''
section_name = item.name or ''
section_version = item.version or ''
os.write( fd, ' <section id="%s" name="%s" version="%s">\n' % ( section_id, section_name, section_version ) )
for section_key, section_item in item.elems.items():
- if section_key.startswith( 'tool_' ):
+ if isinstance( section_item, Tool ):
if section_item:
os.write( fd, ' <tool id="%s" />\n' % section_item.id )
- elif section_key.startswith( 'workflow_' ):
+ elif isinstance( section_item, Workflow ):
if section_item:
os.write( fd, ' <workflow id="%s" />\n' % section_item.id )
- elif section_key.startswith( 'label_' ):
+ elif isinstance( section_item, ToolSectionLabel ):
if section_item:
label_id = section_item.id or ''
label_text = section_item.text or ''
@@ -576,7 +577,7 @@
integrated_panel_dict.insert( index, key, label )
def load_section_tag_set( self, elem, tool_path, load_panel_dict, index=None ):
- key = 'section_' + elem.get( "id" )
+ key = elem.get( "id" )
if key in self.tool_panel:
section = self.tool_panel[ key ]
elems = section.elems
@@ -1078,14 +1079,14 @@
def get_panel_section( self ):
for key, item in self.app.toolbox.integrated_tool_panel.items():
if item:
- if key.startswith( 'tool_' ):
+ if isinstance( item, Tool ):
if item.id == self.id:
return '', ''
- if key.startswith( 'section_' ):
+ if isinstance( item, ToolSection ):
section_id = item.id or ''
section_name = item.name or ''
for section_key, section_item in item.elems.items():
- if section_key.startswith( 'tool_' ):
+ if isinstance( section_item, Tool ):
if section_item:
if section_item.id == self.id:
return section_id, section_name
diff -r afa0a32a883dde3dee88e8cfeb2f84ba16b27f1c -r 5f6c670dca9f42d52480f66afeb91b63710e7ffb lib/tool_shed/util/tool_util.py
--- a/lib/tool_shed/util/tool_util.py
+++ b/lib/tool_shed/util/tool_util.py
@@ -466,11 +466,7 @@
return sample_files, deleted_sample_files
def get_or_create_tool_section( trans, tool_panel_section_id, new_tool_panel_section_label=None ):
- if tool_panel_section_id.startswith( 'section_' ):
- tool_panel_section_key = tool_panel_section_id
- tool_panel_section_id.lstrip( 'section_' )
- else:
- tool_panel_section_key = 'section_%s' % str( tool_panel_section_id )
+ tool_panel_section_key = str( tool_panel_section_id )
if tool_panel_section_key in trans.app.toolbox.tool_panel:
# Appending a tool to an existing section in trans.app.toolbox.tool_panel
tool_section = trans.app.toolbox.tool_panel[ tool_panel_section_key ]
@@ -680,16 +676,13 @@
# received tool_panel_section_id must be the id retrieved from a tool panel config (e.g., tool_conf.xml, which
# may have getext). If new_tool_panel_section_label is received, a new section will be added to the tool panel.
if new_tool_panel_section_label:
- section_id = 'section_%s' % str( new_tool_panel_section_label.lower().replace( ' ', '_' ) )
+ section_id = str( new_tool_panel_section_label.lower().replace( ' ', '_' ) )
tool_panel_section_key, tool_section = \
get_or_create_tool_section( trans,
tool_panel_section_id=section_id,
new_tool_panel_section_label=new_tool_panel_section_label )
elif tool_panel_section_id:
- if tool_panel_section_id.startswith( 'section_' ):
- tool_panel_section_key = str( tool_panel_section_id )
- else:
- tool_panel_section_key = 'section_%s' % str( tool_panel_section_id )
+ tool_panel_section_key = str( tool_panel_section_id )
tool_section = trans.app.toolbox.tool_panel[ tool_panel_section_key ]
else:
return None, None
@@ -1000,7 +993,7 @@
for config_elem in config_elems:
if config_elem.tag == 'section':
# Get the section key for the in-memory tool panel.
- section_key = 'section_%s' % str( config_elem.get( "id" ) )
+ section_key = str( config_elem.get( "id" ) )
# Generate the list of tool elements to remove.
tool_elems_to_remove = []
for tool_elem in config_elem:
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: Include the changeset revision date whenever displaying the changeset revision for a repository in the tool shed per request by Ross Lazarus.
by commits-noreply@bitbucket.org 10 Jan '14
by commits-noreply@bitbucket.org 10 Jan '14
10 Jan '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/afa0a32a883d/
Changeset: afa0a32a883d
User: greg
Date: 2014-01-10 20:30:18
Summary: Include the changeset revision date whenever displaying the changeset revision for a repository in the tool shed per request by Ross Lazarus.
Affected #: 18 files
diff -r c8d2e455f0e865662028d831d20a83316f2ab33f -r afa0a32a883dde3dee88e8cfeb2f84ba16b27f1c lib/galaxy/webapps/tool_shed/controllers/repository.py
--- a/lib/galaxy/webapps/tool_shed/controllers/repository.py
+++ b/lib/galaxy/webapps/tool_shed/controllers/repository.py
@@ -2432,6 +2432,7 @@
message='Select a repository to rate',
status='error' ) )
repository = suc.get_repository_in_tool_shed( trans, id )
+ changeset_revision = repository.tip( trans.app )
repo = hg.repository( suc.get_configured_ui(), repository.repo_path( trans.app ) )
if repository.user == trans.user:
return trans.response.send_redirect( web.url_for( controller='repository',
@@ -2447,12 +2448,14 @@
rra = self.get_user_item_rating( trans.sa_session, trans.user, repository, webapp_model=trans.model )
metadata = metadata_util.get_repository_metadata_by_repository_id_changeset_revision( trans,
id,
- repository.tip( trans.app ),
+ changeset_revision,
metadata_only=True )
repository_type_select_field = rt_util.build_repository_type_select_field( trans, repository=repository )
+ revision_label = suc.get_revision_label( trans, repository, changeset_revision )
return trans.fill_template( '/webapps/tool_shed/repository/rate_repository.mako',
repository=repository,
metadata=metadata,
+ revision_label=revision_label,
avg_rating=avg_rating,
display_reviews=display_reviews,
num_ratings=num_ratings,
@@ -2862,13 +2865,10 @@
has_metadata = True
else:
has_metadata = False
- t, tz = ctx.date()
- date = datetime( *gmtime( float( t ) - tz )[:6] )
- display_date = date.strftime( "%Y-%m-%d" )
change_dict = { 'ctx' : ctx,
'rev' : str( ctx.rev() ),
'date' : date,
- 'display_date' : display_date,
+ 'display_date' : suc.get_readable_ctx_date( ctx ),
'description' : ctx.description(),
'files' : ctx.files(),
'user' : ctx.user(),
@@ -2923,16 +2923,18 @@
metadata = metadata_util.get_repository_metadata_by_repository_id_changeset_revision( trans, id, ctx_str, metadata_only=True )
# For rendering the prev button.
if ctx_parent:
+ ctx_parent_date = suc.get_readable_ctx_date( ctx_parent )
ctx_parent_rev = ctx_parent.rev()
if ctx_parent_rev < 0:
prev = None
else:
- prev = "%s:%s" % ( ctx_parent_rev, ctx_parent )
+ prev = "<b>%s:%s</b><i>(%s)</i>" % ( ctx_parent_rev, ctx_parent, ctx_parent_date )
else:
prev = None
if ctx_child:
+ ctx_child_date = suc.get_readable_ctx_date( ctx_child )
ctx_child_rev = ctx_child.rev()
- next = "%s:%s" % ( ctx_child_rev, ctx_child )
+ next = "<b>%s:%s</b><i>(%s)</i>" % ( ctx_child_rev, ctx_child, ctx_child_date )
else:
next = None
return trans.fill_template( '/webapps/tool_shed/repository/view_changeset.mako',
diff -r c8d2e455f0e865662028d831d20a83316f2ab33f -r afa0a32a883dde3dee88e8cfeb2f84ba16b27f1c lib/tool_shed/grids/admin_grids.py
--- a/lib/tool_shed/grids/admin_grids.py
+++ b/lib/tool_shed/grids/admin_grids.py
@@ -19,48 +19,72 @@
class UserGrid( grids.Grid ):
- # TODO: move this to an admin_common controller since it is virtually the same in the galaxy webapp.
+
+
class UserLoginColumn( grids.TextColumn ):
+
def get_value( self, trans, grid, user ):
return user.email
+
+
class UserNameColumn( grids.TextColumn ):
+
def get_value( self, trans, grid, user ):
if user.username:
return user.username
return 'not set'
+
+
class GroupsColumn( grids.GridColumn ):
+
def get_value( self, trans, grid, user ):
if user.groups:
return len( user.groups )
return 0
+
+
class RolesColumn( grids.GridColumn ):
+
def get_value( self, trans, grid, user ):
if user.roles:
return len( user.roles )
return 0
+
+
class ExternalColumn( grids.GridColumn ):
+
def get_value( self, trans, grid, user ):
if user.external:
return 'yes'
return 'no'
+
+
class LastLoginColumn( grids.GridColumn ):
+
def get_value( self, trans, grid, user ):
if user.galaxy_sessions:
return self.format( user.galaxy_sessions[ 0 ].update_time )
return 'never'
+
+
class StatusColumn( grids.GridColumn ):
+
def get_value( self, trans, grid, user ):
if user.purged:
return "purged"
elif user.deleted:
return "deleted"
return ""
+
+
class EmailColumn( grids.GridColumn ):
+
def filter( self, trans, user, query, column_filter ):
if column_filter == 'All':
return query
return query.filter( and_( model.Tool.table.c.user_id == model.User.table.c.id,
model.User.table.c.email == column_filter ) )
+
title = "Users"
model_class = model.User
template='/admin/user/grid.mako'
@@ -114,37 +138,56 @@
num_rows_per_page = 50
preserve_state = False
use_paging = True
+
def get_current_item( self, trans, **kwargs ):
return trans.user
+
class RoleGrid( grids.Grid ):
- # TODO: move this to an admin_common controller since it is virtually the same in the galaxy webapp.
+
+
class NameColumn( grids.TextColumn ):
+
def get_value( self, trans, grid, role ):
return role.name
+
+
class DescriptionColumn( grids.TextColumn ):
+
def get_value( self, trans, grid, role ):
if role.description:
return role.description
return ''
+
+
class TypeColumn( grids.TextColumn ):
def get_value( self, trans, grid, role ):
return role.type
+
+
class StatusColumn( grids.GridColumn ):
+
def get_value( self, trans, grid, role ):
if role.deleted:
return "deleted"
return ""
+
+
class GroupsColumn( grids.GridColumn ):
+
def get_value( self, trans, grid, role ):
if role.groups:
return len( role.groups )
return 0
+
+
class UsersColumn( grids.GridColumn ):
+
def get_value( self, trans, grid, role ):
if role.users:
return len( role.users )
return 0
+
title = "Roles"
model_class = model.Role
template='/admin/dataset_security/role/grid.mako'
@@ -205,29 +248,43 @@
num_rows_per_page = 50
preserve_state = False
use_paging = True
+
def apply_query_filter( self, trans, query, **kwd ):
return query.filter( model.Role.type != model.Role.types.PRIVATE )
+
class GroupGrid( grids.Grid ):
- # TODO: move this to an admin_common controller since it is virtually the same in the galaxy webapp.
+
+
class NameColumn( grids.TextColumn ):
+
def get_value( self, trans, grid, group ):
return group.name
+
+
class StatusColumn( grids.GridColumn ):
+
def get_value( self, trans, grid, group ):
if group.deleted:
return "deleted"
return ""
+
+
class RolesColumn( grids.GridColumn ):
+
def get_value( self, trans, grid, group ):
if group.roles:
return len( group.roles )
return 0
+
+
class UsersColumn( grids.GridColumn ):
+
def get_value( self, trans, grid, group ):
if group.members:
return len( group.members )
return 0
+
title = "Groups"
model_class = model.Group
template='/admin/dataset_security/group/grid.mako'
@@ -279,6 +336,7 @@
preserve_state = False
use_paging = True
+
class ManageCategoryGrid( CategoryGrid ):
columns = [ col for col in CategoryGrid.columns ]
# Override the NameColumn to include an Edit link
@@ -292,12 +350,17 @@
dict( controller='admin', action='manage_categories', operation='create' ) )
]
+
class AdminRepositoryGrid( RepositoryGrid ):
+
+
class DeletedColumn( grids.BooleanColumn ):
+
def get_value( self, trans, grid, repository ):
if repository.deleted:
return 'yes'
return ''
+
columns = [ RepositoryGrid.NameColumn( "Name",
key="name",
link=( lambda item: dict( operation="view_or_manage_repository", id=item.id ) ),
@@ -326,27 +389,43 @@
async_compatible=False ) )
standard_filters = []
default_filter = {}
+
def build_initial_query( self, trans, **kwd ):
return trans.sa_session.query( model.Repository ) \
.join( model.User.table )
+
class RepositoryMetadataGrid( grids.Grid ):
+
+
class IdColumn( grids.IntegerColumn ):
+
def get_value( self, trans, grid, repository_metadata ):
return repository_metadata.id
+
+
class NameColumn( grids.TextColumn ):
+
def get_value( self, trans, grid, repository_metadata ):
return repository_metadata.repository.name
+
+
class OwnerColumn( grids.TextColumn ):
+
def get_value( self, trans, grid, repository_metadata ):
return repository_metadata.repository.user.username
+
class RevisionColumn( grids.TextColumn ):
+
def get_value( self, trans, grid, repository_metadata ):
repository = repository_metadata.repository
repo = hg.repository( suc.get_configured_ui(), repository.repo_path( trans.app ) )
ctx = suc.get_changectx_for_changeset( repo, repository_metadata.changeset_revision )
- return "%s:%s" % ( str( ctx.rev() ), repository_metadata.changeset_revision )
+ return suc.get_revision_label( trans, repository, repository_metadata.changeset_revision )
+
+
class ToolsColumn( grids.TextColumn ):
+
def get_value( self, trans, grid, repository_metadata ):
tools_str = '0'
if repository_metadata:
@@ -358,7 +437,10 @@
# tools_str += '%s <b>%s</b><br/>' % ( tool_metadata_dict[ 'id' ], tool_metadata_dict[ 'version' ] )
return '%d' % len( metadata[ 'tools' ] )
return tools_str
+
+
class DatatypesColumn( grids.TextColumn ):
+
def get_value( self, trans, grid, repository_metadata ):
datatypes_str = '0'
if repository_metadata:
@@ -370,7 +452,10 @@
# datatypes_str += '%s<br/>' % datatype_metadata_dict[ 'extension' ]
return '%d' % len( metadata[ 'datatypes' ] )
return datatypes_str
+
+
class WorkflowsColumn( grids.TextColumn ):
+
def get_value( self, trans, grid, repository_metadata ):
workflows_str = '0'
if repository_metadata:
@@ -387,21 +472,31 @@
# workflows_str += '%s<br/>' % workflow_metadata_dict[ 'name' ]
return '%d' % len( metadata[ 'workflows' ] )
return workflows_str
+
+
class DeletedColumn( grids.BooleanColumn ):
+
def get_value( self, trans, grid, repository_metadata ):
if repository_metadata.repository.deleted:
return 'yes'
return ''
+
+
class DeprecatedColumn( grids.BooleanColumn ):
+
def get_value( self, trans, grid, repository_metadata ):
if repository_metadata.repository.deprecated:
return 'yes'
return ''
+
+
class MaliciousColumn( grids.BooleanColumn ):
+
def get_value( self, trans, grid, repository_metadata ):
if repository_metadata.malicious:
return 'yes'
return ''
+
# Grid definition
title = "Repository Metadata"
model_class = model.RepositoryMetadata
@@ -440,6 +535,7 @@
num_rows_per_page = 50
preserve_state = False
use_paging = True
+
def build_initial_query( self, trans, **kwd ):
return trans.sa_session.query( model.RepositoryMetadata ) \
.join( model.Repository.table )
diff -r c8d2e455f0e865662028d831d20a83316f2ab33f -r afa0a32a883dde3dee88e8cfeb2f84ba16b27f1c lib/tool_shed/grids/repository_grids.py
--- a/lib/tool_shed/grids/repository_grids.py
+++ b/lib/tool_shed/grids/repository_grids.py
@@ -101,6 +101,10 @@
if len( select_field.options ) > 1:
return select_field.get_html()
elif len( select_field.options ) == 1:
+ option_items = select_field.options[ 0 ][ 0 ]
+ rev_label, rev_date = option_items.split( ' ' )
+ rev_date = '<i><font color="#666666">%s</font></i>' % rev_date
+ return '%s %s' % ( rev_label, rev_date )
return select_field.options[ 0 ][ 0 ]
return ''
@@ -1134,7 +1138,7 @@
repository = repository_metadata.repository
changeset_revision = repository_metadata.changeset_revision
changeset_revision_label = suc.get_revision_label( trans, repository, changeset_revision )
- return escape_html( changeset_revision_label )
+ return changeset_revision_label
class MaliciousColumn( grids.BooleanColumn ):
diff -r c8d2e455f0e865662028d831d20a83316f2ab33f -r afa0a32a883dde3dee88e8cfeb2f84ba16b27f1c lib/tool_shed/grids/repository_review_grids.py
--- a/lib/tool_shed/grids/repository_review_grids.py
+++ b/lib/tool_shed/grids/repository_review_grids.py
@@ -83,9 +83,10 @@
if repository_metadata_revisions:
rval = ''
for repository_metadata in repository_metadata_revisions:
- rev, label, changeset_revision = metadata_util.get_rev_label_changeset_revision_from_repository_metadata( trans,
- repository_metadata,
- repository=repository )
+ rev, label, changeset_revision = \
+ metadata_util.get_rev_label_changeset_revision_from_repository_metadata( trans,
+ repository_metadata,
+ repository=repository )
rval += '<a href="manage_repository_reviews_of_revision?id=%s&changeset_revision=%s">%s</a><br/>' % \
( trans.security.encode_id( repository.id ), changeset_revision, label )
return rval
diff -r c8d2e455f0e865662028d831d20a83316f2ab33f -r afa0a32a883dde3dee88e8cfeb2f84ba16b27f1c lib/tool_shed/grids/util.py
--- a/lib/tool_shed/grids/util.py
+++ b/lib/tool_shed/grids/util.py
@@ -16,7 +16,8 @@
select_field.add_option( option_tup[ 0 ], option_tup[ 1 ], selected=selected )
return select_field
-def build_changeset_revision_select_field( trans, repository, selected_value=None, add_id_to_name=True, downloadable=False, reviewed=False, not_reviewed=False ):
+def build_changeset_revision_select_field( trans, repository, selected_value=None, add_id_to_name=True,
+ downloadable=False, reviewed=False, not_reviewed=False ):
"""Build a SelectField whose options are the changeset_rev strings of certain revisions of the received repository."""
options = []
changeset_tups = []
@@ -46,7 +47,10 @@
# Restrict the options to all revisions that have associated metadata.
repository_metadata_revisions = repository.metadata_revisions
for repository_metadata in repository_metadata_revisions:
- rev, label, changeset_revision = metadata_util.get_rev_label_changeset_revision_from_repository_metadata( trans, repository_metadata, repository=repository )
+ rev, label, changeset_revision = \
+ metadata_util.get_rev_label_changeset_revision_from_repository_metadata( trans,
+ repository_metadata,
+ repository=repository )
changeset_tups.append( ( rev, label, changeset_revision ) )
refresh_on_change_values.append( changeset_revision )
# Sort options by the revision label. Even though the downloadable_revisions query sorts by update_time,
diff -r c8d2e455f0e865662028d831d20a83316f2ab33f -r afa0a32a883dde3dee88e8cfeb2f84ba16b27f1c lib/tool_shed/util/metadata_util.py
--- a/lib/tool_shed/util/metadata_util.py
+++ b/lib/tool_shed/util/metadata_util.py
@@ -1108,16 +1108,19 @@
changeset_revision = repository_metadata.changeset_revision
ctx = suc.get_changectx_for_changeset( repo, changeset_revision )
if ctx:
+ changeset_revision_date = suc.get_readable_ctx_date( ctx )
rev = '%04d' % ctx.rev()
- label = "%s:%s" % ( str( ctx.rev() ), changeset_revision )
+ label = "%s:%s (%s)" % ( str( ctx.rev() ), changeset_revision, changeset_revision_date )
else:
rev = '-1'
label = "-1:%s" % changeset_revision
return rev, label, changeset_revision
-def get_sample_files_from_disk( repository_files_dir, tool_path=None, relative_install_dir=None, resetting_all_metadata_on_repository=False ):
+def get_sample_files_from_disk( repository_files_dir, tool_path=None, relative_install_dir=None,
+ resetting_all_metadata_on_repository=False ):
if resetting_all_metadata_on_repository:
- # Keep track of the location where the repository is temporarily cloned so that we can strip it when setting metadata.
+ # Keep track of the location where the repository is temporarily cloned so that we can strip
+ # it when setting metadata.
work_dir = repository_files_dir
sample_file_metadata_paths = []
sample_file_copy_paths = []
diff -r c8d2e455f0e865662028d831d20a83316f2ab33f -r afa0a32a883dde3dee88e8cfeb2f84ba16b27f1c lib/tool_shed/util/shed_util_common.py
--- a/lib/tool_shed/util/shed_util_common.py
+++ b/lib/tool_shed/util/shed_util_common.py
@@ -924,6 +924,13 @@
return trans.install_model.context.query( trans.install_model.ToolShedRepository ) \
.filter( trans.install_model.ToolShedRepository.table.c.uninstalled == False )
+def get_readable_ctx_date( ctx ):
+ """Convert the date of the changeset (the received ctx) to a human-readable date."""
+ t, tz = ctx.date()
+ date = datetime( *gmtime( float( t ) - tz )[ :6 ] )
+ ctx_date = date.strftime( "%Y-%m-%d" )
+ return ctx_date
+
def get_repo_info_tuple_contents( repo_info_tuple ):
"""Take care in handling the repo_info_tuple as it evolves over time as new tool shed features are introduced."""
if len( repo_info_tuple ) == 6:
@@ -1206,7 +1213,8 @@
repo = hg.repository( get_configured_ui(), repository.repo_path( trans.app ) )
ctx = get_changectx_for_changeset( repo, changeset_revision )
if ctx:
- return "%s:%s" % ( str( ctx.rev() ), changeset_revision )
+ return '%s:%s <i><font color="#666666">(%s)</font></i>' % \
+ ( str( ctx.rev() ), changeset_revision, str( get_readable_ctx_date( ctx ) ) )
else:
return "-1:%s" % changeset_revision
@@ -1215,7 +1223,8 @@
ctx = get_changectx_for_changeset( repo, changeset_revision )
if ctx:
rev = '%04d' % ctx.rev()
- label = "%s:%s" % ( str( ctx.rev() ), changeset_revision )
+ label = '%s:%s <i><font color="#666666">(%s)</font></i>' % \
+ ( str( ctx.rev() ), changeset_revision, str( get_readable_ctx_date( ctx ) ) )
else:
rev = '-1'
label = "-1:%s" % changeset_revision
@@ -1477,9 +1486,6 @@
email_from = 'galaxy-no-reply@' + trans.request.host.split( ':' )[0]
tip_changeset = repo.changelog.tip()
ctx = repo.changectx( tip_changeset )
- t, tz = ctx.date()
- date = datetime( *gmtime( float( t ) - tz )[:6] )
- display_date = date.strftime( "%Y-%m-%d" )
try:
username = ctx.user().split()[0]
except:
@@ -1490,6 +1496,7 @@
template = new_repo_email_alert_template
else:
template = email_alert_template
+ display_date = get_readable_ctx_date( ctx )
admin_body = string.Template( template ).safe_substitute( host=trans.request.host,
sharable_link=sharable_link,
repository_name=repository.name,
diff -r c8d2e455f0e865662028d831d20a83316f2ab33f -r afa0a32a883dde3dee88e8cfeb2f84ba16b27f1c templates/webapps/tool_shed/common/repository_actions_menu.mako
--- a/templates/webapps/tool_shed/common/repository_actions_menu.mako
+++ b/templates/webapps/tool_shed/common/repository_actions_menu.mako
@@ -174,7 +174,9 @@
<a class="action-button" target="galaxy_main" href="${h.url_for( controller='repository', action='deprecate', id=trans.security.encode_id( repository.id ), mark_deprecated=False )}">Mark repository as not deprecated</a>
%endif
%if can_download:
- <a class="action-button" href="${h.url_for( controller='repository', action='export', repository_id=trans.app.security.encode_id( repository.id ), changeset_revision=changeset_revision )}">Export this revision</a>
+ %if changeset_revision is not None:
+ <a class="action-button" href="${h.url_for( controller='repository', action='export', repository_id=trans.app.security.encode_id( repository.id ), changeset_revision=changeset_revision )}">Export this revision</a>
+ %endif
<a class="action-button" href="${h.url_for( controller='repository', action='download', repository_id=trans.app.security.encode_id( repository.id ), changeset_revision=repository.tip( trans.app ), file_type='gz' )}">Download as a .tar.gz file</a><a class="action-button" href="${h.url_for( controller='repository', action='download', repository_id=trans.app.security.encode_id( repository.id ), changeset_revision=repository.tip( trans.app ), file_type='bz2' )}">Download as a .tar.bz2 file</a><a class="action-button" href="${h.url_for( controller='repository', action='download', repository_id=trans.app.security.encode_id( repository.id ), changeset_revision=repository.tip( trans.app ), file_type='zip' )}">Download as a zip file</a>
diff -r c8d2e455f0e865662028d831d20a83316f2ab33f -r afa0a32a883dde3dee88e8cfeb2f84ba16b27f1c templates/webapps/tool_shed/repository/manage_repository.mako
--- a/templates/webapps/tool_shed/repository/manage_repository.mako
+++ b/templates/webapps/tool_shed/repository/manage_repository.mako
@@ -181,9 +181,9 @@
<div class="form-row"><label>Revision:</label>
%if can_view_change_log:
- <a href="${h.url_for( controller='repository', action='view_changelog', id=trans.app.security.encode_id( repository.id ) )}">${revision_label | h}</a>
+ <a href="${h.url_for( controller='repository', action='view_changelog', id=trans.app.security.encode_id( repository.id ) )}">${revision_label}</a>
%else:
- ${revision_label | h}
+ ${revision_label}
%endif
</div><div class="form-row">
diff -r c8d2e455f0e865662028d831d20a83316f2ab33f -r afa0a32a883dde3dee88e8cfeb2f84ba16b27f1c templates/webapps/tool_shed/repository/preview_tools_in_changeset.mako
--- a/templates/webapps/tool_shed/repository/preview_tools_in_changeset.mako
+++ b/templates/webapps/tool_shed/repository/preview_tools_in_changeset.mako
@@ -51,7 +51,7 @@
%else:
<div class="form-row"><label>Revision:</label>
- ${revision_label | h}
+ ${revision_label}
</div>
%endif
</div>
diff -r c8d2e455f0e865662028d831d20a83316f2ab33f -r afa0a32a883dde3dee88e8cfeb2f84ba16b27f1c templates/webapps/tool_shed/repository/rate_repository.mako
--- a/templates/webapps/tool_shed/repository/rate_repository.mako
+++ b/templates/webapps/tool_shed/repository/rate_repository.mako
@@ -44,16 +44,20 @@
${render_clone_str( repository )}
</div>
%endif
- ${render_repository_type_select_field( repository_type_select_field, render_help=False )}
<div class="toolFormBody"><div class="form-row">
+ <label>Type:</label>
+ ${repository.type | h}
+ <div style="clear: both"></div>
+ </div>
+ <div class="form-row"><label>Description:</label>
${repository.description | h}
<div style="clear: both"></div></div><div class="form-row">
- <label>Version:</label>
- ${repository.revision( trans.app ) | h}
+ <label>Revision:</label>
+ ${revision_label}
<div style="clear: both"></div></div><div class="form-row">
diff -r c8d2e455f0e865662028d831d20a83316f2ab33f -r afa0a32a883dde3dee88e8cfeb2f84ba16b27f1c templates/webapps/tool_shed/repository/view_changelog.mako
--- a/templates/webapps/tool_shed/repository/view_changelog.mako
+++ b/templates/webapps/tool_shed/repository/view_changelog.mako
@@ -5,7 +5,6 @@
<%namespace file="/webapps/tool_shed/common/repository_actions_menu.mako" import="render_tool_shed_repository_actions" /><%
- from galaxy.web.framework.helpers import time_ago
is_new = repository.is_new( trans.app )
can_push = trans.app.security_agent.can_push( trans.app, trans.user, repository )
can_download = not is_new and ( not is_malicious or can_push )
@@ -108,7 +107,7 @@
</div><div class="form-row"><label>Pushed:</label>
- ${time_ago( changeset[ 'date' ] )}
+ ${changeset[ 'display_date' ]}
</div></td></tr>
diff -r c8d2e455f0e865662028d831d20a83316f2ab33f -r afa0a32a883dde3dee88e8cfeb2f84ba16b27f1c templates/webapps/tool_shed/repository/view_changeset.mako
--- a/templates/webapps/tool_shed/repository/view_changeset.mako
+++ b/templates/webapps/tool_shed/repository/view_changeset.mako
@@ -49,13 +49,15 @@
%endif
<div class="toolForm"><%
+ from tool_shed.util.shed_util_common import get_readable_ctx_date
+ changeset_revision_date = get_readable_ctx_date( ctx )
if can_download:
- title_str = 'Changeset %s:%s' % ( ctx.rev(), ctx )
+ title_str = 'Changeset <b>%s:%s</b><i>(%s)</i>' % ( ctx.rev(), ctx, changeset_revision_date )
else:
- title_str = '%s changeset %s:%s' % ( repository.name, ctx.rev(), ctx )
+ title_str = '%s changeset <b>%s:%s</b><i>(%s)</i>' % ( repository.name, ctx.rev(), ctx, changeset_revision_date )
%><div class="toolFormTitle">
- ${title_str | h}
+ ${title_str}
</div><div class="toolFormBody"><table class="grid">
@@ -63,10 +65,10 @@
<tr><td>
%if prev:
- <a class="action-button" href="${h.url_for( controller='repository', action='view_changeset', id=trans.security.encode_id( repository.id ), ctx_str=ctx_parent )}">Previous changeset ${prev | h}</a>
+ <a class="action-button" href="${h.url_for( controller='repository', action='view_changeset', id=trans.security.encode_id( repository.id ), ctx_str=ctx_parent )}">Previous changeset ${prev}</a>
%endif
%if next:
- <a class="action-button" href="${h.url_for( controller='repository', action='view_changeset', id=trans.security.encode_id( repository.id ), ctx_str=ctx_child )}">Next changeset ${next | h}</a>
+ <a class="action-button" href="${h.url_for( controller='repository', action='view_changeset', id=trans.security.encode_id( repository.id ), ctx_str=ctx_child )}">Next changeset ${next}</a>
%endif
</td></tr>
diff -r c8d2e455f0e865662028d831d20a83316f2ab33f -r afa0a32a883dde3dee88e8cfeb2f84ba16b27f1c templates/webapps/tool_shed/repository/view_repository.mako
--- a/templates/webapps/tool_shed/repository/view_repository.mako
+++ b/templates/webapps/tool_shed/repository/view_repository.mako
@@ -100,7 +100,11 @@
${repository.name | h}
%endif
</div>
- ${render_repository_type_select_field( repository_type_select_field, render_help=False )}
+ <div class="form-row">
+ <label>Type:</label>
+ ${repository.type | h}
+ <div style="clear: both"></div>
+ </div><div class="form-row"><label>Synopsis:</label>
${repository.description | h}
@@ -113,7 +117,7 @@
%if can_view_change_log:
<a href="${h.url_for( controller='repository', action='view_changelog', id=trans.app.security.encode_id( repository.id ) )}">${revision_label}</a>
%else:
- ${revision_label | h}
+ ${revision_label}
%endif
</div><div class="form-row">
diff -r c8d2e455f0e865662028d831d20a83316f2ab33f -r afa0a32a883dde3dee88e8cfeb2f84ba16b27f1c templates/webapps/tool_shed/repository_review/browse_review.mako
--- a/templates/webapps/tool_shed/repository_review/browse_review.mako
+++ b/templates/webapps/tool_shed/repository_review/browse_review.mako
@@ -34,7 +34,7 @@
</div><div class="form-row"><label>Repository revision:</label>
- <a class="action-button" href="${h.url_for( controller='repository_review', action='view_or_manage_repository', id=trans.security.encode_id( repository.id ), changeset_revision=review.changeset_revision )}">${changeset_revision_label | h}</a>
+ <a class="action-button" href="${h.url_for( controller='repository_review', action='view_or_manage_repository', id=trans.security.encode_id( repository.id ), changeset_revision=review.changeset_revision )}">${changeset_revision_label}</a><div style="clear: both"></div></div><div class="form-row">
diff -r c8d2e455f0e865662028d831d20a83316f2ab33f -r afa0a32a883dde3dee88e8cfeb2f84ba16b27f1c templates/webapps/tool_shed/repository_review/reviews_of_changeset_revision.mako
--- a/templates/webapps/tool_shed/repository_review/reviews_of_changeset_revision.mako
+++ b/templates/webapps/tool_shed/repository_review/reviews_of_changeset_revision.mako
@@ -45,7 +45,7 @@
<div class="toolFormBody"><div class="form-row"><label>Revision:</label>
- <a class="action-button" href="${h.url_for( controller='repository_review', action='view_or_manage_repository', id=trans.security.encode_id( repository.id ), changeset_revision=changeset_revision )}">${changeset_revision_label | h}</a>
+ <a class="action-button" href="${h.url_for( controller='repository_review', action='view_or_manage_repository', id=trans.security.encode_id( repository.id ), changeset_revision=changeset_revision )}">${changeset_revision_label}</a><div style="clear: both"></div></div><div class="form-row">
diff -r c8d2e455f0e865662028d831d20a83316f2ab33f -r afa0a32a883dde3dee88e8cfeb2f84ba16b27f1c templates/webapps/tool_shed/repository_review/reviews_of_repository.mako
--- a/templates/webapps/tool_shed/repository_review/reviews_of_repository.mako
+++ b/templates/webapps/tool_shed/repository_review/reviews_of_repository.mako
@@ -67,7 +67,7 @@
<tr><td><div style="float:left;" class="menubutton split popup" id="${changeset_revision}-popup">
- <a class="view-info" href="${h.url_for( controller='repository_review', action='view_or_manage_repository', id=trans.security.encode_id( repository.id ), changeset_revision=changeset_revision )}">${changeset_revision_label | h}</a>
+ <a class="view-info" href="${h.url_for( controller='repository_review', action='view_or_manage_repository', id=trans.security.encode_id( repository.id ), changeset_revision=changeset_revision )}">${changeset_revision_label}</a></div><div popupmenu="${changeset_revision}-popup">
%if repository_reviews:
diff -r c8d2e455f0e865662028d831d20a83316f2ab33f -r afa0a32a883dde3dee88e8cfeb2f84ba16b27f1c templates/webapps/tool_shed/repository_review/select_previous_review.mako
--- a/templates/webapps/tool_shed/repository_review/select_previous_review.mako
+++ b/templates/webapps/tool_shed/repository_review/select_previous_review.mako
@@ -30,7 +30,7 @@
%endif
<div class="warningmessage">
- You have elected to create a new review for revision <b>${changeset_revision_label | h}</b>of this repository. Since previous revisions have been reviewed,
+ You have elected to create a new review for revision <b>${changeset_revision_label}</b>of this repository. Since previous revisions have been reviewed,
you can select a previous review to copy to your new review, or click the <b>Create a review without copying</b> button.
</div>
@@ -39,7 +39,7 @@
<div class="toolFormBody"><div class="form-row"><label>Revision for new review:</label>
- <a class="action-button" href="${h.url_for( controller='repository_review', action='view_or_manage_repository', id=trans.security.encode_id( repository.id ), changeset_revision=changeset_revision )}">${changeset_revision_label | h}</a>
+ <a class="action-button" href="${h.url_for( controller='repository_review', action='view_or_manage_repository', id=trans.security.encode_id( repository.id ), changeset_revision=changeset_revision )}">${changeset_revision_label}</a><div style="clear: both"></div></div><div class="form-row">
@@ -76,7 +76,7 @@
<a class="action-button" href="${h.url_for( controller='repository_review', action='create_review', id=trans.security.encode_id( repository.id ), changeset_revision=changeset_revision, previous_review_id=encoded_review_id )}">Copy this review</a></div></td>
- <td>${previous_changeset_revision_label | h}</td>
+ <td>${previous_changeset_revision_label}</td><td>${render_star_rating( repository_rating_name, review.rating, disabled=True )}</td><td>${approved_str | h}</td></tr>
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: dannon: Temporarily add simplejson back until webhelpers is updated
by commits-noreply@bitbucket.org 10 Jan '14
by commits-noreply@bitbucket.org 10 Jan '14
10 Jan '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/c8d2e455f0e8/
Changeset: c8d2e455f0e8
User: dannon
Date: 2014-01-10 20:22:03
Summary: Temporarily add simplejson back until webhelpers is updated
Affected #: 1 file
diff -r d7b4edc2d749d9835f61dccaab0e17614a9cd336 -r c8d2e455f0e865662028d831d20a83316f2ab33f eggs.ini
--- a/eggs.ini
+++ b/eggs.ini
@@ -26,6 +26,7 @@
pysam = 0.4.2
pysqlite = 2.5.6
python_lzo = 1.08_2.03_static
+simplejson = 2.1.1
threadframe = 0.2
guppy = 0.1.8
SQLAlchemy = 0.7.9
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/7a411112a661/
Changeset: 7a411112a661
User: takadonet
Date: 2013-11-08 16:38:08
Summary: added API call to delete library dataset
Affected #: 1 file
diff -r b9e7d751cfb5a263d778786efa4e4b4e965b3992 -r 7a411112a66155050c748c667c47cf7f6dd24d7e lib/galaxy/webapps/galaxy/api/library_contents.py
--- a/lib/galaxy/webapps/galaxy/api/library_contents.py
+++ b/lib/galaxy/webapps/galaxy/api/library_contents.py
@@ -2,8 +2,7 @@
API operations on the contents of a library.
"""
import logging
-
-from galaxy import web
+from galaxy import web , exceptions
from galaxy.model import ExtendedMetadata, ExtendedMetadataIndex
from galaxy.web.base.controller import BaseAPIController, UsesLibraryMixin, UsesLibraryMixinItems
from galaxy.web.base.controller import UsesHistoryDatasetAssociationMixin
@@ -318,3 +317,67 @@
return 'LibraryFolder', content_id[1:]
else:
raise HTTPBadRequest( 'Malformed library content id ( %s ) specified, unable to decode.' % str( content_id ) )
+
+
+ @web.expose_api
+ def delete( self, trans, library_id, id, **kwd ):
+ """
+ delete( self, trans, library_id, id, **kwd )
+ * DELETE /api/libraries/{library_id}/contents/{id}
+ delete the HDA with the given ``id``
+
+
+ :type id: str
+ :param id: the encoded id of the library dataset to delete
+ :type kwd: dict
+ :param kwd: (optional) dictionary structure containing:
+
+ * payload: a dictionary itself containing:
+ * purge: if True, purge the HDA
+
+ :rtype: dict
+ :returns: an error object if an error occurred or a dictionary containing:
+ * id: the encoded id of the library dataset,
+ * deleted: if the library dataset was marked as deleted,
+ * purged: if the library dataset was purged
+ """
+ # a request body is optional here
+ purge = False
+ if kwd.get( 'payload', None ):
+ purge = util.string_as_bool( kwd['payload'].get( 'purge', False ) )
+ rval = { 'id' : id }
+ try:
+ hda = self.get_library_dataset( trans, id, check_ownership=False, check_accessible=True )
+ hda.deleted = True
+ if purge:
+ if not trans.app.config.allow_user_dataset_purge:
+ raise exceptions.httpexceptions.HTTPForbidden(
+ detail='This instance does not allow user dataset purging' )
+ hda.purged = True
+ trans.sa_session.add( hda )
+ trans.sa_session.flush()
+ if hda.dataset.user_can_purge:
+ try:
+ hda.dataset.full_delete()
+ trans.sa_session.add( hda.dataset )
+ except:
+ pass
+ # flush now to preserve deleted state in case of later interruption
+ trans.sa_session.flush()
+ rval[ 'purged' ] = True
+ trans.sa_session.flush()
+ rval[ 'deleted' ] = True
+ except exceptions.httpexceptions.HTTPInternalServerError, http_server_err:
+ log.exception( 'HDA API, delete: uncaught HTTPInternalServerError: %s, %s\n%s',
+ id, str( kwd ), str( http_server_err ) )
+ raise
+ except exceptions.httpexceptions.HTTPException:
+ raise
+ except Exception, exc:
+ log.exception( 'HDA API, delete: uncaught exception: %s, %s\n%s',
+ id, str( kwd ), str( exc ) )
+ trans.response.status = 500
+ rval.update({ 'error': str( exc ) })
+ return rval
+
+
https://bitbucket.org/galaxy/galaxy-central/commits/69669b88ac78/
Changeset: 69669b88ac78
User: takadonet
Date: 2013-11-08 16:38:37
Summary: Merged galaxy/galaxy-central into default
Affected #: 1 file
diff -r 7a411112a66155050c748c667c47cf7f6dd24d7e -r 69669b88ac784f8db470772f15bb17e13c314fa7 lib/galaxy/tools/parameters/basic.py
--- a/lib/galaxy/tools/parameters/basic.py
+++ b/lib/galaxy/tools/parameters/basic.py
@@ -174,8 +174,12 @@
def to_dict( self, trans, view='collection', value_mapper=None ):
""" to_dict tool parameter. This can be overridden by subclasses. """
tool_dict = super( ToolParameter, self ).to_dict()
- #TODO: removing html as it causes a lot of errors on subclasses - needs histories, etc.
- #tool_dict[ 'html' ] = urllib.quote( self.get_html( trans ) )
+ #TODO: wrapping html as it causes a lot of errors on subclasses - needs histories, etc.
+ try:
+ tool_dict[ 'html' ] = urllib.quote( self.get_html( trans ) )
+ except AssertionError, e:
+ pass #HACK for assert trans.history, 'requires a history'
+
tool_dict[ 'model_class' ] = self.__class__.__name__
if hasattr( self, 'value' ):
tool_dict[ 'value' ] = self.value
https://bitbucket.org/galaxy/galaxy-central/commits/d7b4edc2d749/
Changeset: d7b4edc2d749
User: carlfeberhard
Date: 2014-01-10 19:59:58
Summary: Merged in takadonet/galaxy-central-takadonet (pull request #253)
Add API call to allow for deletion/purge of dataset in a data library
Affected #: 1 file
diff -r c04e79918595e0cefe85edac156ff5a962f4a686 -r d7b4edc2d749d9835f61dccaab0e17614a9cd336 lib/galaxy/webapps/galaxy/api/library_contents.py
--- a/lib/galaxy/webapps/galaxy/api/library_contents.py
+++ b/lib/galaxy/webapps/galaxy/api/library_contents.py
@@ -2,8 +2,7 @@
API operations on the contents of a library.
"""
import logging
-
-from galaxy import web
+from galaxy import web , exceptions
from galaxy.model import ExtendedMetadata, ExtendedMetadataIndex
from galaxy.web.base.controller import BaseAPIController, UsesLibraryMixin, UsesLibraryMixinItems
from galaxy.web.base.controller import UsesHistoryDatasetAssociationMixin
@@ -318,3 +317,67 @@
return 'LibraryFolder', content_id[1:]
else:
raise HTTPBadRequest( 'Malformed library content id ( %s ) specified, unable to decode.' % str( content_id ) )
+
+
+ @web.expose_api
+ def delete( self, trans, library_id, id, **kwd ):
+ """
+ delete( self, trans, library_id, id, **kwd )
+ * DELETE /api/libraries/{library_id}/contents/{id}
+ delete the HDA with the given ``id``
+
+
+ :type id: str
+ :param id: the encoded id of the library dataset to delete
+ :type kwd: dict
+ :param kwd: (optional) dictionary structure containing:
+
+ * payload: a dictionary itself containing:
+ * purge: if True, purge the HDA
+
+ :rtype: dict
+ :returns: an error object if an error occurred or a dictionary containing:
+ * id: the encoded id of the library dataset,
+ * deleted: if the library dataset was marked as deleted,
+ * purged: if the library dataset was purged
+ """
+ # a request body is optional here
+ purge = False
+ if kwd.get( 'payload', None ):
+ purge = util.string_as_bool( kwd['payload'].get( 'purge', False ) )
+ rval = { 'id' : id }
+ try:
+ hda = self.get_library_dataset( trans, id, check_ownership=False, check_accessible=True )
+ hda.deleted = True
+ if purge:
+ if not trans.app.config.allow_user_dataset_purge:
+ raise exceptions.httpexceptions.HTTPForbidden(
+ detail='This instance does not allow user dataset purging' )
+ hda.purged = True
+ trans.sa_session.add( hda )
+ trans.sa_session.flush()
+ if hda.dataset.user_can_purge:
+ try:
+ hda.dataset.full_delete()
+ trans.sa_session.add( hda.dataset )
+ except:
+ pass
+ # flush now to preserve deleted state in case of later interruption
+ trans.sa_session.flush()
+ rval[ 'purged' ] = True
+ trans.sa_session.flush()
+ rval[ 'deleted' ] = True
+ except exceptions.httpexceptions.HTTPInternalServerError, http_server_err:
+ log.exception( 'HDA API, delete: uncaught HTTPInternalServerError: %s, %s\n%s',
+ id, str( kwd ), str( http_server_err ) )
+ raise
+ except exceptions.httpexceptions.HTTPException:
+ raise
+ except Exception, exc:
+ log.exception( 'HDA API, delete: uncaught exception: %s, %s\n%s',
+ id, str( kwd ), str( exc ) )
+ trans.response.status = 500
+ rval.update({ 'error': str( exc ) })
+ return rval
+
+
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