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

« back to all changes in this revision

Viewing changes to ZopeLib/zoa/objectids.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) "objectids"
2
 
##bind container=container
3
 
##bind context=context
4
 
##bind namespace=_
5
 
##bind script=script
6
 
##bind subpath=traverse_subpath
7
 
##parameters=
8
 
##title=objectids
9
 
##
10
 
obj = context.aq_parent
11
 
if obj.meta_type == 'Local File System' or obj.meta_type == 'Local Directory':
12
 
    l = []
13
 
    for f in obj.fileIds():
14
 
        l.append(f)
15
 
    return l
16
 
elif obj.meta_type == 'User Folder':
17
 
    usernames = obj.getUserNames()
18
 
    if usernames:
19
 
        # dict or string ? (for exUserFolder)
20
 
        try: name = usernames[0]['username']
21
 
        except: pass
22
 
        else:
23
 
            userdicts = usernames
24
 
            usernames = []
25
 
            for dct in userdicts:
26
 
                usernames.append(dct['username'])
27
 
    return usernames
28
 
else:
29
 
    return obj.objectIds()
 
1
## Script (Python) "objectids"
 
2
##bind container=container
 
3
##bind context=context
 
4
##bind namespace=_
 
5
##bind script=script
 
6
##bind subpath=traverse_subpath
 
7
##parameters=
 
8
##title=objectids
 
9
##
 
10
obj = context.aq_parent
 
11
if obj.meta_type == 'Local File System' or obj.meta_type == 'Local Directory':
 
12
    l = []
 
13
    for f in obj.fileIds():
 
14
        l.append(f)
 
15
    return l
 
16
elif obj.meta_type == 'User Folder':
 
17
    usernames = obj.getUserNames()
 
18
    if usernames:
 
19
        # dict or string ? (for exUserFolder)
 
20
        try: name = usernames[0]['username']
 
21
        except: pass
 
22
        else:
 
23
            userdicts = usernames
 
24
            usernames = []
 
25
            for dct in userdicts:
 
26
                usernames.append(dct['username'])
 
27
    return usernames
 
28
else:
 
29
    return obj.objectIds()