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
43f95443
Commit
43f95443
authored
May 31, 2000
by
Shane Hathaway
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Changed getPhysicalPath() and unrestrictedTraverse() to match new
interface specs.
parent
1891b8ff
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
20 deletions
+27
-20
lib/python/OFS/Application.py
lib/python/OFS/Application.py
+3
-3
lib/python/OFS/SimpleItem.py
lib/python/OFS/SimpleItem.py
+24
-17
No files found.
lib/python/OFS/Application.py
View file @
43f95443
...
...
@@ -85,8 +85,8 @@
__doc__
=
'''Application support
$Id: Application.py,v 1.12
5 2000/05/24 20:53:34
shane Exp $'''
__version__
=
'$Revision: 1.12
5
$'
[
11
:
-
2
]
$Id: Application.py,v 1.12
6 2000/05/31 15:58:11
shane Exp $'''
__version__
=
'$Revision: 1.12
6
$'
[
11
:
-
2
]
import
Globals
,
Folder
,
os
,
sys
,
App
.
Product
,
App
.
ProductRegistry
,
misc_
import
time
,
traceback
,
os
,
string
,
Products
...
...
@@ -289,7 +289,7 @@ class Application(Globals.ApplicationDefaultPermissions,
be used with getPhysicalRoot().
'''
# We're at the base of the path.
return
''
return
(
''
,)
def
getPhysicalRoot
(
self
):
return
self
...
...
lib/python/OFS/SimpleItem.py
View file @
43f95443
...
...
@@ -89,8 +89,8 @@ Aqueduct database adapters, etc.
This module can also be used as a simple template for implementing new
item types.
$Id: SimpleItem.py,v 1.7
2 2000/05/26 15:43:07 brian
Exp $'''
__version__
=
'$Revision: 1.7
2
$'
[
11
:
-
2
]
$Id: SimpleItem.py,v 1.7
3 2000/05/31 15:58:11 shane
Exp $'''
__version__
=
'$Revision: 1.7
3
$'
[
11
:
-
2
]
import
regex
,
sys
,
Globals
,
App
.
Management
,
Acquisition
,
App
.
Undo
import
AccessControl.Role
,
AccessControl
.
Owned
,
App
.
Common
...
...
@@ -101,7 +101,7 @@ from CopySupport import CopySource
from
string
import
join
,
lower
,
find
,
split
from
types
import
InstanceType
,
StringType
from
ComputedAttribute
import
ComputedAttribute
from
urllib
import
quote
from
urllib
import
quote
,
unquote
from
AccessControl
import
getSecurityManager
import
marshal
...
...
@@ -348,18 +348,18 @@ class Item(Base, Resource, CopySource, App.Management.Tabs,
return
id
def
getPhysicalPath
(
self
):
'''Returns a path that can be used to access this object again
'''Returns a path (an immutable sequence of strings)
that can be used to access this object again
later, for example in a copy/paste operation. getPhysicalRoot()
and getPhysicalPath() are designed to operate together.
'''
id
=
quote
(
self
.
id
)
path
=
(
self
.
id
,
)
p
=
getattr
(
self
,
'aq_inner'
,
None
)
p
=
getattr
(
self
,
'aq_inner'
,
None
)
if
p
is
not
None
:
url
=
p
.
aq_parent
.
getPhysicalPath
()
if
url
:
id
=
url
+
'/'
+
id
return
id
path
=
p
.
aq_parent
.
getPhysicalPath
()
+
path
print
path
return
path
unrestrictedTraverse__roles__
=
()
def
unrestrictedTraverse
(
self
,
path
,
default
=
_marker
):
...
...
@@ -371,13 +371,19 @@ class Item(Base, Resource, CopySource, App.Management.Tabs,
N
=
None
M
=
_marker
if
type
(
path
)
is
StringType
:
path
=
split
(
path
,
'/'
)
if
type
(
path
)
is
StringType
:
path
=
map
(
unquote
,
split
(
path
,
'/'
))
else
:
path
=
list
(
path
)
REQUEST
=
{
'path'
:
path
}
path
.
reverse
()
pop
=
path
.
pop
# If the path starts with an empty string, go to the root first.
if
len
(
path
)
>
0
and
not
path
[
-
1
]:
object
=
self
.
getPhysicalRoot
()
pop
()
try
:
while
path
:
name
=
pop
()
...
...
@@ -437,18 +443,19 @@ class Item_w__name__(Item):
return
id
def
getPhysicalPath
(
self
):
'''Returns a path that can be used to access this object again
'''Returns a path (an immutable sequence of strings)
that can be used to access this object again
later, for example in a copy/paste operation. getPhysicalRoot()
and getPhysicalPath() are designed to operate together.
'''
id
=
quote
(
self
.
__name__
)
path
=
(
self
.
__name__
,
)
p
=
getattr
(
self
,
'aq_inner'
,
None
)
p
=
getattr
(
self
,
'aq_inner'
,
None
)
if
p
is
not
None
:
url
=
p
.
aq_parent
.
getPhysicalPath
()
if
url
:
id
=
url
+
'/'
+
id
path
=
p
.
aq_parent
.
getPhysicalPath
()
+
path
return
path
return
id
def
format_exception
(
etype
,
value
,
tb
,
limit
=
None
):
import
traceback
...
...
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