/[thuban]/branches/WIP-pyshapelib-bramz/Thuban/Model/table.py
ViewVC logotype

Diff of /branches/WIP-pyshapelib-bramz/Thuban/Model/table.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 984 by bh, Thu May 22 16:37:48 2003 UTC revision 998 by bh, Thu May 22 19:29:39 2003 UTC
# Line 12  Classes for handling tables of data. Line 12  Classes for handling tables of data.
12    
13  __version__ = "$Revision$"  __version__ = "$Revision$"
14    
15    import os
16  import inspect  import inspect
17  import warnings  import warnings
18    
# Line 146  class DBFTable(OldTableInterfaceMixin): Line 147  class DBFTable(OldTableInterfaceMixin):
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()
# Line 249  class DBFTable(OldTableInterfaceMixin): Line 257  class DBFTable(OldTableInterfaceMixin):
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:
# Line 281  class MemoryTable(OldTableInterfaceMixin Line 292  class MemoryTable(OldTableInterfaceMixin
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)

Legend:
Removed from v.984  
changed lines
  Added in v.998

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26