[hg] galaxy 2623: Fix for multi-byte file uploads
details: http://www.bx.psu.edu/hg/galaxy/rev/16b1ca0b2746 changeset: 2623:16b1ca0b2746 user: Nate Coraor <nate@bx.psu.edu> date: Tue Aug 25 14:58:37 2009 -0400 description: Fix for multi-byte file uploads 3 file(s) affected in this change: lib/galaxy/tools/actions/upload.py lib/galaxy/tools/parameters/grouping.py tools/data_source/upload.py diffs (46 lines): diff -r 3a22898d47f5 -r 16b1ca0b2746 lib/galaxy/tools/actions/upload.py --- a/lib/galaxy/tools/actions/upload.py Tue Aug 25 12:58:38 2009 -0400 +++ b/lib/galaxy/tools/actions/upload.py Tue Aug 25 14:58:37 2009 -0400 @@ -104,6 +104,7 @@ except: is_binary = None json = dict( file_type = uploaded_dataset.file_type, + ext = uploaded_dataset.ext, name = uploaded_dataset.name, dataset_id = data.dataset.id, dbkey = uploaded_dataset.dbkey, diff -r 3a22898d47f5 -r 16b1ca0b2746 lib/galaxy/tools/parameters/grouping.py --- a/lib/galaxy/tools/parameters/grouping.py Tue Aug 25 12:58:38 2009 -0400 +++ b/lib/galaxy/tools/parameters/grouping.py Tue Aug 25 14:58:37 2009 -0400 @@ -327,6 +327,8 @@ rval = [] for dataset in datasets: dataset.file_type = file_type + dataset.datatype = d_type + dataset.ext = self.get_datatype_ext( trans, context ) dataset.dbkey = dbkey rval.append( dataset ) return rval diff -r 3a22898d47f5 -r 16b1ca0b2746 tools/data_source/upload.py --- a/tools/data_source/upload.py Tue Aug 25 12:58:38 2009 -0400 +++ b/tools/data_source/upload.py Tue Aug 25 14:58:37 2009 -0400 @@ -136,7 +136,7 @@ file_err( 'The uploaded file is empty', dataset, json_file ) return if 'is_multi_byte' not in dir( dataset ): - dataset.is_multi_byte = util.is_multi_byte( open( dataset.path, 'r' ).read( 1024 )[:100] ) + dataset.is_multi_byte = util.is_multi_byte( open( dataset.path, 'r' ).read( 1024 ) ) if dataset.is_multi_byte: ext = sniff.guess_ext( dataset.path, is_multi_byte=True ) data_type = ext @@ -225,6 +225,10 @@ ext = dataset.file_type data_type = ext # Save job info for the framework + if ext == 'auto' and dataset.ext: + ext = dataset.ext + if ext == 'auto': + ext = 'data' info = dict( type = 'dataset', dataset_id = dataset.dataset_id, path = dataset.path,
participants (1)
-
Greg Von Kuster