Python Mapscript :: NameError: global n ame 'rectObj' is not defined

Sean Gillies sgillies at FRII.COM
Mon Aug 23 12:59:47 EDT 2004


Ryan,

There's no "new" in Python.  The mapscript classes, when called, are
factories
for new objects:

     r = mapscript.rectObj()  # new instance of rectObj

cheers,
Sean

On Aug 23, 2004, at 10:50 AM, Ryan, Adam wrote:

> Bill,
>
> You'll likely need to use 'new rectObj' if you're not pulling it from
> another object.
>
> Adam
>
> -----Original Message-----
> From: Bill Hudspeth [mailto:bhudspeth at EDAC.UNM.EDU]
> Sent: Monday, August 23, 2004 9:43 AM
> To: MAPSERVER-USERS at LISTS.UMN.EDU
> Subject: [UMN_MAPSERVER-USERS] Python Mapscript :: NameError: global
> name
> 'rectObj' is not defined
>
>
> I am trying to create a rectangle object using Python Mapscript as
> such:
>
> prevExtent = rectObj(self.prev_minx, self.prev_miny, self.prev_maxx,
> self.prev_maxy)
>
> and get the following error message:
>
> NameError: global name 'rectObj' is not defined
>
>
> I have imported the mapscript module - other mapscript objects are
> recognized in different calls throughout my code, so that is not the
> problem.
>
> Any other ideas would be greatly appreciated.
>
> Thanks, Bill
>
>
--
Sean Gillies
sgillies at frii dot com
http://users.frii.com/sgillies



More information about the mapserver-users mailing list