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

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

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

revision 1068 by bh, Tue May 27 15:02:37 2003 UTC revision 1282 by bh, Mon Jun 23 09:47:18 2003 UTC
# Line 201  class Session(TitledObject, Modifiable): Line 201  class Session(TitledObject, Modifiable):
201          The list includes all tables that are indirectly opened through          The list includes all tables that are indirectly opened through
202          shape stores and the tables that have been opened explicitly.          shape stores and the tables that have been opened explicitly.
203          """          """
204          return self.tables + [store.Table() for store in self.ShapeStores()]          tables = self.tables[:]
205            ids = {}
206            for t in tables:
207                ids[id(t)] = 1
208            for store in self.ShapeStores():
209                t = store.Table()
210                if id(t) not in ids:
211                    ids[id(t)] = 1
212                    tables.append(t)
213            return tables
214    
215      def UnreferencedTables(self):      def UnreferencedTables(self):
216          """Return the tables that are not referenced by other data sources"""          """Return the tables that are not referenced by other data sources"""
# Line 237  class Session(TitledObject, Modifiable): Line 246  class Session(TitledObject, Modifiable):
246          else:          else:
247              transient_table = table              transient_table = table
248          self.tables.append(transient_table)          self.tables.append(transient_table)
249            self.changed()
250          return transient_table          return transient_table
251    
252      def RemoveTable(self, table):      def RemoveTable(self, table):
# Line 255  class Session(TitledObject, Modifiable): Line 265  class Session(TitledObject, Modifiable):
265          self.tables = tables          self.tables = tables
266          self.changed(TABLE_REMOVED, table)          self.changed(TABLE_REMOVED, table)
267    
268        def DataContainers(self):
269            """Return all data containers, i.e. shapestores and tables"""
270            return self.tables + self.ShapeStores()
271    
272      def OpenTableFile(self, filename):      def OpenTableFile(self, filename):
273          """Open the table file filename and return the table object.          """Open the table file filename and return the table object.
274    

Legend:
Removed from v.1068  
changed lines
  Added in v.1282

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26