Skip to content

Commit 5aa7fb8

Browse files
committed
Derive directly rather than using _injector - fixes pickling but I'm not entirely sure is a way to go.
1 parent 5ae41b8 commit 5aa7fb8

4 files changed

Lines changed: 7 additions & 7 deletions

File tree

mapnik/__init__.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,12 +103,12 @@ def Filter(*args, **kwargs):
103103
return Expression(*args, **kwargs)
104104

105105

106-
class Envelope(Box2d):
106+
class Envelope(Box2d_Base):
107107

108108
def __init__(self, *args, **kwargs):
109109
warnings.warn("'Envelope' is deprecated and will be removed in Mapnik 3.x, use 'Box2d' instead",
110110
DeprecationWarning, 2)
111-
Box2d.__init__(self, *args, **kwargs)
111+
Box2d_Base.__init__(self, *args, **kwargs)
112112

113113

114114
class _Coord(Coord, _injector()):
@@ -186,7 +186,7 @@ def inverse(self, projection):
186186
return inverse_(self, projection)
187187

188188

189-
class _Box2d(Box2d, _injector()):
189+
class Box2d(Box2d_Base):#, _injector()):
190190
"""
191191
Represents a spatial envelope (i.e. bounding box).
192192
@@ -294,7 +294,7 @@ def all_features(self, fields=None, variables={}):
294294
return self.__iter__(fields, variables)
295295

296296

297-
class _Color(Color, _injector()):
297+
class Color(Color_Base):#, _injector()):
298298

299299
def __repr__(self):
300300
return "Color(R=%d,G=%d,B=%d,A=%d)" % (self.r, self.g, self.b, self.a)

mapnik/printing.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
import os
2222
import tempfile
2323

24-
from . import (Box2d, Coord, Feature, Geometry, Layer, Map, Projection, Style,
24+
from . import (Box2d_Base, Coord, Feature, Geometry, Layer, Map, Projection, Style,
2525
render)
2626

2727
try:

src/mapnik_color.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ struct color_pickle_suite : boost::python::pickle_suite
4747
void export_color ()
4848
{
4949
using namespace boost::python;
50-
class_<color>("Color", init<int,int,int,int>(
50+
class_<color>("Color_Base", init<int,int,int,int>(
5151
( arg("r"), arg("g"), arg("b"), arg("a") ),
5252
"Creates a new color from its RGB components\n"
5353
"and an alpha value.\n"

src/mapnik_envelope.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ box2d<double> box2d_deepcopy(box2d<double> & obj, boost::python::dict const&)
106106
void export_envelope()
107107
{
108108
using namespace boost::python;
109-
class_<box2d<double> >("Box2d",
109+
class_<box2d<double> >("Box2d_Base",
110110
// class docstring is in mapnik/__init__.py, class _Coord
111111
init<double,double,double,double>(
112112
(arg("minx"),arg("miny"),arg("maxx"),arg("maxy")),

0 commit comments

Comments
 (0)