A list of lists that can be exported as a comma-separated text file.
(self, rows=[], fields=None, **kwargs)
| 1558 | class CSV(list): |
| 1559 | |
| 1560 | def __init__(self, rows=[], fields=None, **kwargs): |
| 1561 | """ A list of lists that can be exported as a comma-separated text file. |
| 1562 | """ |
| 1563 | fields = fields or kwargs.get("headers", None) |
| 1564 | self.__dict__["fields"] = fields # List of (name, type)-tuples, with type = STRING, INTEGER, etc. |
| 1565 | self.extend(rows) |
| 1566 | |
| 1567 | def _set_headers(self, v): |
| 1568 | self.__dict__["fields"] = v |