Changeset 12465

Show
Ignore:
Timestamp:
10/17/07 16:44:56 (1 year ago)
Author:
warmerdam
Message:

go to one-time deprecation warnings

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/gdal/swig/include/python/gdal_python.i

    r11517 r12465  
    1919  import gdalconst 
    2020 
     21 
    2122  import sys 
     23  have_warned = 0 
    2224  byteorders = {"little": "<", 
    2325                "big": ">"} 
     
    3234                  gdalconst.GDT_Byte:     ("%st8" % byteorders[sys.byteorder]), 
    3335  } 
     36 
     37   
     38  def deprecation_warn( module ): 
     39    global have_warned 
     40 
     41    if have_warned == 1: 
     42        return 
     43 
     44    have_warned = 1 
     45 
     46    from warnings import warn 
     47    warn('%s.py was placed in a namespace, it is now available as osgeo.%s' % (module,module), 
     48         DeprecationWarning) 
     49 
    3450%} 
    3551 
  • trunk/gdal/swig/python/gdal.py

    r12455 r12465  
    11# import osgeo.gdal as a convenience 
     2from osgeo.gdal import deprecation_warn 
     3deprecation_warn('gdal') 
     4 
    25from osgeo.gdal import * 
    3  
    4 Debug("Deprecation Warning", 'gdal.py was placed in a namespace, it is now available as osgeo.gdal') 
  • trunk/gdal/swig/python/gdalconst.py

    r12450 r12465  
    11# import osgeo.gdalconst as a convenience 
     2from osgeo.gdal import deprecation_warn 
     3deprecation_warn('gdalconst') 
     4 
    25from osgeo.gdalconst import * 
    3 from osgeo import gdal 
    4  
    5 gdal.Debug("Deprecation Warning", 'gdalconst.py was placed in a namespace, it is now available as osgeo.gdalconst') 
  • trunk/gdal/swig/python/gdalnumeric.py

    r12450 r12465  
    11# import osgeo.gdal_array as a convenience 
     2from osgeo.gdal import deprecation_warn 
     3deprecation_warn('gdalnumeric') 
     4 
    25from osgeo.gdal_array import * 
    3 from osgeo import gdal 
    4  
    5 gdal.Debug("Deprecation Warning", 'gdalnumeric.py was placed in a namespace, it is now available as osgeo.gdal_array') 
  • trunk/gdal/swig/python/ogr.py

    r12450 r12465  
    11# import osgeo.ogr as a convenience 
     2from osgeo.gdal import deprecation_warn 
     3deprecation_warn('ogr') 
     4 
    25from osgeo.ogr import * 
    3 from osgeo import gdal 
    4  
    5 gdal.Debug("Deprecation Warning", 'ogr.py was placed in a namespace, it is now available as osgeo.ogr') 
  • trunk/gdal/swig/python/osgeo/gdal.py

    r12278 r12465  
    5252import gdalconst 
    5353 
     54 
    5455import sys 
     56have_warned = 0 
    5557byteorders = {"little": "<", 
    5658              "big": ">"} 
     
    6567                gdalconst.GDT_Byte:     ("%st8" % byteorders[sys.byteorder]), 
    6668} 
     69 
     70 
     71def deprecation_warn( module ): 
     72  global have_warned 
     73 
     74  if have_warned == 1: 
     75      return 
     76 
     77  have_warned = 1 
     78 
     79  from warnings import warn 
     80  warn('%s.py was placed in a namespace, it is now available as osgeo.%s' % (module,module), 
     81       DeprecationWarning) 
     82 
    6783 
    6884 
  • trunk/gdal/swig/python/osr.py

    r12450 r12465  
    11# import osgeo.osr as a convenience 
     2from osgeo.gdal import deprecation_warn 
     3deprecation_warn('osr') 
     4 
    25from osgeo.osr import * 
    3 from osgeo import gdal 
    4  
    5 gdal.Debug("Deprecation Warning", 'osr.py was placed in a namespace, it is now available as osgeo.osr')