[Mapserver-users] Python MapScript: setting string attributes to None
Sean Gillies
sgillies@frii.com
Fri, 28 Mar 2003 13:35:02 -0700
Dear Mapserving Pythoneers,
For some time we've been enduring the inconvenience that
string attributes of map objects (such as layer.group),
once set, cannot be undefined. This is due to a quirk in
the Python wrapper code that SWIG emits.
I've just committed into CVS a fix for this problem. Part
of the fix is in mapscript.i so, unless you are comfortable
with using SWIG, you may have to wait a while until the
nightly system creates an updated Python wrapper code. The
rest of the fix relies on a new setup script called
'setup_wnone.py'.
After rebuilding and installing the Python MapScript using
setup_wnone.py, you will be able to undefine string attributes
of your map objects with statements like:
thelayer.[ATTRIBUTE] = None
This update to Python MapScript affects _only_ attributes
that are accessed directly (through __setattr__). For attributes
like a class expression, continue to use
theclass.setExpression('')
to undefine the expression. For color attributes, continue to
use statements like
null = colorObj()
null.red, null.green, null.blue = (-1, -1, -1)
theclass.styles.outlinecolor = null
peace,
Sean
--
Sean Gillies
sgillies@frii.com
http://www.frii.com/~sgillies
_______________________________________________
Mapserver-users mailing list
Mapserver-users@lists.gis.umn.edu
http://lists.gis.umn.edu/mailman/listinfo/mapserver-users