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

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

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

revision 2446 by frank, Mon Dec 13 11:52:34 2004 UTC revision 2451 by bh, Mon Dec 13 17:51:11 2004 UTC
# Line 261  class SessionLoader(XMLReader): Line 261  class SessionLoader(XMLReader):
261          return normalized          return normalized
262    
263      def open_shapefile(self, filename):      def open_shapefile(self, filename):
264          """Open shapefile, eventually with alternative path."""          """Open shapefile, with alternative path handling.
265            
266               If a shapefile cannot be opened and an IOError is raised, check for
267               an alternative. This alternative can be specified interactively by
268               the user or taken from a list of (potential) locations, depending on
269               the callback implementation.
270                
271               The alternative is rechecked. If taken from a list the user
272               has to confirm the alternative.
273            """
274    
275            # Flag if the alternative path was specified interactively / from list.
276          from_list = 0          from_list = 0
277          while 1:          while 1:
278              try:              try:
279                  store = self.theSession.OpenShapefile(filename)                  store = self.theSession.OpenShapefile(filename)
280                  if from_list:                  if from_list:
281                      # The correct? path has been guessed from a list                      # A valid path has been guessed from a list
282                      # Let the user confirm - or select an alternative.                      # Let the user confirm - or select an alternative.
283                      filename, from_list = self.shapefile_callback(                      filename, from_list = self.shapefile_callback(
284                                              filename, "check")                                              filename, "check")
# Line 290  class SessionLoader(XMLReader): Line 301  class SessionLoader(XMLReader):
301                                              second_try = from_list)                                              second_try = from_list)
302                      if filename is None:                      if filename is None:
303                          raise LoadCancelled                          raise LoadCancelled
                     print filename  
304                  else:                  else:
305                      raise                      raise
306          return store          return store

Legend:
Removed from v.2446  
changed lines
  Added in v.2451

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26