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
64a9506a
Commit
64a9506a
authored
May 17, 2000
by
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
undocstringed some methods to prevent web access
parent
ab25e239
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
41 deletions
+28
-41
lib/python/OFS/CopySupport.py
lib/python/OFS/CopySupport.py
+6
-8
lib/python/OFS/ObjectManager.py
lib/python/OFS/ObjectManager.py
+17
-28
lib/python/OFS/SimpleItem.py
lib/python/OFS/SimpleItem.py
+5
-5
No files found.
lib/python/OFS/CopySupport.py
View file @
64a9506a
...
...
@@ -83,7 +83,7 @@
#
##############################################################################
__doc__
=
"""Copy interface"""
__version__
=
'$Revision: 1.
49
$'
[
11
:
-
2
]
__version__
=
'$Revision: 1.
50
$'
[
11
:
-
2
]
import
sys
,
string
,
Globals
,
Moniker
,
tempfile
,
ExtensionClass
from
marshal
import
loads
,
dumps
...
...
@@ -288,7 +288,7 @@ class CopyContainer(ExtensionClass.Base):
# Because it's still a "management" function.
manage_clone__roles__
=
None
def
manage_clone
(
self
,
ob
,
id
,
REQUEST
=
None
):
"""Clone an object, creating a new object with the given id."""
# Clone an object, creating a new object with the given id.
if
not
ob
.
cb_isCopyable
():
raise
CopyError
,
eNotSupported
%
absattr
(
ob
.
id
)
try
:
self
.
_checkId
(
id
)
...
...
@@ -310,13 +310,13 @@ class CopyContainer(ExtensionClass.Base):
return
ob
def
cb_dataValid
(
self
):
"Return true if clipboard data seems valid."
# Return true if clipboard data seems valid.
try
:
cp
=
_cb_decode
(
self
.
REQUEST
[
'__cp'
])
except
:
return
0
return
1
def
cb_dataItems
(
self
):
"List of objects in the clip board"
# List of objects in the clip board
try
:
cp
=
_cb_decode
(
self
.
REQUEST
[
'__cp'
])
except
:
return
[]
oblist
=
[]
...
...
@@ -404,7 +404,7 @@ class CopySource:
self
.
id
=
id
def
cb_isCopyable
(
self
):
"""Is object copyable? Returns 0 or 1"""
# Is object copyable? Returns 0 or 1
if
not
(
hasattr
(
self
,
'_canCopy'
)
and
self
.
_canCopy
(
0
)):
return
0
if
hasattr
(
self
,
'_p_jar'
)
and
self
.
_p_jar
is
None
:
...
...
@@ -412,7 +412,7 @@ class CopySource:
return
1
def
cb_isMoveable
(
self
):
"""Is object moveable? Returns 0 or 1"""
# Is object moveable? Returns 0 or 1
if
not
(
hasattr
(
self
,
'_canCopy'
)
and
self
.
_canCopy
(
1
)):
return
0
if
hasattr
(
self
,
'_p_jar'
)
and
self
.
_p_jar
is
None
:
...
...
@@ -441,8 +441,6 @@ def absattr(attr):
if
callable
(
attr
):
return
attr
()
return
attr
def
_cb_encode
(
d
):
return
quote
(
compress
(
dumps
(
d
),
9
))
...
...
lib/python/OFS/ObjectManager.py
View file @
64a9506a
...
...
@@ -84,9 +84,9 @@
##############################################################################
__doc__
=
"""Object Manager
$Id: ObjectManager.py,v 1.9
1 2000/05/16 19:34:43
brian Exp $"""
$Id: ObjectManager.py,v 1.9
2 2000/05/17 18:50:29
brian Exp $"""
__version__
=
'$Revision: 1.9
1
$'
[
11
:
-
2
]
__version__
=
'$Revision: 1.9
2
$'
[
11
:
-
2
]
import
App.Management
,
Acquisition
,
Globals
,
CopySupport
,
Products
import
os
,
App
.
FactoryDispatcher
,
ts_regex
,
Products
...
...
@@ -182,16 +182,14 @@ class ObjectManager(
def
filtered_meta_types
(
self
,
user
=
None
):
"Those meta types for which a user has adequite permissions."
# Return a list of the types for which the user has
# adequate permission to add that type of object.
user
=
getSecurityManager
().
getUser
()
meta_types
=
[]
if
callable
(
self
.
all_meta_types
):
all
=
self
.
all_meta_types
()
else
:
all
=
self
.
all_meta_types
for
meta_type
in
all
:
if
meta_type
.
has_key
(
'permission'
):
if
user
.
has_permission
(
meta_type
[
'permission'
],
self
):
...
...
@@ -299,11 +297,9 @@ class ObjectManager(
self
.
_delOb
(
id
)
def
objectIds
(
self
,
spec
=
None
):
"""Return a list of subobject ids.
Returns a list of subobject ids of the current object. If 'spec' is
specified, returns objects whose meta_type matches 'spec'.
"""
# Returns a list of subobject ids of the current object.
# If 'spec' is specified, returns objects whose meta_type
# matches 'spec'.
if
spec
is
not
None
:
if
type
(
spec
)
==
type
(
's'
):
spec
=
[
spec
]
...
...
@@ -315,20 +311,15 @@ class ObjectManager(
return
map
(
lambda
i
:
i
[
'id'
],
self
.
_objects
)
def
objectValues
(
self
,
spec
=
None
):
"""Return a list of the actual subobjects.
Returns a list of actual subobjects of the current object. If
'spec' is specified, returns only objects whose meta_type match 'spec'
"""
# Returns a list of actual subobjects of the current object.
# If 'spec' is specified, returns only objects whose meta_type
# match 'spec'
return
map
(
self
.
_getOb
,
self
.
objectIds
(
spec
))
def
objectItems
(
self
,
spec
=
None
):
"""Return a list of (id, subobject) tuples.
Returns a list of (id, subobject) tuples of the current object.
If 'spec' is specified, returns only objects whose meta_type match
'spec'
"""
# Returns a list of (id, subobject) tuples of the current object.
# If 'spec' is specified, returns only objects whose meta_type match
# 'spec'
r
=
[]
a
=
r
.
append
g
=
self
.
_getOb
...
...
@@ -370,10 +361,8 @@ class ObjectManager(
return
r
def
superValues
(
self
,
t
):
"""Return all of the objects of a given type
The search is performed in this folder and in folders above.
"""
# Return all of the objects of a given type located in
# this object and containing objects.
if
type
(
t
)
==
type
(
's'
):
t
=
(
t
,)
obj
=
self
seen
=
{}
...
...
@@ -429,7 +418,7 @@ class ObjectManager(
def
tpValues
(
self
):
"""Returns a list of the folder's sub-folders, used by tree tag."""
# Return a list of subobjects, used by tree tag.
r
=
[]
if
hasattr
(
self
.
aq_base
,
'tree_ids'
):
for
id
in
self
.
aq_base
.
tree_ids
:
...
...
@@ -525,7 +514,7 @@ class ObjectManager(
# FTP support methods
def
manage_FTPlist
(
self
,
REQUEST
):
def
manage_FTPlist
(
self
,
REQUEST
):
"Directory listing for FTP"
out
=
()
...
...
lib/python/OFS/SimpleItem.py
View file @
64a9506a
...
...
@@ -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.
69 2000/05/11 18:54:14 jim
Exp $'''
__version__
=
'$Revision: 1.
69
$'
[
11
:
-
2
]
$Id: SimpleItem.py,v 1.
70 2000/05/17 18:50:29 brian
Exp $'''
__version__
=
'$Revision: 1.
70
$'
[
11
:
-
2
]
import
regex
,
sys
,
Globals
,
App
.
Management
,
Acquisition
,
App
.
Undo
import
AccessControl.Role
,
AccessControl
.
Owned
,
App
.
Common
...
...
@@ -188,17 +188,17 @@ class Item(Base, Resource, CopySource, App.Management.Tabs,
return
title
and
(
"%s (%s)"
%
(
title
,
id
))
or
id
def
this
(
self
):
"Handy way to talk to ourselves in document templates."
# Handy way to talk to ourselves in document templates.
return
self
def
tpURL
(
self
):
"My URL as used by tree tag"
# My URL as used by tree tag
url
=
self
.
id
if
hasattr
(
url
,
'im_func'
):
url
=
url
()
return
url
def
tpValues
(
self
):
"My sub-objects as used by the tree tag"
# My sub-objects as used by the tree tag
return
()
_manage_editedDialog
=
Globals
.
HTMLFile
(
'editedDialog'
,
globals
())
...
...
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