/[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 257 by bh, Thu Aug 15 12:47:59 2002 UTC revision 274 by bh, Thu Aug 22 16:25:46 2002 UTC
# Line 34  class Table: Line 34  class Table:
34    
35      def __init__(self, filename):      def __init__(self, filename):
36          self.filename = filename          self.filename = filename
37          self.dbf = dbflib.DBFFile(filename)          self.dbf = dbflib.DBFFile(filename, "r+b")
38    
39      def Destroy(self):      def Destroy(self):
40          self.dbf.close()          self.dbf.close()
# Line 63  class Table: Line 63  class Table:
63          """          """
64          return self.dbf.read_record(record)          return self.dbf.read_record(record)
65    
66            def write_record(self, record, values):
67            """Write the values into the record
68    
69            The values parameter may either be a dictionary or a sequence.
70    
71            If it's a dictionary the keys must be the names of the fields
72            and their value must have a suitable type. Only the fields
73            actually contained in the dictionary are written. Fields for
74            which there's no item in the dict are not modified.
75    
76            If it's a sequence, all fields must be present in the right
77            order.
78            """
79            self.dbf.write_record(record, values)
80            self.dbf.commit()

Legend:
Removed from v.257  
changed lines
  Added in v.274

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26