Commit 0b9a855b authored by Justin Bronn's avatar Justin Bronn
Browse files

Fixed #10620 -- removed carriage returns in a GEOS tests module; fixed other...

Fixed #10620 -- removed carriage returns in a GEOS tests module; fixed other errata such as unnecessary `pymutable_geometries` module and not having `GEOSGeometry` call `__init__`.



git-svn-id: http://code.djangoproject.com/svn/django/trunk@10174 bcc190cf-cafb-0310-a4f2-bffc1f526a37
parent 6fa30faa
Loading
Loading
Loading
Loading
+0 −7
Original line number Diff line number Diff line
@@ -13,7 +13,6 @@ from django.contrib.gis.geos import prototypes as capi

class GeometryCollection(GEOSGeometry):
    _typeid = 7
    _minlength = 0

    def __init__(self, *args, **kwargs):
        "Initializes a Geometry Collection from a sequence of Geometry objects."
@@ -77,12 +76,6 @@ class GeometryCollection(GEOSGeometry):
        if srid: self.srid = srid
        capi.destroy_geom(prev_ptr)

    # Because GeometryCollections need to be rebuilt upon the changing of a
    # component geometry, these routines are set to their counterparts that
    # rebuild the entire geometry.
    _set_single = GEOSGeometry._set_single_rebuild
    _assign_extended_slice = GEOSGeometry._assign_extended_slice_rebuild

    @property
    def kml(self):
        "Returns the KML for this Geometry Collection."
+1 −0
Original line number Diff line number Diff line
@@ -91,6 +91,7 @@ class GEOSGeometry(GEOSBase, ListMixin):

        # Post-initialization setup.
        self._post_init(srid)
        super(GEOSGeometry, self).__init__()

    def _post_init(self, srid):
        "Helper routine for performing post-initialization setup."
+12 −14
Original line number Diff line number Diff line
@@ -50,7 +50,18 @@ class ListMixin(object):
    _maxlength = None
    _IndexError = IndexError

    ### Special methods for Python list interface ###
    ### Python initialization and list interface methods ###

    def __init__(self, *args, **kwargs):
        if not hasattr(self, '_getitem_internal'):
            self._getitem_internal = self._getitem_external

        if not hasattr(self, '_set_single'):
            self._set_single = self._set_single_rebuild
            self._assign_extended_slice = self._assign_extended_slice_rebuild

        super(ListMixin, self).__init__(*args, **kwargs)

    def __getitem__(self, index):
        "Gets the coordinates of the point(s) at the specified index/slice."
        if isinstance(index, slice):
@@ -128,19 +139,6 @@ class ListMixin(object):

    ### Private API routines unique to ListMixin ###

    def __init__(self, *args, **kwargs):
        if not hasattr(self, '_getitem_internal'):
            self._getitem_internal = self._getitem_external

        if hasattr(self, '_set_single'):
            self._canSetSingle = True
        else:
            self._canSetSingle = False
            self._set_single             = self._set_single_rebuild
            self._assign_extended_slice   = self._assign_extended_slice_rebuild

        super(ListMixin, self).__init__(*args, **kwargs)

    def _rebuild(self, newLen, newItems):
        if newLen < self._minlength:
            raise ValueError('Must have at least %d items' % self._minlength)
+0 −3
Original line number Diff line number Diff line
@@ -52,9 +52,6 @@ class Point(GEOSGeometry):

        return capi.create_point(cs)

    def _getitem_external(self, index):
        return self._cs.getOrdinate(index, 0)

    def _set_collection(self, length, items):
        ptr = self._create_point(length, items)
        if ptr:
+0 −6
Original line number Diff line number Diff line
@@ -133,12 +133,6 @@ class Polygon(GEOSGeometry):
    def _getitem_external(self, index):
        return GEOSGeometry(capi.geom_clone(self._getitem_internal(index)), srid=self.srid)

    # Because Polygonss need to be rebuilt upon the changing of a
    # component geometry, these routines are set to their counterparts that
    # rebuild the entire geometry.
    _set_single = GEOSGeometry._set_single_rebuild
    _assign_extended_slice   = GEOSGeometry._assign_extended_slice_rebuild

    #### Polygon Properties ####
    @property
    def num_interior_rings(self):
Loading