Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Removed some dead code and simplified some other ocde

  • Loading branch information...
commit 7f508a36731660c8cd2659f23098f1379eaa8fb5 1 parent cce42d4
Alex Gaynor alex authored
10 django/contrib/gis/gdal/prototypes/errcheck.py
View
@@ -3,10 +3,12 @@
ctypes prototypes.
"""
from ctypes import c_void_p, string_at
+
from django.contrib.gis.gdal.error import check_err, OGRException, SRSException
from django.contrib.gis.gdal.libgdal import lgdal
from django.utils import six
+
# Helper routines for retrieving pointers and/or values from
# arguments passed in by reference.
def arg_byref(args, offset=-1):
@@ -17,13 +19,6 @@ def ptr_byref(args, offset=-1):
"Returns the pointer argument passed in by-reference."
return args[offset]._obj
-def check_bool(result, func, cargs):
- "Returns the boolean evaluation of the value."
- if bool(result):
- return True
- else:
- return False
-
### String checking Routines ###
def check_const_string(result, func, cargs, offset=None):
"""
@@ -111,7 +106,6 @@ def check_errcode(result, func, cargs):
Check the error code returned (c_int).
"""
check_err(result)
- return
def check_pointer(result, func, cargs):
"Makes sure the result pointer is valid."
4 django/contrib/gis/gdal/prototypes/geom.py
View
@@ -1,7 +1,7 @@
from ctypes import c_char_p, c_double, c_int, c_void_p, POINTER
from django.contrib.gis.gdal.envelope import OGREnvelope
from django.contrib.gis.gdal.libgdal import lgdal
-from django.contrib.gis.gdal.prototypes.errcheck import check_bool, check_envelope
+from django.contrib.gis.gdal.prototypes.errcheck import check_envelope
from django.contrib.gis.gdal.prototypes.generation import (const_string_output,
double_output, geom_output, int_output, srs_output, string_output, void_output)
@@ -20,7 +20,7 @@ def pnt_func(f):
def topology_func(f):
f.argtypes = [c_void_p, c_void_p]
f.restype = c_int
- f.errchck = check_bool
+ f.errchck = bool
return f
### OGR_G ctypes function prototypes ###
9 django/contrib/gis/geos/tests/test_geos_mutation.py
View
@@ -12,15 +12,6 @@
from ..error import GEOSIndexError
-def getItem(o,i):
- return o[i]
-
-def delItem(o,i):
- del o[i]
-
-def setItem(o,i,v):
- o[i] = v
-
if HAS_GEOS:
def api_get_distance(x):
return x.distance(Point(-200,-200))
Please sign in to comment.
Something went wrong with that request. Please try again.