File: subobj_.py

package info (click to toggle)
boa-constructor 0.6.1-13
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 21,624 kB
  • ctags: 13,427
  • sloc: python: 63,696; makefile: 16; sh: 1
file content (18 lines) | stat: -rw-r--r-- 424 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
## Script (Python) "subobj_"
##bind container=container
##bind context=context
##bind namespace=
##bind script=script
##bind subpath=traverse_subpath
##parameters=objname
##title=subobj_
##
obj = context.aq_parent
for subobj in obj.objectValues():
    try:
        name = subobj.id
    except:
        continue
    if name == objname:
        return subobj
raise Exception('Method not found in %s'%obj.id)