galaxy-commits
Threads by month
- ----- 2025 -----
- July
- June
- May
- April
- March
- February
- January
- ----- 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
- 15302 discussions

commit/galaxy-central: greg: Add the ability to select Galaxy tool shed repositories to receive email alerts when they are updated. Also remove a broken link on the Galaxy tool shed Help menu.
by Bitbucket 23 Jun '11
by Bitbucket 23 Jun '11
23 Jun '11
1 new changeset in galaxy-central:
http://bitbucket.org/galaxy/galaxy-central/changeset/c996393163e1/
changeset: c996393163e1
user: greg
date: 2011-06-23 21:32:07
summary: Add the ability to select Galaxy tool shed repositories to receive email alerts when they are updated. Also remove a broken link on the Galaxy tool shed Help menu.
affected #: 12 files (10.3 KB)
--- a/lib/galaxy/webapps/community/config.py Thu Jun 23 11:03:45 2011 -0400
+++ b/lib/galaxy/webapps/community/config.py Thu Jun 23 15:32:07 2011 -0400
@@ -54,6 +54,9 @@
self.mailing_join_addr = kwargs.get('mailing_join_addr',"galaxy-user-join(a)bx.psu.edu")
self.error_email_to = kwargs.get( 'error_email_to', None )
self.smtp_server = kwargs.get( 'smtp_server', None )
+ self.smtp_username = kwargs.get( 'smtp_username', None )
+ self.smtp_password = kwargs.get( 'smtp_password', None )
+ self.email_alerts_from = kwargs.get( 'email_alerts_from', None )
self.log_actions = string_as_bool( kwargs.get( 'log_actions', 'False' ) )
self.brand = kwargs.get( 'brand', None )
self.wiki_url = kwargs.get( 'wiki_url', 'http://bitbucket.org/galaxy/galaxy-central/wiki/Home' )
--- a/lib/galaxy/webapps/community/controllers/common.py Thu Jun 23 11:03:45 2011 -0400
+++ b/lib/galaxy/webapps/community/controllers/common.py Thu Jun 23 15:32:07 2011 -0400
@@ -1,4 +1,7 @@
-import os, tarfile, tempfile, shutil
+import os, tarfile, tempfile, shutil, string, socket
+from time import strftime
+from datetime import *
+from galaxy.util.json import from_json_string, to_json_string
from galaxy.web.base.controller import *
from galaxy.webapps.community import model
from galaxy.model.orm import *
@@ -9,6 +12,25 @@
import logging
log = logging.getLogger( __name__ )
+email_alert_template = """
+GALAXY TOOL SHED REPOSITORY UPDATE ALERT
+-----------------------------------------------------------------------------
+You received this alert because you registered to receive email whenever
+changes were made to the repository named "${repository_name}".
+-----------------------------------------------------------------------------
+
+Date of change: ${display_date}
+Changed by: ${username}
+
+Revision: ${revision}
+Change description:
+${description}
+
+-----------------------------------------------------------------------------
+This change alert was sent from the Galaxy tool shed hosted on the server
+"${host}"
+"""
+
# States for passing messages
SUCCESS, INFO, WARNING, ERROR = "done", "info", "warning", "error"
@@ -95,6 +117,42 @@
os.chdir( cloned_repo_dir )
os.system( cmd )
os.chdir( current_working_dir )
+ smtp_server = trans.app.config.smtp_server
+ if smtp_server and repository.email_alerts:
+ # Send email alert to users that want them.
+ if trans.app.config.email_alerts_from is not None:
+ email_alerts_from = trans.app.config.email_alerts_from
+ elif trans.request.host.split( ':' )[0] == 'localhost':
+ email_alerts_from = 'galaxy-no-reply@' + socket.getfqdn()
+ else:
+ email_alerts_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( *time.gmtime( float( t ) - tz )[:6] )
+ display_date = date.strftime( "%Y-%m-%d" )
+ try:
+ username = ctx.user().split()[0]
+ except:
+ username = ctx.user()
+ # Build the email message
+ body = string.Template( email_alert_template ) \
+ .safe_substitute( host=trans.request.host,
+ repository_name=repository.name,
+ revision='%s:%s' %( str( ctx.rev() ), ctx ),
+ display_date=display_date,
+ description=ctx.description(),
+ username=username )
+ frm = email_alerts_from
+ subject = "Galaxy tool shed repository update alert"
+ email_alerts = from_json_string( repository.email_alerts )
+ for email in email_alerts:
+ to = email.strip()
+ # Send it
+ try:
+ 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 hg_remove( file_path, current_working_dir, cloned_repo_dir ):
# Remove a file path from a cloned repository. Since mercurial doesn't track
# directories (only files), directories are automatically removed when they
--- a/lib/galaxy/webapps/community/controllers/repository.py Thu Jun 23 11:03:45 2011 -0400
+++ b/lib/galaxy/webapps/community/controllers/repository.py Thu Jun 23 15:32:07 2011 -0400
@@ -5,9 +5,11 @@
from galaxy import util
from galaxy.datatypes.checkers import *
from galaxy.web.base.controller import *
+from galaxy.web.form_builder import CheckboxField
from galaxy.webapps.community import model
from galaxy.webapps.community.model import directory_hash_id
from galaxy.web.framework.helpers import time_ago, iff, grids
+from galaxy.util.json import from_json_string, to_json_string
from galaxy.model.orm import *
from common import *
from mercurial import hg, ui, patch
@@ -113,6 +115,11 @@
return query
return query.filter( and_( model.Repository.table.c.user_id == model.User.table.c.id,
model.User.table.c.email == column_filter ) )
+ class EmailAlertsColumn( grids.TextColumn ):
+ def get_value( self, trans, grid, repository ):
+ if trans.user.email in from_json_string( repository.email_alerts ):
+ return 'yes'
+ return ''
# Grid definition
title = "Repositories"
model_class = model.Repository
@@ -139,6 +146,8 @@
key="username" ),
grids.CommunityRatingColumn( "Average Rating",
key="rating" ),
+ EmailAlertsColumn( "Alert",
+ attach_popup=False ),
# Columns that are valid for filtering but are not visible.
EmailColumn( "Email",
model_class=model.User,
@@ -154,7 +163,10 @@
key="free-text-search",
visible=False,
filterable="standard" ) )
- operations = []
+ operations = [ grids.GridOperation( "Receive email alerts",
+ allow_multiple=True,
+ condition=( lambda item: not item.deleted ),
+ async_compatible=False ) ]
standard_filters = []
default_filter = {}
num_rows_per_page = 50
@@ -248,6 +260,10 @@
category_id = kwd.get( 'id', None )
category = get_category( trans, category_id )
kwd[ 'f-Category.name' ] = category.name
+ elif operation == "receive email alerts":
+ return trans.response.send_redirect( web.url_for( controller='repository',
+ action='set_email_alerts',
+ **kwd ) )
# Render the list view
return self.repository_list_grid( trans, **kwd )
@web.expose
@@ -485,6 +501,30 @@
tip = get_repository_tip( repo )
avg_rating, num_ratings = self.get_ave_item_rating_data( trans.sa_session, repository, webapp_model=trans.model )
display_reviews = util.string_as_bool( params.get( 'display_reviews', False ) )
+ alerts = params.get( 'alerts', '' )
+ alerts_checked = CheckboxField.is_checked( alerts )
+ if repository.email_alerts:
+ email_alerts = from_json_string( repository.email_alerts )
+ else:
+ email_alerts = []
+ user = trans.user
+ if params.get( 'receive_email_alerts_button', False ):
+ flush_needed = False
+ if alerts_checked:
+ if user.email not in email_alerts:
+ email_alerts.append( user.email )
+ repository.email_alerts = to_json_string( email_alerts )
+ flush_needed = True
+ else:
+ if user.email in email_alerts:
+ email_alerts.remove( user.email )
+ repository.email_alerts = to_json_string( email_alerts )
+ flush_needed = True
+ if flush_needed:
+ trans.sa_session.add( repository )
+ trans.sa_session.flush()
+ checked = alerts_checked or user.email in email_alerts
+ alerts_check_box = CheckboxField( 'alerts', checked=checked )
return trans.fill_template( '/webapps/community/repository/view_repository.mako',
repo=repo,
repository=repository,
@@ -492,6 +532,7 @@
avg_rating=avg_rating,
display_reviews=display_reviews,
num_ratings=num_ratings,
+ alerts_check_box=alerts_check_box,
message=message,
status=status )
@web.expose
@@ -507,11 +548,18 @@
description = util.restore_text( params.get( 'description', repository.description ) )
avg_rating, num_ratings = self.get_ave_item_rating_data( trans.sa_session, repository, webapp_model=trans.model )
display_reviews = util.string_as_bool( params.get( 'display_reviews', False ) )
+ alerts = params.get( 'alerts', '' )
+ alerts_checked = CheckboxField.is_checked( alerts )
+ if repository.email_alerts:
+ email_alerts = from_json_string( repository.email_alerts )
+ else:
+ email_alerts = []
allow_push = params.get( 'allow_push', '' )
error = False
+ user = trans.user
if params.get( 'edit_repository_button', False ):
flush_needed = False
- if trans.user != repository.user:
+ if user != repository.user:
message = "You are not the owner of this repository, so you cannot manage it."
status = error
return trans.response.send_redirect( web.url_for( controller='repository',
@@ -520,7 +568,7 @@
message=message,
status=status ) )
if repo_name != repository.name:
- message = self.__validate_repository_name( repo_name, trans.user )
+ message = self.__validate_repository_name( repo_name, user )
if message:
error = True
else:
@@ -545,10 +593,27 @@
usernames.append( user.username )
usernames = ','.join( usernames )
self.__set_allow_push( repository, usernames, remove_auth=remove_auth )
+ elif params.get( 'receive_email_alerts_button', False ):
+ flush_needed = False
+ if alerts_checked:
+ if user.email not in email_alerts:
+ email_alerts.append( user.email )
+ repository.email_alerts = to_json_string( email_alerts )
+ flush_needed = True
+ else:
+ if user.email in email_alerts:
+ email_alerts.remove( user.email )
+ repository.email_alerts = to_json_string( email_alerts )
+ flush_needed = True
+ if flush_needed:
+ trans.sa_session.add( repository )
+ trans.sa_session.flush()
if error:
status = 'error'
current_allow_push_list = self.__get_allow_push( repository ).split( ',' )
allow_push_select_field = self.__build_allow_push_select_field( trans, current_allow_push_list )
+ checked = alerts_checked or user.email in email_alerts
+ alerts_check_box = CheckboxField( 'alerts', checked=checked )
return trans.fill_template( '/webapps/community/repository/manage_repository.mako',
repo_name=repo_name,
description=description,
@@ -560,6 +625,7 @@
avg_rating=avg_rating,
display_reviews=display_reviews,
num_ratings=num_ratings,
+ alerts_check_box=alerts_check_box,
message=message,
status=status )
@web.expose
@@ -666,6 +732,42 @@
message=message,
status=status )
@web.expose
+ def set_email_alerts( self, trans, **kwd ):
+ # Set email alerts for selected repositories
+ params = util.Params( kwd )
+ user = trans.user
+ repository_ids = util.listify( kwd.get( 'id', '' ) )
+ total_alerts_added = 0
+ total_alerts_removed = 0
+ for repository_id in repository_ids:
+ flush_needed = False
+ repository = get_repository( trans, repository_id )
+ if repository.email_alerts:
+ email_alerts = from_json_string( repository.email_alerts )
+ else:
+ email_alerts = []
+ if user.email in email_alerts:
+ email_alerts.remove( user.email )
+ repository.email_alerts = to_json_string( email_alerts )
+ trans.sa_session.add( repository )
+ flush_needed = True
+ total_alerts_removed += 1
+ else:
+ email_alerts.append( user.email )
+ repository.email_alerts = to_json_string( email_alerts )
+ trans.sa_session.add( repository )
+ flush_needed = True
+ total_alerts_added += 1
+ if flush_needed:
+ trans.sa_session.flush()
+ message = 'Total alerts added: %d, total alerts removed: %d' % ( total_alerts_added, total_alerts_removed )
+ kwd[ 'message' ] = message
+ kwd[ 'status' ] = 'done'
+ del( kwd[ 'operation' ] )
+ return trans.response.send_redirect( web.url_for( controller='repository',
+ action='browse_repositories',
+ **kwd ) )
+ @web.expose
def download( self, trans, repository_id, file_type, **kwd ):
# Download an archive of the repository files compressed as zip, gz or bz2.
params = util.Params( kwd )
--- a/lib/galaxy/webapps/community/model/__init__.py Thu Jun 23 11:03:45 2011 -0400
+++ b/lib/galaxy/webapps/community/model/__init__.py Thu Jun 23 15:32:07 2011 -0400
@@ -19,8 +19,6 @@
self.deleted = False
self.purged = False
self.username = None
- # Relationships
- self.tools = []
def set_password_cleartext( self, cleartext ):
"""Set 'self.password' to the digest of 'cleartext'."""
self.password = new_secure_hash( text_type=cleartext )
@@ -90,11 +88,12 @@
MARKED_FOR_REMOVAL = 'r',
MARKED_FOR_ADDITION = 'a',
NOT_TRACKED = '?' )
- def __init__( self, name=None, description=None, user_id=None, private=False ):
+ def __init__( self, name=None, description=None, user_id=None, private=False, email_alerts=None ):
self.name = name or "Unnamed repository"
self.description = description
self.user_id = user_id
self.private = private
+ self.email_alerts = email_alerts
@property
def repo_path( self ):
# Repository locations on disk are defined in the hgweb.config file
--- a/lib/galaxy/webapps/community/model/mapping.py Thu Jun 23 11:03:45 2011 -0400
+++ b/lib/galaxy/webapps/community/model/mapping.py Thu Jun 23 15:32:07 2011 -0400
@@ -106,7 +106,8 @@
Column( "description" , TEXT ),
Column( "user_id", Integer, ForeignKey( "galaxy_user.id" ), index=True ),
Column( "private", Boolean, default=False ),
- Column( "deleted", Boolean, index=True, default=False ) )
+ Column( "deleted", Boolean, index=True, default=False ),
+ Column( "email_alerts", JSONType, nullable=True ) )
RepositoryRatingAssociation.table = Table( "repository_rating_association", metadata,
Column( "id", Integer, primary_key=True ),
--- a/lib/galaxy/webapps/community/model/migrate/versions/0001_initial_tables.py Thu Jun 23 11:03:45 2011 -0400
+++ b/lib/galaxy/webapps/community/model/migrate/versions/0001_initial_tables.py Thu Jun 23 15:32:07 2011 -0400
@@ -11,8 +11,14 @@
# Need our custom types, but don't import anything else from model
from galaxy.model.custom_types import *
-import logging
+import sys, logging
log = logging.getLogger( __name__ )
+log.setLevel(logging.DEBUG)
+handler = logging.StreamHandler( sys.stdout )
+format = "%(name)s %(levelname)s %(asctime)s %(message)s"
+formatter = logging.Formatter( format )
+handler.setFormatter( formatter )
+log.addHandler( handler )
metadata = MetaData( migrate_engine )
--- a/lib/galaxy/webapps/community/model/migrate/versions/0002_add_tool_suite_column.py Thu Jun 23 11:03:45 2011 -0400
+++ b/lib/galaxy/webapps/community/model/migrate/versions/0002_add_tool_suite_column.py Thu Jun 23 15:32:07 2011 -0400
@@ -7,8 +7,14 @@
from migrate import *
from migrate.changeset import *
-import logging
+import sys, logging
log = logging.getLogger( __name__ )
+log.setLevel(logging.DEBUG)
+handler = logging.StreamHandler( sys.stdout )
+format = "%(name)s %(levelname)s %(asctime)s %(message)s"
+formatter = logging.Formatter( format )
+handler.setFormatter( formatter )
+log.addHandler( handler )
metadata = MetaData( migrate_engine )
db_session = scoped_session( sessionmaker( bind=migrate_engine, autoflush=False, autocommit=True ) )
@@ -16,7 +22,6 @@
def upgrade():
print __doc__
metadata.reflect()
-
# Create and initialize imported column in job table.
Tool_table = Table( "tool", metadata, autoload=True )
c = Column( "suite", Boolean, default=False, index=True )
@@ -24,22 +29,19 @@
# Create
c.create( Tool_table )
assert c is Tool_table.c.suite
-
# Initialize.
if migrate_engine.name == 'mysql' or migrate_engine.name == 'sqlite':
default_false = "0"
elif migrate_engine.name == 'postgres':
default_false = "false"
db_session.execute( "UPDATE tool SET suite=%s" % default_false )
-
except Exception, e:
print "Adding suite column to the tool table failed: %s" % str( e )
log.debug( "Adding suite column to the tool table failed: %s" % str( e ) )
def downgrade():
metadata.reflect()
-
- # Drop imported column from job table.
+ # Drop suite column from tool table.
Tool_table = Table( "tool", metadata, autoload=True )
try:
Tool_table.c.suite.drop()
--- a/templates/display_common.mako Thu Jun 23 11:03:45 2011 -0400
+++ b/templates/display_common.mako Thu Jun 23 15:32:07 2011 -0400
@@ -2,6 +2,8 @@
## Utilities for sharing items and displaying shared items.
## HACK: these should probably go in the web helper object.
##
+## TODO: FIXME Cannot import model here, because grids are
+## used across webapps, and each webapp has it's own model.
<%! from galaxy import model %>
@@ -88,7 +90,7 @@
elif a_class == model.UserOpenID:
class_plural = "OpenIDs"
else:
- class_plural = a_class.__name__ + "s"
+ class_plural = "items"
return class_plural
%></%def>
--- a/templates/webapps/community/base_panels.mako Thu Jun 23 11:03:45 2011 -0400
+++ b/templates/webapps/community/base_panels.mako Thu Jun 23 15:32:07 2011 -0400
@@ -33,7 +33,6 @@
<a>Help</a><div class="submenu"><ul>
- <li><a target="galaxy_main" href="${h.url_for( controller='tool', action='help' )}">How to upload, download and install tools</a></li><li><a href="${app.config.get( "bugs_email", "mailto:galaxy-bugs@bx.psu.edu" )}">Email comments, bug reports, or suggestions</a></li><li><a target="_blank" href="${app.config.get( "wiki_url", "http://bitbucket.org/galaxy/galaxy-central/wiki" )}">Galaxy Wiki</a></li><li><a target="_blank" href="${app.config.get( "screencasts_url", "http://galaxycast.org" )}">Video tutorials (screencasts)</a></li>
--- a/templates/webapps/community/repository/manage_repository.mako Thu Jun 23 11:03:45 2011 -0400
+++ b/templates/webapps/community/repository/manage_repository.mako Thu Jun 23 15:32:07 2011 -0400
@@ -137,6 +137,26 @@
</form></div></div>
+%if trans.app.config.smtp_server:
+ <p/>
+ <div class="toolForm">
+ <div class="toolFormTitle">${repository.name}</div>
+ <div class="toolFormBody">
+ <form name="receive_email_alerts" id="receive_email_alerts" action="${h.url_for( controller='repository', action='manage_repository', id=trans.security.encode_id( repository.id ) )}" method="post" >
+ <div class="form-row">
+ <label>Receive email alerts:</label>
+ ${alerts_check_box.get_html()}
+ <div class="toolParamHelp" style="clear: both;">
+ Check the box and click <b>Save</b> to receive email alerts when updates to this repository occur.
+ </div>
+ </div>
+ <div class="form-row">
+ <input type="submit" name="receive_email_alerts_button" value="Save"/>
+ </div>
+ </form>
+ </div>
+ </div>
+%endif
<p/><div class="toolForm"><div class="toolFormTitle">User access</div>
--- a/templates/webapps/community/repository/view_repository.mako Thu Jun 23 11:03:45 2011 -0400
+++ b/templates/webapps/community/repository/view_repository.mako Thu Jun 23 15:32:07 2011 -0400
@@ -134,8 +134,28 @@
</div></div></div>
-<p/>
+%if trans.user and trans.app.config.smtp_server:
+ <p/>
+ <div class="toolForm">
+ <div class="toolFormTitle">${repository.name}</div>
+ <div class="toolFormBody">
+ <form name="receive_email_alerts" id="receive_email_alerts" action="${h.url_for( controller='repository', action='view_repository', id=trans.security.encode_id( repository.id ) )}" method="post" >
+ <div class="form-row">
+ <label>Receive email alerts:</label>
+ ${alerts_check_box.get_html()}
+ <div class="toolParamHelp" style="clear: both;">
+ Check the box and click <b>Save</b> to receive email alerts when updates to this repository occur.
+ </div>
+ </div>
+ <div class="form-row">
+ <input type="submit" name="receive_email_alerts_button" value="Save"/>
+ </div>
+ </form>
+ </div>
+ </div>
+%endif
%if repository.ratings:
+ <p/><div class="toolForm"><div class="toolFormTitle">Rating</div><div class="toolFormBody">
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

23 Jun '11
1 new changeset in galaxy-central:
http://bitbucket.org/galaxy/galaxy-central/changeset/720455407d1c/
changeset: 720455407d1c
user: natefoo
date: 2011-06-23 17:03:45
summary: Set the HDA purged column to false upon creation. If you already upgraded to database >= 78 please do this by hand (UPDATE history_dataset_association SET purged=false WHERE purged IS NULL).
affected #: 1 file (90 bytes)
--- a/lib/galaxy/model/migrate/versions/0078_add_columns_for_disk_usage_accounting.py Wed Jun 22 08:36:48 2011 -0400
+++ b/lib/galaxy/model/migrate/versions/0078_add_columns_for_disk_usage_accounting.py Thu Jun 23 11:03:45 2011 -0400
@@ -33,6 +33,7 @@
c = Column( "purged", Boolean, index=True, default=False )
c.create( HistoryDatasetAssociation_table )
assert c is HistoryDatasetAssociation_table.c.purged
+ db_session.execute(HistoryDatasetAssociation_table.update().values(purged=False))
except Exception, e:
print "Adding purged column to history_dataset_association table failed: %s" % str( e )
log.debug( "Adding purged column to history_dataset_association table failed: %s" % str( e ) )
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: jgoecks: Better handling of Cuffdiff outputs when set_metadata_externally=True
by Bitbucket 22 Jun '11
by Bitbucket 22 Jun '11
22 Jun '11
1 new changeset in galaxy-central:
http://bitbucket.org/galaxy/galaxy-central/changeset/be48d8761458/
changeset: be48d8761458
user: jgoecks
date: 2011-06-22 14:36:48
summary: Better handling of Cuffdiff outputs when set_metadata_externally=True
affected #: 2 files (297 bytes)
--- a/tools/ngs_rna/cuffcompare_wrapper.py Tue Jun 21 16:22:14 2011 -0400
+++ b/tools/ngs_rna/cuffcompare_wrapper.py Wed Jun 22 08:36:48 2011 -0400
@@ -32,6 +32,9 @@
parser.add_option( '', '--index_dir', dest='index_dir', help='GALAXY_DATA_INDEX_DIR' )
parser.add_option( '', '--ref_file', dest='ref_file', help='The reference dataset from the history' )
+ # Outputs.
+ parser.add_option( '', '--combined-transcripts', dest='combined_transcripts' )
+
(options, args) = parser.parse_args()
# output version # of tool
@@ -115,6 +118,9 @@
if returncode != 0:
raise Exception, stderr
+ # Copy outputs.
+ shutil.copyfile( "cc_output.combined.gtf" , options.combined_transcripts )
+
# check that there are results in the output file
cc_output_fname = "cc_output.stats"
if len( open( cc_output_fname, 'rb' ).read().strip() ) == 0:
--- a/tools/ngs_rna/cuffcompare_wrapper.xml Tue Jun 21 16:22:14 2011 -0400
+++ b/tools/ngs_rna/cuffcompare_wrapper.xml Wed Jun 22 08:36:48 2011 -0400
@@ -26,11 +26,15 @@
--index_dir=${GALAXY_DATA_INDEX_DIR}
#end if
+ ## Outputs.
+ --combined-transcripts=${transcripts_combined}
+
## Inputs.
${first_input}
#for $input_file in $input_files:
${input_file.additional_input}
#end for
+
</command><inputs><param format="gtf" name="first_input" type="data" label="GTF file produced by Cufflinks" help=""/>
@@ -86,7 +90,7 @@
<data format="tabular" name="transcripts_tracking" label="${tool.name} on ${on_string}: transcript tracking" from_work_dir="cc_output.tracking"><filter>len( input_files ) > 0</filter></data>
- <data format="gtf" name="transcripts_combined" label="${tool.name} on ${on_string}: combined transcripts" from_work_dir="cc_output.combined.gtf"/>
+ <data format="gtf" name="transcripts_combined" label="${tool.name} on ${on_string}: combined transcripts"/></outputs><tests>
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 a new select list to the upload form in the Galaxy tool shed with the following label:
by Bitbucket 21 Jun '11
by Bitbucket 21 Jun '11
21 Jun '11
1 new changeset in galaxy-central:
http://bitbucket.org/galaxy/galaxy-central/changeset/d4e90b847749/
changeset: d4e90b847749
user: greg
date: 2011-06-21 22:22:14
summary: Add a new select list to the upload form in the Galaxy tool shed with the following label:
Remove files in the repository (relative to the upload point) that are not in the uploaded archive?
The selection pertains only to uploaded tar archives, not to single file uploads. If Yes is selected, files that exist in the repository (relative to the selected upload point) but that are not in the uploaded archive will be removed from the repository. Otherwise, all existing repository files will remain and the uploaded archive will be added to the repository. Fixes issue # 585.
affected #: 4 files (4.4 KB)
--- a/lib/galaxy/webapps/community/controllers/upload.py Tue Jun 21 10:14:24 2011 -0400
+++ b/lib/galaxy/webapps/community/controllers/upload.py Tue Jun 21 16:22:14 2011 -0400
@@ -2,7 +2,7 @@
from galaxy.web.base.controller import *
from galaxy.model.orm import *
from galaxy.datatypes.checkers import *
-from common import get_categories, get_repository, hg_add, hg_clone, hg_commit, hg_push, update_for_browsing
+from common import get_categories, get_repository, hg_add, hg_clone, hg_commit, hg_push, hg_remove, update_for_browsing
from mercurial import hg, ui
log = logging.getLogger( __name__ )
@@ -29,6 +29,7 @@
repo_dir = repository.repo_path
repo = hg.repository( ui.ui(), repo_dir )
uncompress_file = util.string_as_bool( params.get( 'uncompress_file', 'true' ) )
+ remove_repo_files_not_in_tar = util.string_as_bool( params.get( 'remove_repo_files_not_in_tar', 'true' ) )
uploaded_file = None
upload_point = params.get( 'upload_point', None )
if upload_point is not None:
@@ -144,8 +145,21 @@
# Clone the repository to a temporary location.
tmp_dir, cloned_repo_dir = hg_clone( trans, repository, current_working_dir )
# Move the uploaded files to the upload_point within the cloned repository.
- self.__move_to_upload_point( upload_point, uploaded_file, uploaded_file_name, uploaded_file_filename, cloned_repo_dir, istar, tar )
- # Add the files to the cloned repository.
+ files_to_remove = self.__move_to_upload_point( repository,
+ upload_point,
+ uploaded_file,
+ uploaded_file_name,
+ uploaded_file_filename,
+ cloned_repo_dir,
+ istar,
+ tar,
+ remove_repo_files_not_in_tar )
+ if remove_repo_files_not_in_tar and files_to_remove:
+ # Remove files in the repository (relative to the upload point)
+ # that are not in the uploaded archive.
+ for repo_file in files_to_remove:
+ hg_remove( repo_file, current_working_dir, cloned_repo_dir )
+ # Add the files in the uploaded archive to the cloned repository.
hg_add( trans, current_working_dir, cloned_repo_dir )
# Commit the files to the cloned repository.
if not commit_message:
@@ -165,6 +179,8 @@
else:
uncompress_str = ' '
message = "The file '%s' has been successfully%suploaded to the repository." % ( uploaded_file_filename, uncompress_str )
+ if istar and remove_repo_files_not_in_tar:
+ message += " %d files were removed from the repository." % len( files_to_remove )
else:
message = 'No changes to repository.'
trans.response.send_redirect( web.url_for( controller='repository',
@@ -199,6 +215,7 @@
repository=repository,
commit_message=commit_message,
uncompress_file=uncompress_file,
+ remove_repo_files_not_in_tar=remove_repo_files_not_in_tar,
message=message,
status=status )
def uncompress( self, repository, uploaded_file_name, uploaded_file_filename, isgzip, isbz2 ):
@@ -242,7 +259,9 @@
os.close( fd )
bzipped_file.close()
shutil.move( uncompressed, uploaded_file_name )
- def __move_to_upload_point( self, upload_point, uploaded_file, uploaded_file_name, uploaded_file_filename, cloned_repo_dir, istar, tar ):
+ def __move_to_upload_point( self, repository, upload_point, uploaded_file, uploaded_file_name,
+ uploaded_file_filename, cloned_repo_dir, istar, tar, remove_repo_files_not_in_tar ):
+ files_to_remove = []
if upload_point is not None:
if istar:
full_path = os.path.abspath( os.path.join( cloned_repo_dir, upload_point ) )
@@ -254,6 +273,22 @@
else:
full_path = os.path.abspath( os.path.join( cloned_repo_dir, uploaded_file_filename ) )
if istar:
+ if remove_repo_files_not_in_tar:
+ # Discover those files that are in the repository, but not in the uploaded archive
+ filenames_in_archive = [ tarinfo_obj.name for tarinfo_obj in tar.getmembers() ]
+ for root, dirs, files in os.walk( full_path ):
+ relative_dir = root.split( 'repo_%d' % repository.id )[1].lstrip( '/' )
+ if not root.find( '.hg' ) >= 0 and not root.find( 'hgrc' ) >= 0:
+ if '.hg' in dirs:
+ # Don't visit .hg directories
+ dirs.remove( '.hg' )
+ if 'hgrc' in files:
+ # Don't include hgrc files in commit - should be impossible
+ # since we don't visit .hg dirs, but just in case...
+ files.remove( 'hgrc' )
+ for name in files:
+ if name not in filenames_in_archive:
+ files_to_remove.append( os.path.join( relative_dir, name ) )
# Extract the uploaded tarball to the load_point within the cloned repository hierarchy
tar.extractall( path=full_path )
tar.close()
@@ -261,6 +296,7 @@
else:
# Move the uploaded file to the load_point within the cloned repository hierarchy
shutil.move( uploaded_file_name, full_path )
+ return files_to_remove
def __check_archive( self, archive ):
for member in archive.getmembers():
# Allow regular files and directories only
--- a/templates/webapps/community/repository/manage_repository.mako Tue Jun 21 10:14:24 2011 -0400
+++ b/templates/webapps/community/repository/manage_repository.mako Tue Jun 21 16:22:14 2011 -0400
@@ -111,7 +111,11 @@
</div><div class="form-row"><label>Version:</label>
- ${tip}
+ %if can_view_change_log:
+ <a href="${h.url_for( controller='repository', action='view_changelog', id=trans.app.security.encode_id( repository.id ) )}">${tip}</a>
+ %else:
+ ${tip}
+ %endif
</div><div class="form-row"><label>Owner:</label>
--- a/templates/webapps/community/repository/upload.mako Tue Jun 21 10:14:24 2011 -0400
+++ b/templates/webapps/community/repository/upload.mako Tue Jun 21 16:22:14 2011 -0400
@@ -97,7 +97,30 @@
</div></div><div class="form-row">
- <label>Message:</label>
+ <%
+ if remove_repo_files_not_in_tar:
+ yes_selected = 'selected'
+ no_selected = ''
+ else:
+ yes_selected = ''
+ no_selected = 'selected'
+ %>
+ <label>Remove files in the repository (relative to the upload point) that are not in the uploaded archive?</label>
+ <div class="form-row-input">
+ <select name="remove_repo_files_not_in_tar">
+ <option value="true" ${yes_selected}>Yes
+ <option value="false" ${no_selected}>No
+ </select>
+ </div>
+ <div class="toolParamHelp" style="clear: both;">
+ This selection pertains only to uploaded tar archives, not to single file uploads. If <b>Yes</b> is selected, files
+ that exist in the repository (relative to the upload point) but that are not in the uploaded archive will be removed
+ from the repository. Otherwise, all existing repository files will remain and the uploaded archive files will be added
+ to the repository.
+ </div>
+ </div>
+ <div class="form-row">
+ <label>Change set commit message:</label><div class="form-row-input">
%if commit_message:
<textarea name="commit_message" rows="3" cols="35">${commit_message}</textarea>
@@ -118,7 +141,8 @@
</div><input type="hidden" id="upload_point" name="upload_point" value=""/><div class="toolParamHelp" style="clear: both;">
- Select a location within the repository to upload your files by clicking a check box next to the location. If a location is not selected, files will be uploaded to the repository root.
+ Select a location within the repository to upload your files by clicking a check box next to the location. If a location
+ is not selected, files will be uploaded to the repository root.
</div><div style="clear: both"></div></div>
--- a/templates/webapps/community/repository/view_repository.mako Tue Jun 21 10:14:24 2011 -0400
+++ b/templates/webapps/community/repository/view_repository.mako Tue Jun 21 16:22:14 2011 -0400
@@ -100,7 +100,11 @@
</div><div class="form-row"><label>Name:</label>
- ${repository.name}
+ %if can_browse_contents:
+ <a href="${h.url_for( controller='repository', action='browse_repository', id=trans.app.security.encode_id( repository.id ) )}">${repository.name}</a>
+ %else:
+ ${repository.name}
+ %endif
</div><div class="form-row"><label>Description:</label>
@@ -108,7 +112,11 @@
</div><div class="form-row"><label>Version:</label>
- ${tip}
+ %if can_view_change_log:
+ <a href="${h.url_for( controller='repository', action='view_changelog', id=trans.app.security.encode_id( repository.id ) )}">${tip}</a>
+ %else:
+ ${tip}
+ %endif
</div><div class="form-row"><label>Owner:</label>
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 security checks for enabling the ability to delete files in a tool shed repository.
by Bitbucket 21 Jun '11
by Bitbucket 21 Jun '11
21 Jun '11
1 new changeset in galaxy-central:
http://bitbucket.org/galaxy/galaxy-central/changeset/e23f05a3fb41/
changeset: e23f05a3fb41
user: greg
date: 2011-06-21 16:14:24
summary: Add security checks for enabling the ability to delete files in a tool shed repository.
affected #: 6 files (1.2 KB)
--- a/templates/webapps/community/repository/browse_repository.mako Tue Jun 21 09:38:06 2011 -0400
+++ b/templates/webapps/community/repository/browse_repository.mako Tue Jun 21 10:14:24 2011 -0400
@@ -93,38 +93,52 @@
%if can_browse_contents:
<div class="toolForm"><div class="toolFormTitle">Browse ${repository.name}</div>
- <form name="select_files_to_delete" id="select_files_to_delete" action="${h.url_for( controller='repository', action='select_files_to_delete', id=trans.security.encode_id( repository.id ))}" method="post" >
- <div class="form-row" >
- <label>Contents:</label>
- <div id="tree" >
- Loading...
+ %if can_push:
+ <form name="select_files_to_delete" id="select_files_to_delete" action="${h.url_for( controller='repository', action='select_files_to_delete', id=trans.security.encode_id( repository.id ))}" method="post" >
+ <div class="form-row" >
+ <label>Contents:</label>
+ <div id="tree" >
+ Loading...
+ </div>
+ <div class="toolParamHelp" style="clear: both;">
+ Click on a file to display it's contents below. You may delete files from the repository by clicking the check box next to each file and clicking the <b>Delete selected files</b> button.
+ </div>
+ <input id="selected_files_to_delete" name="selected_files_to_delete" type="hidden" value=""/></div>
- <div class="toolParamHelp" style="clear: both;">
- Click on a file to display it's contents below. You may delete files from the repository by clicking the check box next to each file and clicking the <b>Delete selected files</b> button.
+ <div class="form-row">
+ <label>Message:</label>
+ <div class="form-row-input">
+ %if commit_message:
+ <textarea name="commit_message" rows="3" cols="35">${commit_message}</textarea>
+ %else:
+ <textarea name="commit_message" rows="3" cols="35"></textarea>
+ %endif
+ </div>
+ <div class="toolParamHelp" style="clear: both;">
+ This is the commit message for the mercurial change set that will be created if you delete selected files.
+ </div>
+ <div style="clear: both"></div></div>
- <input id="selected_files_to_delete" name="selected_files_to_delete" type="hidden" value=""/>
+ <div class="form-row">
+ <input type="submit" name="select_files_to_delete_button" value="Delete selected files"/>
+ </div>
+ <div class="form-row">
+ <div id="file_contents" class="toolParamHelp" style="clear: both;background-color:#FAFAFA;"></div>
+ </div>
+ </form>
+ %else:
+ <div class="toolFormBody">
+ <div class="form-row" >
+ <label>Contents:</label>
+ <div id="tree" >
+ Loading...
+ </div>
+ </div>
+ <div class="form-row">
+ <div id="file_contents" class="toolParamHelp" style="clear: both;background-color:#FAFAFA;"></div>
+ </div></div>
- <div class="form-row">
- <label>Message:</label>
- <div class="form-row-input">
- %if commit_message:
- <textarea name="commit_message" rows="3" cols="35">${commit_message}</textarea>
- %else:
- <textarea name="commit_message" rows="3" cols="35"></textarea>
- %endif
- </div>
- <div class="toolParamHelp" style="clear: both;">
- This is the commit message for the mercurial change set that will be created if you delete selected files.
- </div>
- <div style="clear: both"></div>
- </div>
- <div class="form-row">
- <input type="submit" name="select_files_to_delete_button" value="Delete selected files"/>
- </div>
- <div class="form-row">
- <div id="file_contents" class="toolParamHelp" style="clear: both;background-color:#FAFAFA;"></div>
- </div>
- </form>
+ %endif
</div><p/>
%endif
--- a/templates/webapps/community/repository/manage_repository.mako Tue Jun 21 09:38:06 2011 -0400
+++ b/templates/webapps/community/repository/manage_repository.mako Tue Jun 21 10:14:24 2011 -0400
@@ -11,6 +11,10 @@
can_browse_contents = not is_new
can_rate = not is_new and repository.user != trans.user
can_view_change_log = not is_new
+ if can_push:
+ browse_label = 'Browse or delete repository files'
+ else:
+ browse_label = 'Browse repository files'
%><%!
@@ -74,7 +78,7 @@
<a class="action-button" href="${h.url_for( controller='repository', action='rate_repository', id=trans.app.security.encode_id( repository.id ) )}">Rate repository</a>
%endif
%if can_browse_contents:
- <a class="action-button" href="${h.url_for( controller='repository', action='browse_repository', id=trans.app.security.encode_id( repository.id ) )}">Browse or delete repository files</a>
+ <a class="action-button" href="${h.url_for( controller='repository', action='browse_repository', id=trans.app.security.encode_id( repository.id ) )}">${browse_label}</a>
%endif
<a class="action-button" href="${h.url_for( controller='repository', action='download', repository_id=trans.app.security.encode_id( repository.id ), 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 ), file_type='bz2' )}">Download as a .tar.bz2 file</a>
--- a/templates/webapps/community/repository/rate_repository.mako Tue Jun 21 09:38:06 2011 -0400
+++ b/templates/webapps/community/repository/rate_repository.mako Tue Jun 21 10:14:24 2011 -0400
@@ -11,6 +11,10 @@
can_rate = repository.user != trans.user
can_manage = repository.user == trans.user
can_view_change_log = not is_new
+ if can_push:
+ browse_label = 'Browse or delete repository files'
+ else:
+ browse_label = 'Browse repository files'
%><%!
@@ -79,7 +83,7 @@
<a class="action-button" href="${h.url_for( controller='repository', action='view_changelog', id=trans.app.security.encode_id( repository.id ) )}">View change log</a>
%endif
%if can_browse_contents:
- <a class="action-button" href="${h.url_for( controller='repository', action='browse_repository', id=trans.app.security.encode_id( repository.id ) )}">Browse or delete repository files</a>
+ <a class="action-button" href="${h.url_for( controller='repository', action='browse_repository', id=trans.app.security.encode_id( repository.id ) )}">${browse_label}</a>
%endif
<a class="action-button" href="${h.url_for( controller='repository', action='download', repository_id=trans.app.security.encode_id( repository.id ), 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 ), file_type='bz2' )}">Download as a .tar.bz2 file</a>
--- a/templates/webapps/community/repository/view_changelog.mako Tue Jun 21 09:38:06 2011 -0400
+++ b/templates/webapps/community/repository/view_changelog.mako Tue Jun 21 10:14:24 2011 -0400
@@ -11,6 +11,10 @@
can_push = trans.app.security_agent.can_push( trans.user, repository )
can_rate = repository.user != trans.user
can_upload = can_push
+ if can_push:
+ browse_label = 'Browse or delete repository files'
+ else:
+ browse_label = 'Browse repository files'
%><%!
@@ -48,7 +52,7 @@
<a class="action-button" href="${h.url_for( controller='repository', action='rate_repository', id=trans.app.security.encode_id( repository.id ) )}">Rate repository</a>
%endif
%if can_browse_contents:
- <a class="action-button" href="${h.url_for( controller='repository', action='browse_repository', id=trans.app.security.encode_id( repository.id ) )}">Browse or delete repository files</a>
+ <a class="action-button" href="${h.url_for( controller='repository', action='browse_repository', id=trans.app.security.encode_id( repository.id ) )}">${browse_label}</a>
%endif
<a class="action-button" href="${h.url_for( controller='repository', action='download', repository_id=trans.app.security.encode_id( repository.id ), 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 ), file_type='bz2' )}">Download as a .tar.bz2 file</a>
--- a/templates/webapps/community/repository/view_changeset.mako Tue Jun 21 09:38:06 2011 -0400
+++ b/templates/webapps/community/repository/view_changeset.mako Tue Jun 21 10:14:24 2011 -0400
@@ -12,6 +12,10 @@
can_push = trans.app.security_agent.can_push( trans.user, repository )
can_view_change_log = not is_new
can_upload = can_push
+ if can_push:
+ browse_label = 'Browse or delete repository files'
+ else:
+ browse_label = 'Browse repository files'
%><%!
@@ -52,7 +56,7 @@
<a class="action-button" href="${h.url_for( controller='repository', action='rate_repository', id=trans.app.security.encode_id( repository.id ) )}">Rate repository</a>
%endif
%if can_browse_contents:
- <a class="action-button" href="${h.url_for( controller='repository', action='browse_repository', id=trans.app.security.encode_id( repository.id ) )}">Browse or delete repository files</a>
+ <a class="action-button" href="${h.url_for( controller='repository', action='browse_repository', id=trans.app.security.encode_id( repository.id ) )}">${browse_label}</a>
%endif
<a class="action-button" href="${h.url_for( controller='repository', action='download', repository_id=trans.app.security.encode_id( repository.id ), 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 ), file_type='bz2' )}">Download as a .tar.bz2 file</a>
--- a/templates/webapps/community/repository/view_repository.mako Tue Jun 21 09:38:06 2011 -0400
+++ b/templates/webapps/community/repository/view_repository.mako Tue Jun 21 10:14:24 2011 -0400
@@ -11,6 +11,10 @@
can_upload = can_push
can_browse_contents = not is_new
can_view_change_log = not is_new
+ if can_push:
+ browse_label = 'Browse or delete repository files'
+ else:
+ browse_label = 'Browse repository files'
%><%!
@@ -74,7 +78,7 @@
<a class="action-button" href="${h.url_for( controller='repository', action='rate_repository', id=trans.app.security.encode_id( repository.id ) )}">Rate repository</a>
%endif
%if can_browse_contents:
- <a class="action-button" href="${h.url_for( controller='repository', action='browse_repository', id=trans.app.security.encode_id( repository.id ) )}">Browse or delete repository files</a>
+ <a class="action-button" href="${h.url_for( controller='repository', action='browse_repository', id=trans.app.security.encode_id( repository.id ) )}">${browse_label}</a>
%endif
<a class="action-button" href="${h.url_for( controller='repository', action='download', repository_id=trans.app.security.encode_id( repository.id ), 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 ), file_type='bz2' )}">Download as a .tar.bz2 file</a>
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

21 Jun '11
1 new changeset in galaxy-central:
http://bitbucket.org/galaxy/galaxy-central/changeset/dbd80b36e0ba/
changeset: dbd80b36e0ba
user: greg
date: 2011-06-21 15:38:06
summary: Add the ability to select files for deletion from the repository using the built-in file browser. Any number of selected files will be deleted. Selecting a folder will delete all of it's contents. Fixes issue # 584.
affected #: 11 files (8.7 KB)
--- a/lib/galaxy/webapps/community/controllers/common.py Mon Jun 20 17:02:51 2011 -0400
+++ b/lib/galaxy/webapps/community/controllers/common.py Tue Jun 21 09:38:06 2011 -0400
@@ -1,10 +1,11 @@
-import tarfile
+import os, tarfile, tempfile, shutil
from galaxy.web.base.controller import *
from galaxy.webapps.community import model
from galaxy.model.orm import *
from galaxy.web.framework.helpers import time_ago, iff, grids
from galaxy.web.form_builder import SelectField
from galaxy.model.item_attrs import UsesItemRatings
+from mercurial import hg, ui
import logging
log = logging.getLogger( __name__ )
@@ -58,3 +59,55 @@
def get_user( trans, id ):
"""Get a user from the database"""
return trans.sa_session.query( trans.model.User ).get( trans.security.decode_id( id ) )
+def hg_add( trans, current_working_dir, cloned_repo_dir ):
+ # Add files to a cloned repository. If they're already tracked, this should do nothing.
+ os.chdir( cloned_repo_dir )
+ os.system( 'hg add > /dev/null 2>&1' )
+ os.chdir( current_working_dir )
+def hg_clone( trans, repository, current_working_dir ):
+ # Make a clone of a repository in a temporary location.
+ repo_dir = repository.repo_path
+ tmp_dir = tempfile.mkdtemp()
+ tmp_archive_dir = os.path.join( tmp_dir, 'tmp_archive_dir' )
+ if not os.path.exists( tmp_archive_dir ):
+ os.makedirs( tmp_archive_dir )
+ cmd = "hg clone %s > /dev/null 2>&1" % os.path.abspath( repo_dir )
+ os.chdir( tmp_archive_dir )
+ os.system( cmd )
+ os.chdir( current_working_dir )
+ cloned_repo_dir = os.path.join( tmp_archive_dir, 'repo_%d' % repository.id )
+ return tmp_dir, cloned_repo_dir
+def hg_commit( commit_message, current_working_dir, cloned_repo_dir ):
+ # Commit a change set to a cloned repository.
+ if not commit_message:
+ commit_message = "No commit message"
+ os.chdir( cloned_repo_dir )
+ os.system( "hg commit -m '%s' > /dev/null 2>&1" % commit_message )
+ os.chdir( current_working_dir )
+def hg_push( trans, repository, current_working_dir, cloned_repo_dir ):
+ # Push a change set from a cloned repository to a master repository.
+ repo_dir = repository.repo_path
+ repo = hg.repository( ui.ui(), repo_dir )
+ # We want these change sets to be associated with the owner of the repository, so we'll
+ # set the HGUSER environment variable accordingly.
+ os.environ[ 'HGUSER' ] = trans.user.username
+ cmd = "hg push %s > /dev/null 2>&1" % os.path.abspath( repo_dir )
+ os.chdir( cloned_repo_dir )
+ os.system( cmd )
+ os.chdir( current_working_dir )
+def hg_remove( file_path, current_working_dir, cloned_repo_dir ):
+ # Remove a file path from a cloned repository. Since mercurial doesn't track
+ # directories (only files), directories are automatically removed when they
+ # become empty.
+ abs_file_path = os.path.join( cloned_repo_dir, file_path )
+ if os.path.exists( abs_file_path ):
+ cmd = 'hg remove %s > /dev/null 2>&1' % file_path
+ os.chdir( cloned_repo_dir )
+ os.system( cmd )
+ os.chdir( current_working_dir )
+def update_for_browsing( repository, current_working_dir ):
+ # Make a copy of a repository's files for browsing.
+ repo_dir = repository.repo_path
+ os.chdir( repo_dir )
+ os.system( 'hg update > /dev/null 2>&1' )
+ os.chdir( current_working_dir )
--- a/lib/galaxy/webapps/community/controllers/repository.py Mon Jun 20 17:02:51 2011 -0400
+++ b/lib/galaxy/webapps/community/controllers/repository.py Tue Jun 21 09:38:06 2011 -0400
@@ -378,7 +378,13 @@
return config.get( "web", option )
raise Exception( "Repository %s missing allow_push entry under the [web] option in it's hgrc file." % repository.name )
def __set_allow_push( self, repository, usernames, remove_auth='' ):
- # TODO: Use the mercurial api to handle this
+ """
+ # TODO: Use the mercurial api to handle this, something like the following:
+ items = repo.ui.configitems( section, untrusted=False )
+ push_section = repo.ui.config( 'hgrc', 'allow_push' )
+ for XXX (in name you want to add):
+ repo.ui.updateconfig( section=extensions_section, name='XXX', value='YYY' )
+ """
hgrc_file = os.path.abspath( os.path.join( repository.repo_path, ".hg", "hgrc" ) )
fh, fn = tempfile.mkstemp()
for i, line in enumerate( open( hgrc_file ) ):
@@ -403,6 +409,7 @@
params = util.Params( kwd )
message = util.restore_text( params.get( 'message', '' ) )
status = params.get( 'status', 'done' )
+ commit_message = util.restore_text( params.get( 'commit_message', 'Deleted selected files' ) )
repository = get_repository( trans, id )
repo = hg.repository( ui.ui(), repository.repo_path )
# Our current support for browsing a repository requires copies of the
@@ -416,6 +423,56 @@
return trans.fill_template( '/webapps/community/repository/browse_repository.mako',
repo=repo,
repository=repository,
+ commit_message=commit_message,
+ message=message,
+ status=status )
+ @web.expose
+ def select_files_to_delete( self, trans, id, **kwd ):
+ params = util.Params( kwd )
+ message = util.restore_text( params.get( 'message', '' ) )
+ status = params.get( 'status', 'done' )
+ commit_message = util.restore_text( params.get( 'commit_message', 'Deleted selected files' ) )
+ repository = get_repository( trans, id )
+ _ui = ui.ui()
+ repo_dir = repository.repo_path
+ repo = hg.repository( _ui, repo_dir )
+ selected_files_to_delete = util.restore_text( params.get( 'selected_files_to_delete', '' ) )
+ if params.get( 'select_files_to_delete_button', False ):
+ if selected_files_to_delete:
+ selected_files_to_delete = selected_files_to_delete.split( ',' )
+ current_working_dir = os.getcwd()
+ # Get the current repository tip.
+ tip = repo[ 'tip' ]
+ # Clone the repository to a temporary location.
+ tmp_dir, cloned_repo_dir = hg_clone( trans, repository, current_working_dir )
+ # Delete the selected files from the repository.
+ cloned_repo = hg.repository( _ui, cloned_repo_dir )
+ for selected_file in selected_files_to_delete:
+ selected_file_path = selected_file.split( 'repo_%d' % repository.id )[ 1 ].lstrip( '/' )
+ hg_remove( selected_file_path, current_working_dir, cloned_repo_dir )
+ # Commit the change set.
+ if not commit_message:
+ commit_message = 'Deleted selected files'
+ hg_commit( commit_message, current_working_dir, cloned_repo_dir )
+ # Push the change set from the cloned repository to the master repository.
+ hg_push( trans, repository, current_working_dir, cloned_repo_dir )
+ # Remove the temporary directory containing the cloned repository.
+ shutil.rmtree( tmp_dir )
+ # Update the repository files for browsing.
+ update_for_browsing( repository, current_working_dir )
+ # Get the new repository tip.
+ repo = hg.repository( _ui, repo_dir )
+ if tip != repo[ 'tip' ]:
+ message = "The selected files were deleted from the repository."
+ else:
+ message = 'No changes to repository.'
+ else:
+ message = "Select at least 1 file to delete from the repository before clicking <b>Delete selected files</b>."
+ status = "error"
+ return trans.fill_template( '/webapps/community/repository/browse_repository.mako',
+ repo=repo,
+ repository=repository,
+ commit_message=commit_message,
message=message,
status=status )
@web.expose
--- a/lib/galaxy/webapps/community/controllers/upload.py Mon Jun 20 17:02:51 2011 -0400
+++ b/lib/galaxy/webapps/community/controllers/upload.py Tue Jun 21 09:38:06 2011 -0400
@@ -2,7 +2,7 @@
from galaxy.web.base.controller import *
from galaxy.model.orm import *
from galaxy.datatypes.checkers import *
-from common import get_categories, get_repository
+from common import get_categories, get_repository, hg_add, hg_clone, hg_commit, hg_push, update_for_browsing
from mercurial import hg, ui
log = logging.getLogger( __name__ )
@@ -139,12 +139,39 @@
# We have a repository that is not new (it contains files).
if uncompress_file and ( isgzip or isbz2 ):
uploaded_file_filename = self.uncompress( repository, uploaded_file_name, uploaded_file_filename, isgzip, isbz2 )
+ # Get the current repository tip.
+ tip = repo[ 'tip' ]
# Clone the repository to a temporary location.
- tmp_dir, cloned_repo_dir = self.__hg_clone( trans, repository, repo_dir, current_working_dir )
+ tmp_dir, cloned_repo_dir = hg_clone( trans, repository, current_working_dir )
# Move the uploaded files to the upload_point within the cloned repository.
self.__move_to_upload_point( upload_point, uploaded_file, uploaded_file_name, uploaded_file_filename, cloned_repo_dir, istar, tar )
- # Commit and push the changes from the cloned repo to the master repo.
- self.__hg_push( trans, repository, file_data.filename, uncompress_file, commit_message, current_working_dir, cloned_repo_dir, repo_dir, tmp_dir )
+ # Add the files to the cloned repository.
+ hg_add( trans, current_working_dir, cloned_repo_dir )
+ # Commit the files to the cloned repository.
+ if not commit_message:
+ commit_message = 'Uploaded'
+ hg_commit( commit_message, current_working_dir, cloned_repo_dir )
+ # Push the changes from the cloned repository to the master repository.
+ hg_push( trans, repository, current_working_dir, cloned_repo_dir )
+ # Remove the temporary directory containing the cloned repository.
+ shutil.rmtree( tmp_dir )
+ # Update the repository files for browsing.
+ update_for_browsing( repository, current_working_dir )
+ # Get the new repository tip.
+ repo = hg.repository( ui.ui(), repo_dir )
+ if tip != repo[ 'tip' ]:
+ if uncompress_file:
+ uncompress_str = ' uncompressed and '
+ else:
+ uncompress_str = ' '
+ message = "The file '%s' has been successfully%suploaded to the repository." % ( uploaded_file_filename, uncompress_str )
+ else:
+ message = 'No changes to repository.'
+ trans.response.send_redirect( web.url_for( controller='repository',
+ action='browse_repository',
+ commit_message='Deleted selected files',
+ message=message,
+ id=trans.security.encode_id( repository.id ) ) )
if ok:
if files_to_commit:
repo.dirstate.write()
@@ -159,6 +186,7 @@
message = "The file '%s' has been successfully%suploaded to the repository." % ( uploaded_file_filename, uncompress_str )
trans.response.send_redirect( web.url_for( controller='repository',
action='browse_repository',
+ commit_message='Deleted selected files',
message=message,
id=trans.security.encode_id( repository.id ) ) )
else:
@@ -214,55 +242,6 @@
os.close( fd )
bzipped_file.close()
shutil.move( uncompressed, uploaded_file_name )
- def __hg_clone( self, trans, repository, repo_dir, current_working_dir ):
- tmp_dir = tempfile.mkdtemp()
- tmp_archive_dir = os.path.join( tmp_dir, 'tmp_archive_dir' )
- if not os.path.exists( tmp_archive_dir ):
- os.makedirs( tmp_archive_dir )
- # Make a clone of the repository in a temporary location
- cmd = "hg clone %s > /dev/null 2>&1" % os.path.abspath( repo_dir )
- os.chdir( tmp_archive_dir )
- os.system( cmd )
- os.chdir( current_working_dir )
- cloned_repo_dir = os.path.join( tmp_archive_dir, 'repo_%d' % repository.id )
- return tmp_dir, cloned_repo_dir
- def __hg_push( self, trans, repository, filename, uncompress_file, commit_message, current_working_dir, cloned_repo_dir, repo_dir, tmp_dir ):
- repo = hg.repository( ui.ui(), repo_dir )
- tip = repo[ 'tip' ]
- # We want these change sets to be associated with the owner of the repository, so we'll
- # set the HGUSER environment variable accordingly.
- os.environ[ 'HGUSER' ] = trans.user.username
- # Add the file to the cloned repository. If it's already tracked, this should do nothing.
- os.chdir( cloned_repo_dir )
- os.system( 'hg add > /dev/null 2>&1' )
- os.chdir( current_working_dir )
- os.chdir( cloned_repo_dir )
- # Commit the change set to the cloned repository
- os.system( "hg commit -m '%s' > /dev/null 2>&1" % commit_message )
- os.chdir( current_working_dir )
- # Push the change set to the master repository
- cmd = "hg push %s > /dev/null 2>&1" % os.path.abspath( repo_dir )
- os.chdir( cloned_repo_dir )
- os.system( cmd )
- os.chdir( current_working_dir )
- # Make a copy of the updated repository files for browsing.
- os.chdir( repo_dir )
- os.system( 'hg update > /dev/null 2>&1' )
- os.chdir( current_working_dir )
- shutil.rmtree( tmp_dir )
- repo = hg.repository( ui.ui(), repo_dir )
- if tip != repo[ 'tip' ]:
- if uncompress_file:
- uncompress_str = ' uncompressed and '
- else:
- uncompress_str = ' '
- message = "The file '%s' has been successfully%suploaded to the repository." % ( filename, uncompress_str )
- else:
- message = 'No changes in uploaded files.'
- trans.response.send_redirect( web.url_for( controller='repository',
- action='browse_repository',
- message=message,
- id=trans.security.encode_id( repository.id ) ) )
def __move_to_upload_point( self, upload_point, uploaded_file, uploaded_file_name, uploaded_file_filename, cloned_repo_dir, istar, tar ):
if upload_point is not None:
if istar:
--- a/templates/webapps/community/repository/browse_repository.mako Mon Jun 20 17:02:51 2011 -0400
+++ b/templates/webapps/community/repository/browse_repository.mako Tue Jun 21 09:38:06 2011 -0400
@@ -93,17 +93,38 @@
%if can_browse_contents:
<div class="toolForm"><div class="toolFormTitle">Browse ${repository.name}</div>
- <div class="toolFormBody">
+ <form name="select_files_to_delete" id="select_files_to_delete" action="${h.url_for( controller='repository', action='select_files_to_delete', id=trans.security.encode_id( repository.id ))}" method="post" ><div class="form-row" ><label>Contents:</label><div id="tree" >
Loading...
</div>
+ <div class="toolParamHelp" style="clear: both;">
+ Click on a file to display it's contents below. You may delete files from the repository by clicking the check box next to each file and clicking the <b>Delete selected files</b> button.
+ </div>
+ <input id="selected_files_to_delete" name="selected_files_to_delete" type="hidden" value=""/>
+ </div>
+ <div class="form-row">
+ <label>Message:</label>
+ <div class="form-row-input">
+ %if commit_message:
+ <textarea name="commit_message" rows="3" cols="35">${commit_message}</textarea>
+ %else:
+ <textarea name="commit_message" rows="3" cols="35"></textarea>
+ %endif
+ </div>
+ <div class="toolParamHelp" style="clear: both;">
+ This is the commit message for the mercurial change set that will be created if you delete selected files.
+ </div>
+ <div style="clear: both"></div>
+ </div>
+ <div class="form-row">
+ <input type="submit" name="select_files_to_delete_button" value="Delete selected files"/></div><div class="form-row"><div id="file_contents" class="toolParamHelp" style="clear: both;background-color:#FAFAFA;"></div></div>
- </div>
+ </form></div><p/>
%endif
--- a/templates/webapps/community/repository/common.mako Mon Jun 20 17:02:51 2011 -0400
+++ b/templates/webapps/community/repository/common.mako Tue Jun 21 09:38:06 2011 -0400
@@ -35,11 +35,17 @@
// Display list of selected nodes
var selNodes = dtnode.tree.getSelectedNodes();
// convert to title/key array
- var selKeys = $.map(selNodes, function(node){
+ var selKeys = $.map(selNodes, function(node) {
return node.data.key;
});
- // The following is used only in the upload form.
- document.upload_form.upload_point.value = selKeys[0];
+ if (document.forms["select_files_to_delete"]) {
+ // The following is used only ~/templates/webapps/community/repository/browse_repository.mako.
+ document.select_files_to_delete.selected_files_to_delete.value = selKeys.join(",");
+ }
+ // The following is used only in ~/templates/webapps/community/repository/upload.mako.
+ if (document.forms["upload_form"]) {
+ document.upload_form.upload_point.value = selKeys[0];
+ }
},
onActivate: function(dtnode) {
var cell = $("#file_contents");
--- a/templates/webapps/community/repository/manage_repository.mako Mon Jun 20 17:02:51 2011 -0400
+++ b/templates/webapps/community/repository/manage_repository.mako Tue Jun 21 09:38:06 2011 -0400
@@ -74,7 +74,7 @@
<a class="action-button" href="${h.url_for( controller='repository', action='rate_repository', id=trans.app.security.encode_id( repository.id ) )}">Rate repository</a>
%endif
%if can_browse_contents:
- <a class="action-button" href="${h.url_for( controller='repository', action='browse_repository', id=trans.app.security.encode_id( repository.id ) )}">Browse repository</a>
+ <a class="action-button" href="${h.url_for( controller='repository', action='browse_repository', id=trans.app.security.encode_id( repository.id ) )}">Browse or delete repository files</a>
%endif
<a class="action-button" href="${h.url_for( controller='repository', action='download', repository_id=trans.app.security.encode_id( repository.id ), 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 ), file_type='bz2' )}">Download as a .tar.bz2 file</a>
--- a/templates/webapps/community/repository/rate_repository.mako Mon Jun 20 17:02:51 2011 -0400
+++ b/templates/webapps/community/repository/rate_repository.mako Tue Jun 21 09:38:06 2011 -0400
@@ -79,7 +79,7 @@
<a class="action-button" href="${h.url_for( controller='repository', action='view_changelog', id=trans.app.security.encode_id( repository.id ) )}">View change log</a>
%endif
%if can_browse_contents:
- <a class="action-button" href="${h.url_for( controller='repository', action='browse_repository', id=trans.app.security.encode_id( repository.id ) )}">Browse repository</a>
+ <a class="action-button" href="${h.url_for( controller='repository', action='browse_repository', id=trans.app.security.encode_id( repository.id ) )}">Browse or delete repository files</a>
%endif
<a class="action-button" href="${h.url_for( controller='repository', action='download', repository_id=trans.app.security.encode_id( repository.id ), 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 ), file_type='bz2' )}">Download as a .tar.bz2 file</a>
--- a/templates/webapps/community/repository/upload.mako Mon Jun 20 17:02:51 2011 -0400
+++ b/templates/webapps/community/repository/upload.mako Tue Jun 21 09:38:06 2011 -0400
@@ -55,7 +55,7 @@
<a class="action-button" href="${h.url_for( controller='repository', action='view_changelog', id=trans.app.security.encode_id( repository.id ) )}">View change log</a>
%endif
%if can_browse_contents:
- <a class="action-button" href="${h.url_for( controller='repository', action='browse_repository', id=trans.app.security.encode_id( repository.id ) )}">Browse repository</a>
+ <a class="action-button" href="${h.url_for( controller='repository', action='browse_repository', id=trans.app.security.encode_id( repository.id ) )}">Browse or delete repository files</a>
%endif
</div></ul>
@@ -106,7 +106,7 @@
%endif
</div><div class="toolParamHelp" style="clear: both;">
- This is the commit message for the mercurial change set that will be created by this upload
+ This is the commit message for the mercurial change set that will be created by this upload.
</div><div style="clear: both"></div></div>
--- a/templates/webapps/community/repository/view_changelog.mako Mon Jun 20 17:02:51 2011 -0400
+++ b/templates/webapps/community/repository/view_changelog.mako Tue Jun 21 09:38:06 2011 -0400
@@ -48,7 +48,7 @@
<a class="action-button" href="${h.url_for( controller='repository', action='rate_repository', id=trans.app.security.encode_id( repository.id ) )}">Rate repository</a>
%endif
%if can_browse_contents:
- <a class="action-button" href="${h.url_for( controller='repository', action='browse_repository', id=trans.app.security.encode_id( repository.id ) )}">Browse repository</a>
+ <a class="action-button" href="${h.url_for( controller='repository', action='browse_repository', id=trans.app.security.encode_id( repository.id ) )}">Browse or delete repository files</a>
%endif
<a class="action-button" href="${h.url_for( controller='repository', action='download', repository_id=trans.app.security.encode_id( repository.id ), 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 ), file_type='bz2' )}">Download as a .tar.bz2 file</a>
--- a/templates/webapps/community/repository/view_changeset.mako Mon Jun 20 17:02:51 2011 -0400
+++ b/templates/webapps/community/repository/view_changeset.mako Tue Jun 21 09:38:06 2011 -0400
@@ -52,7 +52,7 @@
<a class="action-button" href="${h.url_for( controller='repository', action='rate_repository', id=trans.app.security.encode_id( repository.id ) )}">Rate repository</a>
%endif
%if can_browse_contents:
- <a class="action-button" href="${h.url_for( controller='repository', action='browse_repository', id=trans.app.security.encode_id( repository.id ) )}">Browse repository</a>
+ <a class="action-button" href="${h.url_for( controller='repository', action='browse_repository', id=trans.app.security.encode_id( repository.id ) )}">Browse or delete repository files</a>
%endif
<a class="action-button" href="${h.url_for( controller='repository', action='download', repository_id=trans.app.security.encode_id( repository.id ), 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 ), file_type='bz2' )}">Download as a .tar.bz2 file</a>
--- a/templates/webapps/community/repository/view_repository.mako Mon Jun 20 17:02:51 2011 -0400
+++ b/templates/webapps/community/repository/view_repository.mako Tue Jun 21 09:38:06 2011 -0400
@@ -74,7 +74,7 @@
<a class="action-button" href="${h.url_for( controller='repository', action='rate_repository', id=trans.app.security.encode_id( repository.id ) )}">Rate repository</a>
%endif
%if can_browse_contents:
- <a class="action-button" href="${h.url_for( controller='repository', action='browse_repository', id=trans.app.security.encode_id( repository.id ) )}">Browse repository</a>
+ <a class="action-button" href="${h.url_for( controller='repository', action='browse_repository', id=trans.app.security.encode_id( repository.id ) )}">Browse or delete repository files</a>
%endif
<a class="action-button" href="${h.url_for( controller='repository', action='download', repository_id=trans.app.security.encode_id( repository.id ), 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 ), file_type='bz2' )}">Download as a .tar.bz2 file</a>
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: natefoo: Add the download/save icon to errored datasets which contain data. Fixes #207 and #583.
by Bitbucket 20 Jun '11
by Bitbucket 20 Jun '11
20 Jun '11
1 new changeset in galaxy-central:
http://bitbucket.org/galaxy/galaxy-central/changeset/3fb285cb031d/
changeset: 3fb285cb031d
user: natefoo
date: 2011-06-20 23:02:51
summary: Add the download/save icon to errored datasets which contain data. Fixes #207 and #583.
affected #: 1 file (50 bytes)
--- a/templates/root/history_common.mako Wed May 25 17:26:36 2011 +0100
+++ b/templates/root/history_common.mako Mon Jun 20 17:02:51 2011 -0400
@@ -1,9 +1,35 @@
<% _=n_ %>
+
+<%def name="render_download_links( data, dataset_id )">
+ <%
+ from galaxy.datatypes.metadata import FileParameter
+ %>
+ %if not data.purged:
+ ## Check for downloadable metadata files
+ <% meta_files = [ k for k in data.metadata.spec.keys() if isinstance( data.metadata.spec[k].param, FileParameter ) ] %>
+ %if meta_files:
+ <div popupmenu="dataset-${dataset_id}-popup">
+ <a class="action-button" href="${h.url_for( controller='dataset', action='display', dataset_id=dataset_id, \
+ to_ext=data.ext )}">Download Dataset</a>
+ <a>Additional Files</a>
+ %for file_type in meta_files:
+ <a class="action-button" href="${h.url_for( controller='dataset', action='get_metadata_file', \
+ hda_id=dataset_id, metadata_name=file_type )}">Download ${file_type}</a>
+ %endfor
+ </div>
+ <div style="float:left;" class="menubutton split popup" id="dataset-${dataset_id}-popup">
+ %endif
+ <a href="${h.url_for( controller='dataset', action='display', dataset_id=dataset_id, to_ext=data.ext )}" title="Download" class="icon-button disk tooltip"></a>
+ %if meta_files:
+ </div>
+ %endif
+ %endif
+</%def>
+
## Render the dataset `data` as history item, using `hid` as the displayed id
<%def name="render_dataset( data, hid, show_deleted_on_refresh = False, for_editing = True, display_structured = False )"><%
dataset_id = trans.security.encode_id( data.id )
- from galaxy.datatypes.metadata import FileParameter
if data.state in ['no state','',None]:
data_state = "queued"
@@ -126,6 +152,9 @@
</div><div><a href="${h.url_for( controller='dataset', action='errors', id=data.id )}" target="galaxy_main" title="View or report this error" class="icon-button bug tooltip"></a>
+ %if data.has_data():
+ ${render_download_links( data, dataset_id )}
+ %endif
<a href="${h.url_for( controller='dataset', action='show_params', dataset_id=dataset_id )}" target="galaxy_main" title="View Details" class="icon-button information tooltip"></a>
%if for_editing:
<a href="${h.url_for( controller='tool_runner', action='rerun', id=data.id )}" target="galaxy_main" title="Run this job again" class="icon-button arrow-circle tooltip"></a>
@@ -169,26 +198,7 @@
%endif
<div>
%if data.has_data():
- %if not data.purged:
- ## Check for downloadable metadata files
- <% meta_files = [ k for k in data.metadata.spec.keys() if isinstance( data.metadata.spec[k].param, FileParameter ) ] %>
- %if meta_files:
- <div popupmenu="dataset-${dataset_id}-popup">
- <a class="action-button" href="${h.url_for( controller='dataset', action='display', dataset_id=dataset_id, \
- to_ext=data.ext )}">Download Dataset</a>
- <a>Additional Files</a>
- %for file_type in meta_files:
- <a class="action-button" href="${h.url_for( controller='dataset', action='get_metadata_file', \
- hda_id=dataset_id, metadata_name=file_type )}">Download ${file_type}</a>
- %endfor
- </div>
- <div style="float:left;" class="menubutton split popup" id="dataset-${dataset_id}-popup">
- %endif
- <a href="${h.url_for( controller='dataset', action='display', dataset_id=dataset_id, to_ext=data.ext )}" title="Download" class="icon-button disk tooltip"></a>
- %if meta_files:
- </div>
- %endif
- %endif
+ ${render_download_links( data, dataset_id )}
<a href="${h.url_for( controller='dataset', action='show_params', dataset_id=dataset_id )}" target="galaxy_main" title="View Details" class="icon-button information tooltip"></a>
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
2 new changesets in galaxy-central:
http://bitbucket.org/galaxy/galaxy-central/changeset/80b92e7b5d8c/
changeset: 80b92e7b5d8c
user: natefoo
date: 2011-06-20 19:43:19
summary: Make the ability for users to purge their own data conditional on a config variable. Due to limitations in the grid framework, the button can't be removed from the history grid, but clicking it just does the same thing as delete but adds a message explaining that the purge operation wasn't performed.
affected #: 6 files (1.3 KB)
--- a/lib/galaxy/config.py Fri Jun 17 16:45:25 2011 -0400
+++ b/lib/galaxy/config.py Mon Jun 20 13:43:19 2011 -0400
@@ -61,6 +61,7 @@
self.require_login = string_as_bool( kwargs.get( "require_login", "False" ) )
self.allow_user_creation = string_as_bool( kwargs.get( "allow_user_creation", "True" ) )
self.allow_user_deletion = string_as_bool( kwargs.get( "allow_user_deletion", "False" ) )
+ self.allow_user_dataset_purge = string_as_bool( kwargs.get( "allow_user_dataset_purge", "False" ) )
self.new_user_dataset_access_role_default_private = string_as_bool( kwargs.get( "new_user_dataset_access_role_default_private", "False" ) )
self.template_path = resolve_path( kwargs.get( "template_path", "templates" ), self.root )
self.template_cache = resolve_path( kwargs.get( "template_cache_path", "database/compiled_templates" ), self.root )
--- a/lib/galaxy/web/controllers/dataset.py Fri Jun 17 16:45:25 2011 -0400
+++ b/lib/galaxy/web/controllers/dataset.py Mon Jun 20 13:43:19 2011 -0400
@@ -746,12 +746,16 @@
@web.expose
def purge( self, trans, id ):
+ if not trans.app.config.allow_user_dataset_purge:
+ raise Exception( "Removal of datasets by users is not allowed in this Galaxy instance. Please contact your Galaxy administrator." )
if self._purge( trans, id ):
return trans.response.send_redirect( web.url_for( controller='root', action='history', show_deleted = True ) )
raise Exception( "Error removing disk file" )
@web.expose
def purge_async( self, trans, id ):
+ if not trans.app.config.allow_user_dataset_purge:
+ raise Exception( "Removal of datasets by users is not allowed in this Galaxy instance. Please contact your Galaxy administrator." )
if self._purge( trans, id ):
return "OK"
raise Exception( "Error removing disk file" )
--- a/lib/galaxy/web/controllers/history.py Fri Jun 17 16:45:25 2011 -0400
+++ b/lib/galaxy/web/controllers/history.py Mon Jun 20 13:43:19 2011 -0400
@@ -270,7 +270,7 @@
trans.new_history()
trans.log_event( "History (%s) marked as deleted" % history.name )
n_deleted += 1
- if purge:
+ if purge and trans.app.config.allow_user_dataset_purge:
for hda in history.datasets:
hda.purged = True
trans.sa_session.add( hda )
@@ -285,8 +285,10 @@
trans.sa_session.flush()
if n_deleted:
part = "Deleted %d %s" % ( n_deleted, iff( n_deleted != 1, "histories", "history" ) )
- if purge:
+ if purge and trans.app.config.allow_user_dataset_purge:
part += " and removed %s datasets from disk" % iff( n_deleted != 1, "their", "its" )
+ elif purge:
+ part += " but the datasets were not removed from disk because that feature is not enabled in this Galaxy instance"
message_parts.append( "%s. " % part )
if deleted_current:
message_parts.append( "Your active history was deleted, a new empty history is now active. " )
@@ -1213,4 +1215,4 @@
trans.set_history( hist )
return trans.response.send_redirect( url_for( "/" ) )
-
\ No newline at end of file
+
--- a/lib/galaxy/web/controllers/root.py Fri Jun 17 16:45:25 2011 -0400
+++ b/lib/galaxy/web/controllers/root.py Mon Jun 20 13:43:19 2011 -0400
@@ -504,6 +504,8 @@
@web.expose
def purge( self, trans, id = None, show_deleted_on_refresh = False, **kwd ):
+ if not trans.app.config.allow_user_dataset_purge:
+ return trans.show_error_message( "Removal of datasets by users is not allowed in this Galaxy instance. Please contact your Galaxy administrator." )
hda = trans.sa_session.query( self.app.model.HistoryDatasetAssociation ).get( int( id ) )
if bool( hda.dataset.active_history_associations or hda.dataset.library_associations ):
return trans.show_error_message( "Unable to purge: LDDA(s) or active HDA(s) exist" )
--- a/templates/root/history_common.mako Fri Jun 17 16:45:25 2011 -0400
+++ b/templates/root/history_common.mako Mon Jun 20 13:43:19 2011 -0400
@@ -23,7 +23,12 @@
%if data.dataset.purged or data.purged:
This dataset has been deleted and removed from disk.
%else:
- This dataset has been deleted. Click <a href="${h.url_for( controller='dataset', action='undelete', id=data.id )}" class="historyItemUndelete" id="historyItemUndeleter-${data.id}" target="galaxy_history">here</a> to undelete or <a href="${h.url_for( controller='dataset', action='purge', id=data.id )}" class="historyItemPurge" id="historyItemPurger-${data.id}" target="galaxy_history">here</a> to immediately remove from disk.
+ This dataset has been deleted. Click <a href="${h.url_for( controller='dataset', action='undelete', id=data.id )}" class="historyItemUndelete" id="historyItemUndeleter-${data.id}" target="galaxy_history">here</a> to undelete
+ %if trans.app.config.allow_user_dataset_purge:
+ or <a href="${h.url_for( controller='dataset', action='purge', id=data.id )}" class="historyItemPurge" id="historyItemPurger-${data.id}" target="galaxy_history">here</a> to immediately remove it from disk.
+ %else:
+ it.
+ %endif
%endif
</strong></div>
%endif
--- a/universe_wsgi.ini.sample Fri Jun 17 16:45:25 2011 -0400
+++ b/universe_wsgi.ini.sample Mon Jun 20 13:43:19 2011 -0400
@@ -401,6 +401,11 @@
# Allow administrators to delete accounts.
#allow_user_deletion = False
+# Allow users to remove their datasets from disk immediately (otherwise,
+# datasets will be removed after a time period specified by an administrator in
+# the cleanup scripts run via cron)
+#allow_user_dataset_purge = False
+
# By default, users' data will be public, but setting this to True will cause
# it to be private. Does not affect existing users and data, only ones created
# after this option is set. Users may still change their default back to
http://bitbucket.org/galaxy/galaxy-central/changeset/e74e89a4c03a/
changeset: e74e89a4c03a
user: peterjc
date: 2011-05-25 18:26:36
summary: Cope with white space at start of command after processing template (see issue #159)
affected #: 1 file (113 bytes)
--- a/lib/galaxy/tools/__init__.py Mon Jun 20 13:43:19 2011 -0400
+++ b/lib/galaxy/tools/__init__.py Wed May 25 17:26:36 2011 +0100
@@ -379,15 +379,10 @@
command = root.find("command")
if command is not None and command.text is not None:
self.command = command.text.lstrip() # get rid of leading whitespace
- interpreter = command.get("interpreter")
- if interpreter:
- # TODO: path munging for cluster/dataset server relocatability
- executable = self.command.split()[0]
- abs_executable = os.path.abspath(os.path.join(self.tool_dir, executable))
- self.command = self.command.replace(executable, abs_executable, 1)
- self.command = interpreter + " " + self.command
else:
self.command = ''
+ # Must pre-pend this AFTER processing the cheetah command template
+ self.interpreter = command.get("interpreter", None)
# Parameters used to build URL for redirection to external app
redirect_url_params = root.find( "redirect_url_params" )
if redirect_url_params is not None and redirect_url_params.text is not None:
@@ -1588,12 +1583,18 @@
try:
# Substituting parameters into the command
command_line = fill_template( self.command, context=param_dict )
- # Remove newlines from command line
- command_line = command_line.replace( "\n", " " ).replace( "\r", " " )
+ # Remove newlines from command line, and any leading/trailing white space
+ command_line = command_line.replace( "\n", " " ).replace( "\r", " " ).strip()
except Exception, e:
# Modify exception message to be more clear
#e.args = ( 'Error substituting into command line. Params: %r, Command: %s' % ( param_dict, self.command ) )
raise
+ if self.interpreter:
+ # TODO: path munging for cluster/dataset server relocatability
+ executable = command_line.split()[0]
+ abs_executable = os.path.abspath(os.path.join(self.tool_dir, executable))
+ command_line = command_line.replace(executable, abs_executable, 1)
+ command_line = self.interpreter + " " + command_line
return command_line
def build_dependency_shell_commands( self ):
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

17 Jun '11
1 new changeset in galaxy-central:
http://bitbucket.org/galaxy/galaxy-central/changeset/d1f2d2e5246a/
changeset: d1f2d2e5246a
user: kanwei
date: 2011-06-17 22:45:25
summary: Escaping in tests should be more specific
affected #: 1 file (6 bytes)
--- a/test/base/twilltestcase.py Fri Jun 17 16:16:28 2011 -0400
+++ b/test/base/twilltestcase.py Fri Jun 17 16:45:25 2011 -0400
@@ -242,10 +242,10 @@
self.visit_page( "history" )
for subpatt in patt.split():
try:
- tc.find( escape(subpatt) )
+ tc.find( subpatt )
except:
fname = self.write_temp_file( tc.browser.get_html() )
- errmsg = "no match to '%s'\npage content written to '%s'" % ( escape(subpatt), fname )
+ errmsg = "no match to '%s'\npage content written to '%s'" % ( subpatt, fname )
raise AssertionError( errmsg )
self.home()
def clear_history( self ):
@@ -384,7 +384,7 @@
"""Switches to a history in the current list of histories"""
self.visit_url( "%s/history/list?operation=switch&id=%s" % ( self.url, id ) )
if name:
- self.check_history_for_string( name )
+ self.check_history_for_string( escape( name ) )
self.home()
def view_stored_active_histories( self, strings_displayed=[] ):
self.home()
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: natefoo: Missing migration script from the last commit.
by Bitbucket 17 Jun '11
by Bitbucket 17 Jun '11
17 Jun '11
1 new changeset in galaxy-central:
http://bitbucket.org/galaxy/galaxy-central/changeset/4e3f43848b51/
changeset: 4e3f43848b51
user: natefoo
date: 2011-06-17 22:16:28
summary: Missing migration script from the last commit.
affected #: 1 file (0 bytes)
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