
*Pc           @   sJ   d  d l  m Z d  d l m Z d  d l m Z d e f d     YZ d S(   i(   t   c_void_p(   t   GDALException(   t   sixt   GDALBasec           B   s;   e  Z d  Z d Z e Z d   Z d   Z e	 e e  Z
 RS(   s   
    Base object for GDAL objects that has a pointer access property
    that controls access to the underlying C pointer.
    c         C   s*   |  j  r |  j  St d |  j j   d  S(   Ns    GDAL %s pointer no longer valid.(   t   _ptrR   t	   __class__t   __name__(   t   self(    (    s5   ../Django//lib/python/django/contrib/gis/gdal/base.pyt   _get_ptr   s    	 c         C   sa   t  | t j  r' |  j |  |  _ n6 | d  k sE t  | |  j  rQ | |  _ n t d   d  S(   Ns   Incompatible pointer type(   t
   isinstanceR   t   integer_typest   ptr_typeR   t   Nonet	   TypeError(   R   t   ptr(    (    s5   ../Django//lib/python/django/contrib/gis/gdal/base.pyt   _set_ptr   s
    N(   R   t
   __module__t   __doc__R   R   R    R   R   R   t   propertyR   (    (    (    s5   ../Django//lib/python/django/contrib/gis/gdal/base.pyR      s   		
N(   t   ctypesR    t   django.contrib.gis.gdal.errorR   t   django.utilsR   t   objectR   (    (    (    s5   ../Django//lib/python/django/contrib/gis/gdal/base.pyt   <module>   s   