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

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

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

revision 1940 by bh, Tue Nov 11 18:27:39 2003 UTC revision 1964 by bh, Wed Nov 19 19:48:47 2003 UTC
# Line 15  __version__ = "$Revision$" Line 15  __version__ = "$Revision$"
15  import os  import os
16  import os.path  import os.path
17  import weakref  import weakref
18    import traceback
19    
20  import Thuban  import Thuban
21  from Thuban import _  from Thuban import _
# Line 32  projdir = \ Line 33  projdir = \
33    
34  PROJ_EXT = ".proj"  PROJ_EXT = ".proj"
35    
36  has_gdal_support = lambda: False  # Determine the status of GDAL support. If GDAL is supported
37  try:  # gdal_support_status will be set to the empty string, otherwise to a
38      # first try to see if our extension module is there. if it  # string with information why it isn't supported
39      # wasn't even compiled, we obviously don't have gdal support.  #
40      import gdalwarp  # GDAL is supported if we can import both the thuban specific gdalwarp
41    # module and the GDAL python bindings.
42      # now try to import the python extension. if this doesn't  for _module in ("gdalwarp", "gdal"):
43      # exist then we can't do anything.      try:
44      import gdal          __import__(_module)
45        except ImportError, val:
46      """Return True if the gdal library is available."""          gdal_support_status = (_("No GDAL support because module '%s'"
47      has_gdal_support = lambda: True                                   " cannot be imported. Python exception: '%s'")
48  except ImportError:                                 % (_module, str(val)))
49      pass          break
50    else:
51        gdal_support_status = ""
52    
53    def has_gdal_support():
54        return gdal_support_status == ""
55    
56    
57  projfile_cache = weakref.WeakValueDictionary()  projfile_cache = weakref.WeakValueDictionary()
58    

Legend:
Removed from v.1940  
changed lines
  Added in v.1964

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26