/[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 839 by bh, Tue May 6 15:54:18 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 218  class DBFTable(OldTableInterfaceMixin): Line 226  class DBFTable(OldTableInterfaceMixin):
226          values.sort()          values.sort()
227          return values          return values
228    
229        def Dependencies(self):
230            """Return an empty sequence. The DBFTable doesn't depend on anything"""
231            return ()
232    
233      # DBF specific interface parts.      # DBF specific interface parts.
234    
# Line 246  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  # Temporary backwards compatibility          return self.filename
 Table = DBFTable  
   
263    
264    
265  class MemoryColumn:  class MemoryColumn:
# Line 283  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)
# Line 349  class MemoryTable(OldTableInterfaceMixin Line 365  class MemoryTable(OldTableInterfaceMixin
365          values.sort()          values.sort()
366          return values          return values
367    
368        def Dependencies(self):
369            """Return an empty sequence. The MemoryTable doesn't depend on anything
370            """
371            return ()
372    
373      def write_record(self, record, values):      def write_record(self, record, values):
374          # TODO: Check for correct lenght and perhaps also          # TODO: Check for correct lenght and perhaps also

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

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26