12 |
|
|
13 |
__version__ = "$Revision$" |
__version__ = "$Revision$" |
14 |
|
|
15 |
|
import os |
16 |
import inspect |
import inspect |
17 |
import warnings |
import warnings |
18 |
|
|
19 |
|
from base import TitledObject |
20 |
|
|
21 |
import dbflib |
import dbflib |
22 |
|
|
23 |
# the field types supported by a Table instance. |
# the field types supported by a Table instance. |
110 |
self.index = index |
self.index = index |
111 |
|
|
112 |
|
|
113 |
class DBFTable(OldTableInterfaceMixin): |
class DBFTable(TitledObject, OldTableInterfaceMixin): |
114 |
|
|
115 |
""" |
""" |
116 |
Table interface for the data in a DBF file |
Table interface for the data in a DBF file |
132 |
|
|
133 |
def __init__(self, filename): |
def __init__(self, filename): |
134 |
self.filename = filename |
self.filename = filename |
135 |
|
title = os.path.basename(self.filename) |
136 |
|
TitledObject.__init__(self, title) |
137 |
self.dbf = dbflib.DBFFile(filename) |
self.dbf = dbflib.DBFFile(filename) |
138 |
|
|
139 |
# If true, self.dbf is open for writing. |
# If true, self.dbf is open for writing. |
266 |
self.type = type |
self.type = type |
267 |
self.index = index |
self.index = index |
268 |
|
|
269 |
class MemoryTable(OldTableInterfaceMixin): |
class MemoryTable(TitledObject, OldTableInterfaceMixin): |
270 |
|
|
271 |
"""Very simple table implementation that operates on a list of tuples""" |
"""Very simple table implementation that operates on a list of tuples""" |
272 |
|
|
278 |
data -- List of tuples, one for each row of data |
data -- List of tuples, one for each row of data |
279 |
""" |
""" |
280 |
self.data = data |
self.data = data |
281 |
|
title = 'MemoryTable' |
282 |
|
TitledObject.__init__(self, title) |
283 |
|
|
284 |
# Create the column information objects |
# Create the column information objects |
285 |
self.columns = [] |
self.columns = [] |