From 7e05522b52cff411fbe19d476c31d9cdddd58ac8 Mon Sep 17 00:00:00 2001 From: Jean-Francois Doyon Date: Tue, 28 Mar 2006 01:07:01 +0000 Subject: [PATCH] - Add an ignore. - load Projection class and DEGREES constant into mapnik module namespace so that one can "from mapnik import Projection, DEGREES" - Clean up the build/install of the python module. --- bindings/python/SConscript | 19 +++++++++---------- bindings/python/mapnik/__init__.py | 5 +++++ 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/bindings/python/SConscript b/bindings/python/SConscript index d3625ff41..3531ec22a 100644 --- a/bindings/python/SConscript +++ b/bindings/python/SConscript @@ -29,17 +29,16 @@ headers = [env['PYTHON_PREFIX'] + '/include/python' + env['PYTHON_VERSION']] + e _mapnik = env.SharedLibrary('_mapnik', glob.glob('*.cpp'), LIBS=libraries, SHLIBPREFIX='', CPPPATH=headers) paths = """ -pluginsrootpath = '%s' -inputpluginspath = pluginsrootpath + '/input' +mapniklibpath = '%s' +inputpluginspath = mapniklibpath + '/input' +fontscollectionpath = mapniklibpath + '/fonts' """ file('mapnik/paths.py','w').write(paths % (env['PREFIX'] + '/lib/mapnik',)) -__init__ = env.Install(prefix+'/mapnik','mapnik/__init__.py') -pathspy = env.Install(prefix+'/mapnik','mapnik/paths.py') -_source=env.Install(prefix+'/mapnik',_mapnik) -_source.append(__init__) -_source.append(pathspy) - -env.Alias(target="install",source=_source) - +pymapnik = glob.glob('mapnik/*.py') +env.Alias(target='install', source=env.Install(prefix+'/mapnik', pymapnik)) +pymapnik2 = glob.glob('mapnik/ogcserver/*.py') +env.Alias(target='install', source=env.Install(prefix+'/mapnik/ogcserver', pymapnik2)) +pymapniklib = env.Install(prefix+'/mapnik',_mapnik) +env.Alias(target="install",source=pymapniklib) diff --git a/bindings/python/mapnik/__init__.py b/bindings/python/mapnik/__init__.py index cc88b145f..aff9a342a 100644 --- a/bindings/python/mapnik/__init__.py +++ b/bindings/python/mapnik/__init__.py @@ -28,6 +28,11 @@ setdlopenflags(RTLD_NOW | RTLD_GLOBAL) from _mapnik import * from paths import inputpluginspath, fontscollectionpath +try: + from mapnik.Projection import Projection, DEGREES +except: + pass + # The base Boost.Python class BoostPythonMetaclass = Coord.__class__