1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/1aa6224b32c2/
changeset: 1aa6224b32c2
user: greg
date: 2013-03-16 20:18:16
summary: Import fix for admin grids in the tool shed.
affected #: 1 file
diff -r 4c7d89fe3fc9e9e4e8cd69aa0ff1504b842d668a -r 1aa6224b32c2e1c05eafbf1f507d2f7a754ded89 lib/tool_shed/grids/admin_grids.py
--- a/lib/tool_shed/grids/admin_grids.py
+++ b/lib/tool_shed/grids/admin_grids.py
@@ -5,6 +5,12 @@
import tool_shed.util.shed_util_common as suc
from tool_shed.grids.repository_grids import RepositoryGrid, CategoryGrid
+from galaxy import eggs
+import pkg_resources
+
+pkg_resources.require( 'mercurial' )
+from mercurial import hg, ui, commands
+
log = logging.getLogger( __name__ )
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 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/4c7d89fe3fc9/
changeset: 4c7d89fe3fc9
user: greg
date: 2013-03-16 20:08:14
summary: Fix for viewing tools in a repository.
affected #: 1 file
diff -r a5c906f0e8a03b9ec884b224393c5cb767dcf37d -r 4c7d89fe3fc9e9e4e8cd69aa0ff1504b842d668a lib/tool_shed/util/tool_util.py
--- a/lib/tool_shed/util/tool_util.py
+++ b/lib/tool_shed/util/tool_util.py
@@ -535,7 +535,7 @@
def handle_sample_files_and_load_tool_from_tmp_config( trans, repo, changeset_revision, tool_config_filename, work_dir ):
tool = None
message = ''
- ctx = get_changectx_for_changeset( repo, changeset_revision )
+ ctx = suc.get_changectx_for_changeset( repo, changeset_revision )
# We're not currently doing anything with the returned list of deleted_sample_files here. It is intended to help handle sample files that are in
# the manifest, but have been deleted from disk.
sample_files, deleted_sample_files = get_list_of_copied_sample_files( repo, ctx, dir=work_dir )
@@ -548,7 +548,7 @@
error, message = handle_sample_tool_data_table_conf_file( trans.app, tool_data_table_config )
if error:
log.debug( message )
- manifest_ctx, ctx_file = get_ctx_file_path_from_manifest( tool_config_filename, repo, changeset_revision )
+ manifest_ctx, ctx_file = suc.get_ctx_file_path_from_manifest( tool_config_filename, repo, changeset_revision )
if manifest_ctx and ctx_file:
tool, message2 = load_tool_from_tmp_config( trans, repo, manifest_ctx, ctx_file, work_dir )
message = concat_messages( message, message2 )
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 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/3f2e8f5f0d7d/
changeset: 3f2e8f5f0d7d
user: greg
date: 2013-03-16 16:34:03
summary: Add blank lines to shed_util_common.py per new Galaxy dev team standards.
affected #: 1 file
diff -r 74da2fbf09633268e1e6b6043bfd7e0515bd8422 -r 3f2e8f5f0d7de7131aa878e867c12c352f1f79b5 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
@@ -107,12 +107,14 @@
option_value = trans.security.encode_id( repository.id )
repositories_select_field.add_option( option_label, option_value )
return repositories_select_field
+
def changeset_is_malicious( trans, id, changeset_revision, **kwd ):
"""Check the malicious flag in repository metadata for a specified change set"""
repository_metadata = get_repository_metadata_by_changeset_revision( trans, id, changeset_revision )
if repository_metadata:
return repository_metadata.malicious
return False
+
def changeset_is_valid( app, repository, changeset_revision ):
repo = hg.repository( get_configured_ui(), repository.repo_path( app ) )
for changeset in repo.changelog:
@@ -120,6 +122,7 @@
if changeset_revision == changeset_hash:
return True
return False
+
def clean_repository_clone_url( repository_clone_url ):
if repository_clone_url.find( '@' ) > 0:
# We have an url that includes an authenticated user, something like:
@@ -134,11 +137,13 @@
else:
tmp_url = repository_clone_url
return tmp_url
+
def clean_tool_shed_url( tool_shed_url ):
if tool_shed_url.find( ':' ) > 0:
# Eliminate the port, if any, since it will result in an invalid directory name.
return tool_shed_url.split( ':' )[ 0 ]
return tool_shed_url.rstrip( '/' )
+
def clone_repository( repository_clone_url, repository_file_dir, ctx_rev ):
"""Clone the repository up to the specified changeset_revision. No subsequent revisions will be present in the cloned repository."""
try:
@@ -153,6 +158,7 @@
error_message = 'Error cloning repository: %s' % str( e )
log.debug( error_message )
return False, error_message
+
def config_elems_to_xml_file( app, config_elems, config_filename, tool_path ):
# Persist the current in-memory list of config_elems to a file named by the value of config_filename.
fd, filename = tempfile.mkstemp()
@@ -164,6 +170,7 @@
os.close( fd )
shutil.move( filename, os.path.abspath( config_filename ) )
os.chmod( config_filename, 0644 )
+
def copy_file_from_manifest( repo, ctx, filename, dir ):
"""Copy the latest version of the file named filename from the repository manifest to the directory to which dir refers."""
for changeset in reversed_upper_bounded_changelog( repo, ctx ):
@@ -176,6 +183,7 @@
fh.close()
return file_path
return None
+
def create_or_update_tool_shed_repository( app, name, description, installed_changeset_revision, ctx_rev, repository_clone_url, metadata_dict,
status, current_changeset_revision=None, owner='', dist_to_shed=False ):
# The received value for dist_to_shed will be True if the InstallManager is installing a repository that contains tools or datatypes that used
@@ -231,10 +239,12 @@
sa_session.add( tool_shed_repository )
sa_session.flush()
return tool_shed_repository
+
def generate_clone_url_for_installed_repository( app, repository ):
"""Generate the URL for cloning a repository that has been installed into a Galaxy instance."""
tool_shed_url = get_url_from_repository_tool_shed( app, repository )
return url_join( tool_shed_url, 'repos', repository.owner, repository.name )
+
def generate_clone_url_for_repository_in_tool_shed( trans, repository ):
"""Generate the URL for cloning a repository that is in the tool shed."""
base_url = url_for( '/', qualified=True ).rstrip( '/' )
@@ -244,12 +254,14 @@
return '%s://%s%s/repos/%s/%s' % ( protocol, username, base, repository.user.username, repository.name )
else:
return '%s/repos/%s/%s' % ( base_url, repository.user.username, repository.name )
+
def generate_clone_url_from_repo_info_tup( repo_info_tup ):
"""Generate teh URL for cloning a repositoyr given a tuple of toolshed, name, owner, changeset_revision."""
# Example tuple: ['http://localhost:9009', 'blast_datatypes', 'test', '461a4216e8ab']
toolshed, name, owner, changeset_revision = repo_info_tup
# Don't include the changeset_revision in clone urls.
return url_join( toolshed, 'repos', owner, name )
+
def generate_sharable_link_for_repository_in_tool_shed( trans, repository, changeset_revision=None ):
"""Generate the URL for sharing a repository that is in the tool shed."""
base_url = url_for( '/', qualified=True ).rstrip( '/' )
@@ -258,6 +270,7 @@
if changeset_revision:
sharable_url += '/%s' % changeset_revision
return sharable_url
+
def generate_tool_elem( tool_shed, repository_name, changeset_revision, owner, tool_file_path, tool, tool_section ):
if tool_section is not None:
tool_elem = SubElement( tool_section, 'tool' )
@@ -278,6 +291,7 @@
version_elem = SubElement( tool_elem, 'version' )
version_elem.text = tool.version
return tool_elem
+
def generate_tool_guid( repository_clone_url, tool ):
"""
Generate a guid for the installed tool. It is critical that this guid matches the guid for
@@ -286,6 +300,7 @@
"""
tmp_url = clean_repository_clone_url( repository_clone_url )
return '%s/%s/%s' % ( tmp_url, tool.id, tool.version )
+
def generate_tool_panel_dict_from_shed_tool_conf_entries( app, repository ):
"""
Keep track of the section in the tool panel in which this repository's tools will be contained by parsing the shed_tool_conf in
@@ -333,6 +348,7 @@
else:
tool_panel_dict[ guid ] = [ tool_section_dict ]
return tool_panel_dict
+
def generate_tool_shed_repository_install_dir( repository_clone_url, changeset_revision ):
"""
Generate a repository installation directory that guarantees repositories with the same name will always be installed in different directories.
@@ -345,6 +361,7 @@
repo_path = items[ 1 ]
tool_shed_url = clean_tool_shed_url( tool_shed_url )
return url_join( tool_shed_url, 'repos', repo_path, changeset_revision )
+
def get_absolute_path_to_file_in_repository( repo_files_dir, file_name ):
"""Return the absolute path to a specified disk file contained in a repository."""
stripped_file_name = strip_path( file_name )
@@ -355,21 +372,25 @@
if name == stripped_file_name:
return os.path.abspath( os.path.join( root, name ) )
return file_path
+
def get_categories( trans ):
"""Get all categories from the database."""
return trans.sa_session.query( trans.model.Category ) \
.filter( trans.model.Category.table.c.deleted==False ) \
.order_by( trans.model.Category.table.c.name ) \
.all()
+
def get_category( trans, id ):
"""Get a category from the database."""
return trans.sa_session.query( trans.model.Category ).get( trans.security.decode_id( id ) )
+
def get_category_by_name( trans, name ):
"""Get a category from the database via name."""
try:
return trans.sa_session.query( trans.model.Category ).filter_by( name=name ).one()
except sqlalchemy.orm.exc.NoResultFound:
return None
+
def get_changectx_for_changeset( repo, changeset_revision, **kwd ):
"""Retrieve a specified changectx from a repository."""
for changeset in repo.changelog:
@@ -377,6 +398,7 @@
if str( ctx ) == changeset_revision:
return ctx
return None
+
def get_config( config_file, repo, ctx, dir ):
"""Return the latest version of config_filename from the repository manifest."""
config_file = strip_path( config_file )
@@ -387,6 +409,7 @@
if ctx_file_name == config_file:
return get_named_tmpfile_from_ctx( changeset_ctx, ctx_file, dir )
return None
+
def get_config_from_disk( config_file, relative_install_dir ):
for root, dirs, files in os.walk( relative_install_dir ):
if root.find( '.hg' ) < 0:
@@ -394,6 +417,7 @@
if name == config_file:
return os.path.abspath( os.path.join( root, name ) )
return None
+
def get_configured_ui():
"""Configure any desired ui settings."""
_ui = ui.ui()
@@ -403,12 +427,14 @@
# quiet = True
_ui.setconfig( 'ui', 'quiet', True )
return _ui
+
def get_ctx_rev( tool_shed_url, name, owner, changeset_revision ):
url = url_join( tool_shed_url, 'repository/get_ctx_rev?name=%s&owner=%s&changeset_revision=%s' % ( name, owner, changeset_revision ) )
response = urllib2.urlopen( url )
ctx_rev = response.read()
response.close()
return ctx_rev
+
def get_ctx_file_path_from_manifest( filename, repo, changeset_revision ):
"""Get the ctx file path for the latest revision of filename from the repository manifest up to the value of changeset_revision."""
stripped_filename = strip_path( filename )
@@ -420,6 +446,7 @@
if ctx_file_name == stripped_filename:
return manifest_ctx, ctx_file
return None, None
+
def get_file_context_from_ctx( ctx, filename ):
# We have to be careful in determining if we found the correct file because multiple files with the same name may be in different directories
# within ctx if the files were moved within the change set. For example, in the following ctx.files() list, the former may have been moved to
@@ -440,9 +467,11 @@
if deleted:
return 'DELETED'
return None
+
def get_installed_tool_shed_repository( trans, id ):
"""Get a repository on the Galaxy side from the database via id"""
return trans.sa_session.query( trans.model.ToolShedRepository ).get( trans.security.decode_id( id ) )
+
def get_named_tmpfile_from_ctx( ctx, filename, dir ):
filename = strip_path( filename )
for ctx_file in ctx.files():
@@ -464,6 +493,7 @@
fh.close()
return tmp_filename
return None
+
def get_next_downloadable_changeset_revision( repository, repo, after_changeset_revision ):
"""
Return the installable changeset_revision in the repository changelog after the changeset to which after_changeset_revision refers. If there
@@ -484,6 +514,7 @@
# We've found the changeset in the changelog for which we need to get the next downloadable changset.
found_after_changeset_revision = True
return None
+
def get_or_create_tool_shed_repository( trans, tool_shed, name, owner, changeset_revision ):
repository = get_repository_for_dependency_relationship( trans.app, tool_shed, name, owner, changeset_revision )
if not repository:
@@ -502,6 +533,7 @@
owner=owner,
dist_to_shed=False )
return repository
+
def get_ordered_downloadable_changeset_revisions( repository, repo ):
"""Return an ordered list of changeset_revisions defined by a repository changelog."""
changeset_tups = []
@@ -516,6 +548,7 @@
sorted_changeset_tups = sorted( changeset_tups )
sorted_changeset_revisions = [ changeset_tup[ 1 ] for changeset_tup in sorted_changeset_tups ]
return sorted_changeset_revisions
+
def get_previous_downloadable_changeset_revision( repository, repo, before_changeset_revision ):
"""
Return the installable changeset_revision in the repository changelog prior to the changeset to which before_changeset_revision
@@ -537,6 +570,7 @@
return INITIAL_CHANGELOG_HASH
else:
previous_changeset_revision = changeset_revision
+
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:
@@ -545,12 +579,14 @@
elif len( repo_info_tuple ) == 7:
description, repository_clone_url, changeset_revision, ctx_rev, repository_owner, repository_dependencies, tool_dependencies = repo_info_tuple
return description, repository_clone_url, changeset_revision, ctx_rev, repository_owner, repository_dependencies, tool_dependencies
+
def get_repository_by_id( trans, id ):
"""Get a repository from the database via id."""
if trans.webapp.name == 'galaxy':
return trans.sa_session.query( trans.model.ToolShedRepository ).get( trans.security.decode_id( id ) )
else:
return trans.sa_session.query( trans.model.Repository ).get( trans.security.decode_id( id ) )
+
def get_repository_by_name( app, name ):
"""Get a repository from the database via name."""
sa_session = app.model.context.current
@@ -558,6 +594,7 @@
return sa_session.query( app.model.ToolShedRepository ).filter_by( name=name ).first()
else:
return sa_session.query( app.model.Repository ).filter_by( name=name ).first()
+
def get_repository_by_name_and_owner( app, name, owner ):
"""Get a repository from the database via name and owner"""
sa_session = app.model.context.current
@@ -574,6 +611,7 @@
app.model.Repository.table.c.user_id == user.id ) ) \
.first()
return None
+
def get_repository_for_dependency_relationship( app, tool_shed, name, owner, changeset_revision ):
repository = get_tool_shed_repository_by_shed_name_owner_installed_changeset_revision( app=app,
tool_shed=tool_shed,
@@ -587,6 +625,7 @@
owner=owner,
changeset_revision=changeset_revision )
return repository
+
def get_repository_file_contents( file_path ):
if checkers.is_gzip( file_path ):
safe_str = to_safe_string( '\ngzip compressed file\n' )
@@ -605,6 +644,7 @@
safe_str = '%s%s' % ( safe_str, to_safe_string( large_str ) )
break
return safe_str
+
def get_repository_files( trans, folder_path ):
contents = []
for item in os.listdir( folder_path ):
@@ -618,9 +658,11 @@
if contents:
contents.sort()
return contents
+
def get_repository_in_tool_shed( trans, id ):
"""Get a repository on the tool shed side from the database via id."""
return trans.sa_session.query( trans.model.Repository ).get( trans.security.decode_id( id ) )
+
def get_repository_metadata_by_changeset_revision( trans, id, changeset_revision ):
"""Get metadata for a specified repository change set from the database."""
# Make sure there are no duplicate records, and return the single unique record for the changeset_revision. Duplicate records were somehow
@@ -640,16 +682,19 @@
elif all_metadata_records:
return all_metadata_records[ 0 ]
return None
+
def get_repository_owner( cleaned_repository_url ):
items = cleaned_repository_url.split( '/repos/' )
repo_path = items[ 1 ]
if repo_path.startswith( '/' ):
repo_path = repo_path.replace( '/', '', 1 )
return repo_path.lstrip( '/' ).split( '/' )[ 0 ]
+
def get_repository_owner_from_clone_url( repository_clone_url ):
tmp_url = clean_repository_clone_url( repository_clone_url )
tool_shed = tmp_url.split( '/repos/' )[ 0 ].rstrip( '/' )
return get_repository_owner( tmp_url )
+
def get_repository_tools_tups( app, metadata_dict ):
repository_tools_tups = []
index, shed_conf_dict = get_shed_tool_conf_dict( app, metadata_dict.get( 'shed_config_filename' ) )
@@ -666,11 +711,13 @@
if tool:
repository_tools_tups.append( ( relative_path, guid, tool ) )
return repository_tools_tups
+
def get_reversed_changelog_changesets( repo ):
reversed_changelog = []
for changeset in repo.changelog:
reversed_changelog.insert( 0, changeset )
return reversed_changelog
+
def get_revision_label( trans, repository, changeset_revision ):
"""Return a string consisting of the human read-able changeset rev and the changeset revision string."""
repo = hg.repository( get_configured_ui(), repository.repo_path( trans.app ) )
@@ -679,6 +726,7 @@
return "%s:%s" % ( str( ctx.rev() ), changeset_revision )
else:
return "-1:%s" % changeset_revision
+
def get_rev_label_from_changeset_revision( repo, changeset_revision ):
ctx = get_changectx_for_changeset( repo, changeset_revision )
if ctx:
@@ -688,6 +736,7 @@
rev = '-1'
label = "-1:%s" % changeset_revision
return rev, label
+
def get_shed_tool_conf_dict( app, shed_tool_conf ):
"""Return the in-memory version of the shed_tool_conf file, which is stored in the config_elems entry in the shed_tool_conf_dict associated with the file."""
for index, shed_tool_conf_dict in enumerate( app.toolbox.shed_tool_confs ):
@@ -697,6 +746,7 @@
file_name = strip_path( shed_tool_conf_dict[ 'config_filename' ] )
if shed_tool_conf == file_name:
return index, shed_tool_conf_dict
+
def get_tool_panel_config_tool_path_install_dir( app, repository ):
# Return shed-related tool panel config, the tool_path configured in it, and the relative path to the directory where the
# repository is installed. This method assumes all repository tools are defined in a single shed-related tool panel config.
@@ -715,6 +765,7 @@
tool_path = shed_config_dict[ 'tool_path' ]
relative_install_dir = partial_install_dir
return shed_tool_conf, tool_path, relative_install_dir
+
def get_tool_path_by_shed_tool_conf_filename( trans, shed_tool_conf ):
"""
Return the tool_path config setting for the received shed_tool_conf file by searching the tool box's in-memory list of shed_tool_confs for the
@@ -729,10 +780,12 @@
if file_name == shed_tool_conf:
return shed_tool_conf_dict[ 'tool_path' ]
return None
+
def get_tool_shed_repository_by_id( trans, repository_id ):
return trans.sa_session.query( trans.model.ToolShedRepository ) \
.filter( trans.model.ToolShedRepository.table.c.id == trans.security.decode_id( repository_id ) ) \
.first()
+
def get_tool_shed_repository_by_shed_name_owner_changeset_revision( app, tool_shed, name, owner, changeset_revision ):
# This method is used only in Galaxy, not the tool shed.
sa_session = app.model.context.current
@@ -745,6 +798,7 @@
app.model.ToolShedRepository.table.c.owner == owner,
app.model.ToolShedRepository.table.c.changeset_revision == changeset_revision ) ) \
.first()
+
def get_tool_shed_repository_by_shed_name_owner_installed_changeset_revision( app, tool_shed, name, owner, installed_changeset_revision ):
# This method is used only in Galaxy, not the tool shed.
sa_session = app.model.context.current
@@ -757,9 +811,11 @@
app.model.ToolShedRepository.table.c.owner == owner,
app.model.ToolShedRepository.table.c.installed_changeset_revision == installed_changeset_revision ) ) \
.first()
+
def get_tool_shed_from_clone_url( repository_clone_url ):
tmp_url = clean_repository_clone_url( repository_clone_url )
return tmp_url.split( '/repos/' )[ 0 ].rstrip( '/' )
+
def get_url_from_repository_tool_shed( app, repository ):
"""
The stored value of repository.tool_shed is something like: toolshed.g2.bx.psu.edu. We need the URL to this tool shed, which is
@@ -772,6 +828,7 @@
return shed_url
# The tool shed from which the repository was originally installed must no longer be configured in tool_sheds_conf.xml.
return None
+
def get_url_from_tool_shed( app, tool_shed ):
# The value of tool_shed is something like: toolshed.g2.bx.psu.edu. We need the URL to this tool shed, which is something like:
# http://toolshed.g2.bx.psu.edu/
@@ -782,9 +839,11 @@
return shed_url
# The tool shed from which the repository was originally installed must no longer be configured in tool_sheds_conf.xml.
return None
+
def get_user( trans, id ):
"""Get a user from the database by id."""
return trans.sa_session.query( trans.model.User ).get( trans.security.decode_id( id ) )
+
def get_user_by_username( app, username ):
"""Get a user from the database by username."""
sa_session = app.model.context.current
@@ -795,6 +854,7 @@
return user
except Exception, e:
return None
+
def handle_email_alerts( trans, repository, content_alert_str='', new_repo_alert=False, admin_only=False ):
# There are 2 complementary features that enable a tool shed user to receive email notification:
# 1. Within User Preferences, they can elect to receive email when the first (or first valid)
@@ -886,6 +946,7 @@
util.send_mail( frm, to, subject, body, trans.app.config )
except Exception, e:
log.exception( "An error occurred sending a tool shed repository update alert by email." )
+
def open_repository_files_folder( trans, folder_path ):
try:
files_list = get_repository_files( trans, folder_path )
@@ -907,12 +968,14 @@
"key": full_path }
folder_contents.append( node )
return folder_contents
+
def remove_dir( dir ):
if os.path.exists( dir ):
try:
shutil.rmtree( dir )
except:
pass
+
def repository_was_previously_installed( trans, tool_shed_url, repository_name, repo_info_tuple ):
"""
Handle the case where the repository was previously installed using an older changeset_revsion, but later the repository was updated
@@ -940,6 +1003,7 @@
if tool_shed_repository and tool_shed_repository.status not in [ trans.model.ToolShedRepository.installation_status.NEW ]:
return tool_shed_repository, previous_changeset_revision
return None, None
+
def reversed_lower_upper_bounded_changelog( repo, excluded_lower_bounds_changeset_revision, included_upper_bounds_changeset_revision ):
"""
Return a reversed list of changesets in the repository changelog after the excluded_lower_bounds_changeset_revision, but up to and
@@ -963,8 +1027,10 @@
if changeset_hash == included_upper_bounds_changeset_revision:
break
return reversed_changelog
+
def reversed_upper_bounded_changelog( repo, included_upper_bounds_changeset_revision ):
return reversed_lower_upper_bounded_changelog( repo, INITIAL_CHANGELOG_HASH, included_upper_bounds_changeset_revision )
+
def strip_path( fpath ):
if not fpath:
return fpath
@@ -973,6 +1039,7 @@
except:
file_name = fpath
return file_name
+
def to_safe_string( text, to_html=True ):
"""Translates the characters in text to an html string"""
if text:
@@ -1003,10 +1070,13 @@
translated.append( '' )
return ''.join( translated )
return text
+
def tool_shed_from_repository_clone_url( repository_clone_url ):
return clean_repository_clone_url( repository_clone_url ).split( '/repos/' )[ 0 ].rstrip( '/' )
+
def tool_shed_is_this_tool_shed( toolshed_base_url ):
return toolshed_base_url.rstrip( '/' ) == str( url_for( '/', qualified=True ) ).rstrip( '/' )
+
def translate_string( raw_text, to_html=True ):
if raw_text:
if len( raw_text ) <= MAX_CONTENT_SIZE:
@@ -1017,6 +1087,7 @@
else:
translated_string = ''
return translated_string
+
def update_in_shed_tool_config( app, repository ):
"""
A tool shed repository is being updated so change the shed_tool_conf file. Parse the config file to generate the entire list
@@ -1050,6 +1121,7 @@
elem = guid_to_tool_elem_dict[ guid ]
config_elems.append( elem )
config_elems_to_xml_file( app, config_elems, shed_tool_conf, tool_path )
+
def update_repository( repo, ctx_rev=None ):
"""
Update the cloned repository to changeset_revision. It is critical that the installed repository is updated to the desired
@@ -1067,11 +1139,13 @@
# It would be nice if we could use mercurial's purge extension to remove untracked files. The problem is that
# purging is not supported by the mercurial API.
commands.update( get_configured_ui(), repo, rev=ctx_rev )
+
def update_tool_shed_repository_status( app, tool_shed_repository, status ):
sa_session = app.model.context.current
tool_shed_repository.status = status
sa_session.add( tool_shed_repository )
sa_session.flush()
+
def url_join( *args ):
parts = []
for arg in args:
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 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/8703329f3716/
changeset: 8703329f3716
user: guerler
date: 2013-03-15 22:29:29
summary: Provide backwards compatibility for sorter
affected #: 1 file
diff -r b9afd514145740b4d5999158d51bd7dc4a409a99 -r 8703329f3716e7c4603e3a3a57286f67bc3b89af tools/filters/sorter.xml
--- a/tools/filters/sorter.xml
+++ b/tools/filters/sorter.xml
@@ -3,59 +3,131 @@
<command interpreter="python">
sorter.py
--input=$input
- --output=$output
+ --output=$out_file1
+
+ #set $style = '' if (str($style) == 'alpha') else 'n'
+ #set $order = '' if (str($order) == 'ASC') else 'r'
--key=$column,$column$style$order
+
#for $col in $column_set:
- --key=${col.other_column},${col.other_column}${col.other_style}${col.other_order}
+ #set $other_column = str($col.other_column)
+ #set $other_style = '' if (str($col.other_style) == "alpha") else 'n'
+ #set $other_order = '' if (str($col.other_order) == "ASC") else 'r'
+ --key=$other_column,$other_column$other_style$other_order
#end for
</command><inputs><param format="tabular" name="input" type="data" label="Sort Dataset" /><param name="column" label="on column" type="data_column" data_ref="input" accept_default="true"/><param name="style" type="select" label="with flavor">
- <option value="n">Numerical sort</option>
- <option value="">Alphabetical sort</option>
+ <option value="num">Numerical sort</option>
+ <option value="alpha">Alphabetical sort</option></param><param name="order" type="select" label="everything in">
- <option value="r">Descending order</option>
- <option value="">Ascending order</option>
+ <option value="DESC">Descending order</option>
+ <option value="ASC">Ascending order</option></param><repeat name="column_set" title="Column selection"><param name="other_column" label="on column" type="data_column" data_ref="input" accept_default="true" /><param name="other_style" type="select" label="with flavor">
- <option value="n">Numerical sort</option>
- <option value="">Alphabetical sort</option>
+ <option value="num">Numerical sort</option>
+ <option value="alpha">Alphabetical sort</option></param><param name="other_order" type="select" label="everything in">
- <option value="r">Descending order</option>
- <option value="">Ascending order</option>
+ <option value="DESC">Descending order</option>
+ <option value="ASC">Ascending order</option></param></repeat></inputs><outputs>
- <data format="input" name="output" metadata_source="input"/>
+ <data format="input" name="out_file1" metadata_source="input"/></outputs><tests><test><param name="input" value="sort_in1.bed"/><param name="column" value="1"/>
- <param name="style" value=""/>
- <param name="order" value=""/>
+ <param name="style" value="alpha"/>
+ <param name="order" value="ASC"/><param name="other_column" value="3"/>
- <param name="other_style" value="n"/>
- <param name="other_order" value="r"/>
- <output name="output" file="sort_out1.bed"/>
+ <param name="other_style" value="num"/>
+ <param name="other_order" value="DESC"/>
+ <output name="out_file1" file="sort_out1.bed"/></test><test><param name="input" value="sort_in1.bed"/><param name="column" value="1"/>
- <param name="style" value=""/>
- <param name="order" value=""/>
+ <param name="style" value="alpha"/>
+ <param name="order" value="ASC"/><param name="other_column" value="3"/>
- <param name="other_style" value="n"/>
- <param name="other_order" value=""/>
- <output name="output" file="sort_out2.bed"/>
+ <param name="other_style" value="num"/>
+ <param name="other_order" value="ASC"/>
+ <output name="out_file1" file="sort_out2.bed"/></test></tests>
-
+ <help>
+
+ .. class:: infomark
+
+ **TIP:** If your data is not TAB delimited, use *Text Manipulation->Convert*
+
+ -----
+
+ **Syntax**
+
+ This tool sorts the dataset on any number of columns in either ascending or descending order.
+
+ * Numerical sort orders numbers by their magnitude, ignores all characters besides numbers, and evaluates a string of numbers to the value they signify.
+ * Alphabetical sort is a phonebook type sort based on the conventional order of letters in an alphabet. Each nth letter is compared with the nth letter of other words in the list, starting at the first letter of each word and advancing to the second, third, fourth, and so on, until the order is established. Therefore, in an alphabetical sort, 2 comes after 100 (1 < 2).
+
+ -----
+
+ **Examples**
+
+ The list of numbers 4,17,3,5 collates to 3,4,5,17 by numerical sorting, while it collates to 17,3,4,5 by alphabetical sorting.
+
+ Sorting the following::
+
+ Q d 7 II jhu 45
+ A kk 4 I h 111
+ Pd p 1 ktY WS 113
+ A g 10 H ZZ 856
+ A edf 4 tw b 234
+ BBB rt 10 H ZZ 100
+ A rew 10 d b 1111
+ C sd 19 YH aa 10
+ Hah c 23 ver bb 467
+ MN gtr 1 a X 32
+ N j 9 a T 205
+ BBB rrf 10 b Z 134
+ odfr ws 6 Weg dew 201
+ C f 3 WW SW 34
+ A jhg 4 I b 345
+ Pd gf 7 Gthe de 567
+ rS hty 90 YY LOp 89
+ A g 10 H h 43
+ A g 4 I h 500
+
+ on columns 1 (alpha), 3 (num), and 6 (num) in ascending order will yield::
+
+ A kk 4 I h 111
+ A edf 4 tw b 234
+ A jhg 4 I b 345
+ A g 4 I h 500
+ A g 10 H h 43
+ A g 10 H ZZ 856
+ A rew 10 d b 1111
+ BBB rt 10 H ZZ 100
+ BBB rrf 10 b Z 134
+ C f 3 WW SW 34
+ C sd 19 YH aa 10
+ Hah c 23 ver bb 467
+ MN gtr 1 a X 32
+ N j 9 a T 205
+ odfr ws 6 Weg dew 201
+ Pd p 1 ktY WS 113
+ Pd gf 7 Gthe de 567
+ Q d 7 II jhu 45
+ rS hty 90 YY LOp 89
+
+ </help></tool>
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 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/fea372d82439/
changeset: fea372d82439
user: dan
date: 2013-03-15 21:36:44
summary: Fix for tool_shed/util/metadata_util.py.generate_guid_for_object().
affected #: 1 file
diff -r 1cc6973069b5e7afeb5c2d401c262b0d39efd24b -r fea372d824394fa70cb37d306827190dc9b47556 lib/tool_shed/util/metadata_util.py
--- a/lib/tool_shed/util/metadata_util.py
+++ b/lib/tool_shed/util/metadata_util.py
@@ -466,7 +466,7 @@
return valid_tool_dependencies_dict
def generate_guid_for_object( repository_clone_url, guid_type, obj_id, version ):
- tmp_url = clean_repository_clone_url( repository_clone_url )
+ tmp_url = suc.clean_repository_clone_url( repository_clone_url )
return '%s/%s/%s/%s' % ( tmp_url, guid_type, obj_id, version )
def generate_metadata_for_changeset_revision( app, repository, changeset_revision, repository_clone_url, shed_config_dict=None, relative_install_dir=None,
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.