12 |
|
|
13 |
__version__ = "$Revision$" |
__version__ = "$Revision$" |
14 |
|
|
15 |
|
import os |
16 |
import inspect |
import inspect |
17 |
import warnings |
import warnings |
18 |
|
|
147 |
self.column_map[name] = col |
self.column_map[name] = col |
148 |
self.column_map[index] = col |
self.column_map[index] = col |
149 |
|
|
150 |
|
def Title(self): |
151 |
|
"""Return the title of the table. |
152 |
|
|
153 |
|
The title is simply the basename of the filename |
154 |
|
""" |
155 |
|
return os.path.basename(self.filename) |
156 |
|
|
157 |
def NumRows(self): |
def NumRows(self): |
158 |
"""Return the number of rows in the table""" |
"""Return the number of rows in the table""" |
159 |
return self.dbf.record_count() |
return self.dbf.record_count() |
257 |
self.dbf.write_record(record, values) |
self.dbf.write_record(record, values) |
258 |
self.dbf.commit() |
self.dbf.commit() |
259 |
|
|
260 |
|
def FileName(self): |
261 |
|
"""Return the filename the DBFTable was instantiated with""" |
262 |
|
return self.filename |
263 |
|
|
264 |
|
|
265 |
class MemoryColumn: |
class MemoryColumn: |
292 |
self.column_map[name] = col |
self.column_map[name] = col |
293 |
self.column_map[index] = col |
self.column_map[index] = col |
294 |
|
|
295 |
|
def Title(self): |
296 |
|
"""Return 'MemoryTable' |
297 |
|
|
298 |
|
Override in derived classes to have a more meaningful title. |
299 |
|
""" |
300 |
|
return "MemoryTable" |
301 |
|
|
302 |
def NumColumns(self): |
def NumColumns(self): |
303 |
"""Return the number of columns in the table""" |
"""Return the number of columns in the table""" |
304 |
return len(self.columns) |
return len(self.columns) |