Bug fix in sniff.py tabular files will no longer inadvertently be changed to txt.

This commit is contained in:
Greg Von Kuster
2007-09-28 12:55:44 +00:00
parent 3a97026d5d
commit 044d221534
+6 -4
View File
@@ -113,14 +113,16 @@ def is_column_based(fname, sep='\t', skip=0):
if not headers:
return False
for hdr in headers[skip:]:
if len(hdr) > 1 and hdr[0] and not hdr[0].startswith('#'):
count = len(hdr)
if hdr and hdr[0] and not hdr[0].startswith('#'):
if len(hdr) > 1:
count = len(hdr)
break
if count < 2:
return False
for hdr in headers[skip:]:
if len(hdr) > 1 and hdr[0] and not hdr[0].startswith('#') and len(hdr) != count:
return False
if hdr and hdr[0] and not hdr[0].startswith('#'):
if len(hdr) != count:
return False
return True
def guess_ext( fname ):