root/PrimaGIS/trunk/skins/primagis/getMapObject.py

Revision 5, 500 bytes (checked in by dokai, 5 years ago)

Enabled the $Id$ keyword

  • Property Id set to CHANGES.txt
Line 
1## Script (Python) "getMapObject"
2##bind container=container
3##bind context=context
4##bind namespace=
5##bind script=script
6##bind subpath=traverse_subpath
7##parameters=
8##title=Finds the closest PrimaGIS instance in acquisition context
9##
10
11#from Acquisition import aq_base, aq_parent
12
13obj = context
14try:
15    while not hasattr(obj.aq_inner.aq_explicit, 'isPrimaGIS'):
16        obj = obj.aq_parent
17    return obj
18except AttributeError:
19    # No PrimaGIS instance in the acquisition path
20    return None
Note: See TracBrowser for help on using the browser.