Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
Zope
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
Zope
Commits
aeb331fa
Commit
aeb331fa
authored
Jul 13, 1998
by
Jim Fulton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added PrincipiaFind.
parent
01f2dc6c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
2 deletions
+37
-2
lib/python/OFS/Application.py
lib/python/OFS/Application.py
+37
-2
No files found.
lib/python/OFS/Application.py
View file @
aeb331fa
...
...
@@ -11,8 +11,8 @@
__doc__
=
'''Application support
$Id: Application.py,v 1.6
5 1998/05/12 19:06:18
jim Exp $'''
__version__
=
'$Revision: 1.6
5
$'
[
11
:
-
2
]
$Id: Application.py,v 1.6
6 1998/07/13 12:11:34
jim Exp $'''
__version__
=
'$Revision: 1.6
6
$'
[
11
:
-
2
]
import
Globals
,
Folder
,
os
,
regex
,
sys
...
...
@@ -23,6 +23,7 @@ from AccessControl.User import UserFolder
from
App.ApplicationManager
import
ApplicationManager
from
Persistence
import
Persistent
from
ImageFile
import
ImageFile
from
urllib
import
quote
_standard_error_msg
=
'''
\
<!--#var standard_html_header-->
...
...
@@ -167,6 +168,37 @@ class Application(Globals.ApplicationDefaultPermissions, Folder.Folder):
"""Utility function to return current date/time"""
return
DateTime
()
def
PrincipiaFind
(
self
,
start
,
_initial
=
None
,
prefix
=
''
,
type
=
None
,
substring
=
None
,
name
=
None
,
):
if
_initial
is
None
:
_initial
=
[]
if
hasattr
(
start
,
'aq_base'
):
start
=
start
.
aq_base
if
not
hasattr
(
start
,
'objectItems'
):
return
_initial
try
:
items
=
start
.
objectItems
()
except
:
return
_initial
for
oname
,
o
in
items
:
if
prefix
:
p
=
"%s/%s"
%
(
prefix
,
oname
)
else
:
p
=
oname
if
hasattr
(
o
,
'aq_base'
):
o
=
o
.
aq_base
if
(
(
type
is
None
or
not
hasattr
(
o
,
'meta_type'
)
or
type
==
o
.
meta_type
)
and
(
name
is
None
or
oname
==
name
)
and
(
substring
is
None
or
(
hasattr
(
o
,
'PrincipiaSearchSource'
)
and
find
(
o
.
PrincipiaSearchSource
(),
substring
)
>=
0
))
):
_initial
.
append
(
p
)
if
hasattr
(
o
,
'objectItems'
):
self
.
PrincipiaFind
(
o
,
_initial
,
p
,
type
,
substring
,
name
)
return
_initial
class
Expired
(
Persistent
):
icon
=
'p_/broken'
...
...
@@ -396,6 +428,9 @@ class Misc_:
##############################################################################
#
# $Log: Application.py,v $
# Revision 1.66 1998/07/13 12:11:34 jim
# Added PrincipiaFind.
#
# Revision 1.65 1998/05/12 19:06:18 jim
# Changed to allow defaults in permission definitions.
#
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment