示例#1
0
 def __init__(self,
              name,
              fileobj,
              delimiter=None,
              quotechar=None,
              encoding='utf-8',
              window=None,
              doublequote=None,
              lineterminator=None,
              skipinitialspace=None):
     self.name = name
     seekable_fileobj = messytables.seekable_stream(fileobj)
     self.fileobj = UTF8Recoder(seekable_fileobj, encoding)
     self.lines = ilines(self.fileobj)
     self._sample = []
     self.delimiter = delimiter
     self.quotechar = quotechar
     self.window = window or 1000
     self.doublequote = doublequote
     self.lineterminator = lineterminator
     self.skipinitialspace = skipinitialspace
     try:
         for i in xrange(self.window):
             self._sample.append(self.lines.next())
     except StopIteration:
         pass
     super(CSVRowSet, self).__init__()
示例#2
0
 def __init__(
     self,
     name,
     fileobj,
     delimiter=None,
     quotechar=None,
     encoding="utf-8",
     window=None,
     doublequote=None,
     lineterminator=None,
     skipinitialspace=None,
 ):
     self.name = name
     seekable_fileobj = messytables.seekable_stream(fileobj)
     self.fileobj = UTF8Recoder(seekable_fileobj, encoding)
     self.lines = ilines(self.fileobj)
     self._sample = []
     self.delimiter = delimiter
     self.quotechar = quotechar
     self.window = window or 1000
     self.doublequote = doublequote
     self.lineterminator = lineterminator
     self.skipinitialspace = skipinitialspace
     try:
         for i in xrange(self.window):
             self._sample.append(self.lines.next())
     except StopIteration:
         pass
     super(CSVRowSet, self).__init__()
示例#3
0
 def __init__(self, name, fileobj, window=1000):
     self.name = name
     self.fileobj = fileobj
     self.lines = ilines(fileobj)
     self._sample = []
     try:
         for i in xrange(window):
             self._sample.append(self.lines.next())
     except StopIteration:
         pass
     super(CSVRowSet, self).__init__()
示例#4
0
 def __init__(self, name, fileobj, delimiter=None,
              encoding='utf-8', window=1000):
     self.name = name
     self.fileobj = UTF8Recoder(fileobj, encoding)
     self.lines = ilines(self.fileobj)
     self._sample = []
     self.delimiter = delimiter or ','
     try:
         for i in xrange(window):
             self._sample.append(self.lines.next())
     except StopIteration:
         pass
     super(CSVRowSet, self).__init__()
示例#5
0
 def __init__(self, name, fileobj, delimiter=None,
              encoding='utf-8', window=1000):
     self.name = name
     self.fileobj = UTF8Recoder(fileobj, encoding)
     self.lines = ilines(self.fileobj)
     self._sample = []
     self.delimiter = delimiter or ','
     try:
         for i in xrange(window):
             self._sample.append(self.lines.next())
     except StopIteration:
         pass
     super(CSVRowSet, self).__init__()
示例#6
0
 def __init__(self, name, fileobj, delimiter=None, quotechar=None,
              encoding='utf-8', window=None):
     self.name = name
     seekable_fileobj = messytables.seekable_stream(fileobj)
     self.fileobj = UTF8Recoder(seekable_fileobj, encoding)
     self.lines = ilines(self.fileobj)
     self._sample = []
     self.delimiter = delimiter or ','
     self.quotechar = quotechar or '"'
     self.window = window or 1000
     try:
         for i in xrange(self.window):
             self._sample.append(self.lines.next())
     except StopIteration:
         pass
     super(CSVRowSet, self).__init__()