return self._extend(line, line.split('\t'))
self._parser = tab_parser
+ def open_fileo(self, fileo):
+ '''Setup the buffered text stream for self.fileo
+ '''
+ # Read lines as text with line endings intact.
+ # newline='' required by csv.reader()
+ self._fileo = io.TextIOWrapper(fileo, newline='')
+
+ def close_fileo(self):
+ '''Close self.fileo
+ '''
+ self._fileo.close()
+
def __init__(self, fileo, file_fmt, null_data, null_rep, trim=True):
'''
fileo Uploaded file object
def do_trim(st):
return st
- # Read lines as text with line endings intact.
- # newline='' required by csv.reader()
- self._fileo = io.TextIOWrapper(fileo, newline='')
+ self.open_fileo(fileo)
# Get column headings
eol, self.headers = get_headers()