mirror of
https://github.com/kennethreitz/tablib.git
synced 2026-06-05 15:00:19 +00:00
Typo.
This commit is contained in:
+18
-15
@@ -22,7 +22,7 @@ class Dataset(object):
|
||||
self.__headers = None
|
||||
|
||||
# ('title', index) tuples
|
||||
self._seperators = []
|
||||
self._separators = []
|
||||
|
||||
try:
|
||||
self.headers = kwargs['headers']
|
||||
@@ -36,6 +36,7 @@ class Dataset(object):
|
||||
|
||||
self._register_formats()
|
||||
|
||||
|
||||
def __len__(self):
|
||||
return self.height
|
||||
|
||||
@@ -197,24 +198,26 @@ class Dataset(object):
|
||||
self._data = [tuple([row]) for row in col]
|
||||
|
||||
|
||||
def insert_seperator(self, index, text='-'):
|
||||
"""Adds a seperator to Dataset at given index."""
|
||||
def insert_separator(self, index, text='-'):
|
||||
"""Adds a separator to Dataset at given index."""
|
||||
|
||||
if self.height >= index:
|
||||
sep = (index, text)
|
||||
self._seperators.append(sep)
|
||||
sep = (index, text)
|
||||
self._separators.append(sep)
|
||||
|
||||
|
||||
def append_separator(self, text='-'):
|
||||
"""Adds a separator to Dataset."""
|
||||
|
||||
# change offsets if headers are or aren't defined
|
||||
if not self.headers:
|
||||
index = self.height if self.height else 0
|
||||
else:
|
||||
raise InvalidDimensions
|
||||
index = (self.height + 1) if self.height else 1
|
||||
|
||||
self.insert_separator(index, text)
|
||||
|
||||
|
||||
def append_seperator(self, text='-'):
|
||||
"""Adds a seperator to Dataset."""
|
||||
|
||||
index = self.height if self.headers else (self.height - 1)
|
||||
self.insert_seperator(index, text)
|
||||
|
||||
|
||||
def insert(self, i, row=None, col=None):
|
||||
def insert(self, i, row=None):
|
||||
"""Inserts a row at given position in Dataset"""
|
||||
if row:
|
||||
self._validate(row)
|
||||
|
||||
Reference in New Issue
Block a user