Fix for displaying peek columns if a column contains no data.

This commit is contained in:
Greg Von Kuster
2008-07-21 10:51:46 -04:00
parent 2c38721060
commit f8c00de9bc
2 changed files with 5 additions and 4 deletions
+5 -3
View File
@@ -255,7 +255,7 @@ class Interval( Tabular ):
>>> Interval().sniff( fname )
True
"""
headers = get_headers( filename, '\t' )
headers = get_headers( filename, '\t' )
try:
"""
If we got here, we already know the file is_column_based and is not bed,
@@ -266,8 +266,10 @@ class Interval( Tabular ):
if len(hdr) < 3:
return False
try:
int( hdr[1] )
int( hdr[2] )
# Assume chrom start and end are in column positions 1 and 2
# respectively ( for 0 based columns )
check = int( hdr[1] )
check = int( hdr[2] )
except:
return False
return True
-1
View File
@@ -57,7 +57,6 @@ class Tabular( data.Text ):
if i == 100:
# We're about to end our loop, so default col_type to 'str'
col_type = 'str'
column_types.append( col_type )
else:
# Missing a column value, so go to the next line
column_types = []