/[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 987 by bh, Thu May 22 16:46:14 2003 UTC revision 1036 by bh, Mon May 26 17:30:29 2003 UTC
# Line 22  from Thuban import _ Line 22  from Thuban import _
22  from base import TitledObject, Modifiable  from base import TitledObject, Modifiable
23  from map import Map  from map import Map
24  from data import ShapefileStore  from data import ShapefileStore
25    from table import DBFTable
26    
27  from transientdb import TransientDatabase, AutoTransientTable  from transientdb import TransientDatabase, AutoTransientTable
28    
# Line 239  class Session(TitledObject, Modifiable): Line 240  class Session(TitledObject, Modifiable):
240              raise ValueError              raise ValueError
241          self.tables = tables          self.tables = tables
242    
243        def OpenTableFile(self, filename):
244            """Open the table file filename and return the table object.
245    
246            The filename argument must be the name of a DBF file.
247            """
248            return self.AddTable(DBFTable(filename))
249    
250      def temp_directory(self):      def temp_directory(self):
251          """          """
252          Return the name of the directory for session specific temporary files          Return the name of the directory for session specific temporary files
# Line 258  class Session(TitledObject, Modifiable): Line 266  class Session(TitledObject, Modifiable):
266          self._add_shapestore(store)          self._add_shapestore(store)
267          return store          return store
268    
269        def AddShapeStore(self, shapestore):
270            """Add the shapestore to the session.
271    
272            The session only holds a weak reference to the shapestore, so it
273            will automatically be removed from the session when the last
274            reference goes away.
275            """
276            self._add_shapestore(shapestore)
277            return shapestore
278    
279      def TransientDB(self):      def TransientDB(self):
280          if self.transient_db is None:          if self.transient_db is None:
281              filename = os.path.join(self.temp_directory(), "transientdb")              filename = os.path.join(self.temp_directory(), "transientdb")

Legend:
Removed from v.987  
changed lines
  Added in v.1036

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26