~ubuntu-branches/ubuntu/trusty/boa-constructor/trusty

« back to all changes in this revision

Viewing changes to ZopeLib/zoa/metatypes.py

  • Committer: Bazaar Package Importer
  • Author(s): Cédric Delfosse
  • Date: 2007-01-23 21:32:29 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20070123213229-1d9lxp9c4dutjwv5
Add a .desktop file (Closes: #349081)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
## Script (Python) "metatypes"
2
 
##bind container=container
3
 
##bind context=context
4
 
##bind namespace=_
5
 
##bind script=script
6
 
##bind subpath=traverse_subpath
7
 
##parameters=
8
 
##title=metatypes
9
 
##
10
 
obj = context.aq_parent
11
 
l=[]
12
 
if obj.meta_type == 'Z Class':
13
 
    return obj.objectMap()
14
 
elif obj.meta_type in ('Local File System', 'Local Directory'):
15
 
    for f in obj.fileValues():
16
 
        if f.type == 'directory':
17
 
            l.append('LocalFS::directory')
18
 
        else:
19
 
            l.append('LocalFS::file')
20
 
# pretend that users are subobjects with meta_types
21
 
elif obj.meta_type == 'User Folder':
22
 
    return ['User'] * _.len(obj.getUserNames())
23
 
else:
24
 
    for f in obj.objectValues():
25
 
        try: l.append(f.meta_type)
26
 
        except: l.append('Broken Because Product is Gone')
27
 
return l
 
1
## Script (Python) "metatypes"
 
2
##bind container=container
 
3
##bind context=context
 
4
##bind namespace=_
 
5
##bind script=script
 
6
##bind subpath=traverse_subpath
 
7
##parameters=
 
8
##title=metatypes
 
9
##
 
10
obj = context.aq_parent
 
11
l=[]
 
12
if obj.meta_type == 'Z Class':
 
13
    return obj.objectMap()
 
14
elif obj.meta_type in ('Local File System', 'Local Directory'):
 
15
    for f in obj.fileValues():
 
16
        if f.type == 'directory':
 
17
            l.append('LocalFS::directory')
 
18
        else:
 
19
            l.append('LocalFS::file')
 
20
# pretend that users are subobjects with meta_types
 
21
elif obj.meta_type == 'User Folder':
 
22
    return ['User'] * _.len(obj.getUserNames())
 
23
else:
 
24
    for f in obj.objectValues():
 
25
        try: l.append(f.meta_type)
 
26
        except: l.append('Broken Because Product is Gone')
 
27
return l