1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/changeset/cc70c3dcd6f7/
changeset: cc70c3dcd6f7
user: jgoecks
date: 2012-05-10 20:08:48
summary: Support UnvalidatedValues when exporting histories.
affected #: 1 file
diff -r 67b5abaaf8bc702529a91a5d1d69318a2aaf6c75 -r cc70c3dcd6f7088d9d1b73e70602162d44172328 lib/galaxy/tools/imp_exp/__init__.py
--- a/lib/galaxy/tools/imp_exp/__init__.py
+++ b/lib/galaxy/tools/imp_exp/__init__.py
@@ -1,5 +1,6 @@
import os, shutil, logging, tempfile, simplejson
from galaxy import model
+from galaxy.tools.parameters.basic import UnvalidatedValue
from galaxy.web.framework.helpers import to_unicode
from galaxy.model.item_attrs import UsesAnnotations
from galaxy.util.json import *
@@ -324,6 +325,8 @@
"annotation" : to_unicode( getattr( obj, 'annotation', '' ) ),
"tags" : get_item_tag_dict( obj ),
}
+ if isinstance( obj, UnvalidatedValue ):
+ return obj.__str__()
return simplejson.JSONEncoder.default( self, obj )
#
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/changeset/b5090cb80444/
changeset: b5090cb80444
user: greg
date: 2012-05-10 02:19:01
summary: Fixes for handling errors when uploading a tarball to a tool shed repository that contains problematic contents. A bit of code cleanup is included as well.
affected #: 1 file
diff -r a722c37dee3fb167c47c6f4b93e74518237f7d28 -r b5090cb8044469b7f5d3136cedbe80f009745f0b lib/galaxy/webapps/community/controllers/upload.py
--- a/lib/galaxy/webapps/community/controllers/upload.py
+++ b/lib/galaxy/webapps/community/controllers/upload.py
@@ -123,15 +123,8 @@
content_alert_str = ''
commands.add( repo.ui, repo, full_path )
# Convert from unicode to prevent "TypeError: array item must be char"
- full_path = full_path.encode('ascii', 'replace')
- try:
- commands.commit( repo.ui, repo, full_path, user=trans.user.username, message=commit_message )
- except Exception, e:
- # I never have a problem with commands.commit on a Mac, but in the test/production
- # tool shed environment, it occasionally throws a "TypeError: array item must be char"
- # exception. If this happens, we'll try the following.
- repo.dirstate.write()
- repo.commit( user=trans.user.username, text=commit_message )
+ full_path = full_path.encode( 'ascii', 'replace' )
+ commands.commit( repo.ui, repo, full_path, user=trans.user.username, message=commit_message )
if full_path.endswith( 'tool_data_table_conf.xml.sample' ):
# Handle the special case where a tool_data_table_conf.xml.sample
# file is being uploaded by parsing the file and adding new entries
@@ -205,18 +198,18 @@
repo = hg.repository( get_configured_ui(), repo_dir )
files_to_remove = []
content_alert_str = ''
+ undesirable_dirs_removed = 0
+ undesirable_files_removed = 0
ok, message = self.__check_archive( tar )
if not ok:
tar.close()
uploaded_file.close()
- return ok, message, files_to_remove, content_alert_str
+ return ok, message, files_to_remove, content_alert_str, undesirable_dirs_removed, undesirable_files_removed
else:
if upload_point is not None:
full_path = os.path.abspath( os.path.join( repo_dir, upload_point ) )
else:
full_path = os.path.abspath( repo_dir )
- undesirable_dirs_removed = 0
- undesirable_files_removed = 0
filenames_in_archive = []
for tarinfo_obj in tar.getmembers():
ok = os.path.basename( tarinfo_obj.name ) not in undesirable_files
@@ -253,14 +246,11 @@
if full_name not in filenames_in_archive:
files_to_remove.append( full_name )
for repo_file in files_to_remove:
- # Remove files in the repository (relative to the upload point)
- # that are not in the uploaded archive.
+ # Remove files in the repository (relative to the upload point) that are not in the uploaded archive.
try:
commands.remove( repo.ui, repo, repo_file, force=True )
except Exception, e:
- # I never have a problem with commands.remove on a Mac, but in the test/production
- # tool shed environment, it throws an exception whenever I delete all files from a
- # repository. If this happens, we'll try the following.
+ log.debug( "Error removing files using the mercurial API, so trying a different approach, the error was: %s" % str( e ))
relative_selected_file = selected_file.split( 'repo_%d' % repository.id )[1].lstrip( '/' )
repo.dirstate.remove( relative_selected_file )
repo.dirstate.write()
@@ -294,18 +284,11 @@
# appending them to the shed's tool_data_table_conf.xml file on disk.
error, message = handle_sample_tool_data_table_conf_file( trans.app, filename_in_archive )
if error:
- return False, message, files_to_remove, content_alert_str
+ return False, message, files_to_remove, content_alert_str, undesirable_dirs_removed, undesirable_files_removed
if filename_in_archive.endswith( '.loc.sample' ):
# Handle the special case where a xxx.loc.sample file is being uploaded by copying it to ~/tool-data/xxx.loc.
copy_sample_file( trans.app, filename_in_archive )
- try:
- commands.commit( repo.ui, repo, full_path, user=trans.user.username, message=commit_message )
- except Exception, e:
- # I never have a problem with commands.commit on a Mac, but in the test/production
- # tool shed environment, it occasionally throws a "TypeError: array item must be char"
- # exception. If this happens, we'll try the following.
- repo.dirstate.write()
- repo.commit( user=trans.user.username, text=commit_message )
+ commands.commit( repo.ui, repo, full_path, user=trans.user.username, message=commit_message )
# See if the content of the change set was valid.
admin_only = len( repository.downloadable_revisions ) != 1
handle_email_alerts( trans, repository, content_alert_str=content_alert_str, new_repo_alert=new_repo_alert, admin_only=admin_only )
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/changeset/a722c37dee3f/
changeset: a722c37dee3f
user: dan
date: 2012-05-09 21:36:15
summary: Fix for clearing implicitly converted dataset association when converted dataset is deleted.
affected #: 1 file
diff -r 17d57db9a7c04467dbd82eaa66027e3fa5e38bc2 -r a722c37dee3fb167c47c6f4b93e74518237f7d28 lib/galaxy/model/__init__.py
--- a/lib/galaxy/model/__init__.py
+++ b/lib/galaxy/model/__init__.py
@@ -1126,8 +1126,10 @@
def clear_associated_files( self, metadata_safe = False, purge = False ):
# metadata_safe = True means to only clear when assoc.metadata_safe == False
for assoc in self.implicitly_converted_datasets:
- if not metadata_safe or not assoc.metadata_safe:
+ if not assoc.deleted and ( not metadata_safe or not assoc.metadata_safe ):
assoc.clear( purge = purge )
+ for assoc in self.implicitly_converted_parent_datasets:
+ assoc.clear( purge = purge, delete_dataset = False )
def get_display_name( self ):
## Name can be either a string or a unicode object. If string, convert to unicode object assuming 'utf-8' format.
hda_name = self.name
@@ -1626,12 +1628,14 @@
self.purged = purged
self.metadata_safe = metadata_safe
- def clear( self, purge = False ):
+ def clear( self, purge = False, delete_dataset = True ):
self.deleted = True
if self.dataset:
- self.dataset.deleted = True
- self.dataset.purged = purge
- if purge: #do something with purging
+ if delete_dataset:
+ self.dataset.deleted = True
+ if purge:
+ self.dataset.purged = True
+ if purge and self.dataset.deleted: #do something with purging
self.purged = True
try: os.unlink( self.file_name )
except Exception, e: print "Failed to purge associated file (%s) from disk: %s" % ( self.file_name, 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 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/changeset/17d57db9a7c0/
changeset: 17d57db9a7c0
user: dannon
date: 2012-05-09 15:12:42
summary: Fix for history_contents API file display.
affected #: 1 file
diff -r 317e326803d42db705c93d4c59e92c1eb764fa36 -r 17d57db9a7c04467dbd82eaa66027e3fa5e38bc2 lib/galaxy/web/api/history_contents.py
--- a/lib/galaxy/web/api/history_contents.py
+++ b/lib/galaxy/web/api/history_contents.py
@@ -55,7 +55,7 @@
try:
item = content.get_api_value( view='element' )
if trans.user_is_admin() or trans.app.config.expose_dataset_path:
- item['file_name'] = hda.file_name
+ item['file_name'] = content.file_name
if not item['deleted']:
# Problem: Method url_for cannot use the dataset controller
# Get the environment from DefaultWebTransaction and use default webapp mapper instead of webapp API mapper
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/changeset/b725cb712c8f/
changeset: b725cb712c8f
user: natefoo
date: 2012-05-08 18:32:01
summary: Fix "TypeError: array item must be char" on tool shed upload.
affected #: 1 file
diff -r 1c196b8747e4d976cbc1d294457b64a7e27fb26c -r b725cb712c8f7764120fdbdac5aa11d306d287f2 lib/galaxy/webapps/community/controllers/upload.py
--- a/lib/galaxy/webapps/community/controllers/upload.py
+++ b/lib/galaxy/webapps/community/controllers/upload.py
@@ -122,6 +122,8 @@
else:
content_alert_str = ''
commands.add( repo.ui, repo, full_path )
+ # Convert from unicode to prevent "TypeError: array item must be char"
+ full_path = full_path.encode('ascii', 'replace')
try:
commands.commit( repo.ui, repo, full_path, user=trans.user.username, message=commit_message )
except Exception, 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.