mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
Merge branch 'release_16.04' into dev
This commit is contained in:
@@ -297,6 +297,10 @@ def guess_ext( fname, sniff_order, is_multi_byte=False ):
|
||||
>>> guess_ext(fname, sniff_order)
|
||||
'gff3'
|
||||
>>> fname = get_test_fname('temp.txt')
|
||||
>>> file(fname, 'wt').write("a\\t2")
|
||||
>>> guess_ext(fname, sniff_order)
|
||||
'txt'
|
||||
>>> fname = get_test_fname('temp.txt')
|
||||
>>> file(fname, 'wt').write("a\\t2\\nc\\t1\\nd\\t0")
|
||||
>>> guess_ext(fname, sniff_order)
|
||||
'tabular'
|
||||
|
||||
@@ -923,15 +923,19 @@ class BaseCSV( TabularData ):
|
||||
# No columns so not separated by this dialect.
|
||||
return False
|
||||
|
||||
# check all rows can be read as otherwise set_meta throws an exception
|
||||
# Check that there is a second row as it is used by set_meta and
|
||||
# that all rows can be read
|
||||
if self.strict_width:
|
||||
num_columns = len(header_row)
|
||||
found_second_line = False
|
||||
for data_row in reader:
|
||||
found_second_line = True
|
||||
# All columns must be the same length
|
||||
if num_columns != len(data_row):
|
||||
return False
|
||||
if not found_second_line:
|
||||
return False
|
||||
else:
|
||||
# Check the next row as it is used by set_meta
|
||||
data_row = reader.next()
|
||||
if len(data_row) < 2:
|
||||
# No columns so not separated by this dialect.
|
||||
@@ -958,7 +962,6 @@ class BaseCSV( TabularData ):
|
||||
"""
|
||||
if not csv.Sniffer().has_header(open(filename, 'r').read(self.big_peek_size)):
|
||||
return False
|
||||
|
||||
return True
|
||||
except:
|
||||
# Not readable by Python's csv using this dialect
|
||||
@@ -995,8 +998,8 @@ class BaseCSV( TabularData ):
|
||||
@dataproviders.decorators.has_dataproviders
|
||||
class CSV( BaseCSV ):
|
||||
"""
|
||||
Comma separated table data.
|
||||
Only sniffs comma separated files with at least 2 columns
|
||||
Comma-separated table data.
|
||||
Only sniffs comma-separated files with at least 2 rows and 2 columns.
|
||||
"""
|
||||
|
||||
def __init__(self, **kwd):
|
||||
@@ -1009,14 +1012,16 @@ class CSV( BaseCSV ):
|
||||
@dataproviders.decorators.has_dataproviders
|
||||
class TSV( BaseCSV ):
|
||||
"""
|
||||
Comma separated table data.
|
||||
Only sniff tab separated files with at least two columns
|
||||
Tab-separated table data.
|
||||
Only sniff tab-separated files with at least 2 rows and 2 columns.
|
||||
|
||||
Note: Use of this datatype is optional as the general tabular format will handle most tab separated files.
|
||||
This datatype would only be required for dataset with tabs INSIDE double quotes.
|
||||
Note: Use of this datatype is optional as the general tabular datatype will
|
||||
handle most tab-separated files. This datatype is only required for datasets
|
||||
with tabs INSIDE double quotes.
|
||||
|
||||
This datatype currently does not support tsv files where the header has one column less to indicate first column is row names
|
||||
This kind of file is handled fine by tabular.
|
||||
This datatype currently does not support TSV files where the header has one
|
||||
column less to indicate first column is row names. This kind of file is
|
||||
handled fine by the tabular datatype.
|
||||
"""
|
||||
|
||||
def __init__(self, **kwd):
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
<%inherit file="/base.mako"/>
|
||||
<%namespace file="/message.mako" import="render_msg" />
|
||||
<% from galaxy.util import listify %>
|
||||
<% from galaxy.util import nice_size %>
|
||||
<% from galaxy.util import listify, nice_size, unicodify %>
|
||||
|
||||
<style>
|
||||
.inherit {
|
||||
@@ -142,7 +141,7 @@
|
||||
encoded_history_id = trans.security.encode_id( hda.history_id )
|
||||
%>
|
||||
<tr><td>Name:</td><td>${hda.name | h}</td></tr>
|
||||
<tr><td>Created:</td><td>${hda.create_time.strftime(trans.app.config.pretty_datetime_format)}</td></tr>
|
||||
<tr><td>Created:</td><td>${unicodify(hda.create_time.strftime(trans.app.config.pretty_datetime_format))}</td></tr>
|
||||
## <tr><td>Copied from another history?</td><td>${hda.source_library_dataset}</td></tr>
|
||||
<tr><td>Filesize:</td><td>${nice_size(hda.dataset.file_size)}</td></tr>
|
||||
<tr><td>Dbkey:</td><td>${hda.dbkey | h}</td></tr>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<%inherit file="/base.mako"/>
|
||||
<%namespace file="/message.mako" import="render_msg" />
|
||||
<% from galaxy.util import nice_size %>
|
||||
<% from galaxy.util import nice_size, unicodify %>
|
||||
|
||||
<%def name="title()">Data Manager: ${ data_manager.name | h } - ${ data_manager.description | h }</%def>
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr><td>Name:</td><td>${hda.name | h}</td></tr>
|
||||
<tr><td>Created:</td><td>${hda.create_time.strftime(trans.app.config.pretty_datetime_format) | h}</td></tr>
|
||||
<tr><td>Created:</td><td>${unicodify(hda.create_time.strftime(trans.app.config.pretty_datetime_format)) | h}</td></tr>
|
||||
<tr><td>Filesize:</td><td>${nice_size(hda.dataset.file_size) | h}</td></tr>
|
||||
<tr><td>Tool Exit Code:</td><td>${job.exit_code | h}</td></tr>
|
||||
<tr><td>Full Path:</td><td>${hda.file_name | h}</td></tr>
|
||||
|
||||
Reference in New Issue
Block a user