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
bef2d017
Commit
bef2d017
authored
Apr 20, 2016
by
Maurits van Rees
Committed by
Hanno Schlichting
Jul 17, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removed docstrings from some methods to avoid publishing them.
From Products.PloneHotfix20160419.
parent
0b382a60
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
86 additions
and
86 deletions
+86
-86
doc/CHANGES.rst
doc/CHANGES.rst
+3
-1
src/OFS/Application.py
src/OFS/Application.py
+7
-7
src/OFS/SimpleItem.py
src/OFS/SimpleItem.py
+7
-7
src/OFS/Traversable.py
src/OFS/Traversable.py
+6
-6
src/OFS/ZDOM.py
src/OFS/ZDOM.py
+63
-65
No files found.
doc/CHANGES.rst
View file @
bef2d017
...
...
@@ -8,10 +8,12 @@ http://docs.zope.org/zope2/
2.13.25 (unreleased)
--------------------
- Removed docstrings from some methods to avoid publishing them. From
Products.PloneHotfix20160419. [maurits]
- Optimized the `OFS.ObjectManager.__contains__` method to do the
least amount of work necessary.
2.13.24 (2016-02-29)
--------------------
...
...
src/OFS/Application.py
View file @
bef2d017
...
...
@@ -202,13 +202,13 @@ class Application(ApplicationDefaultPermissions,
return
self
def
getPhysicalPath
(
self
):
"""
Get the physical path of the object.
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.
"""
#
Get the physical path of the object.
#
#
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.
#
# We're at the base of the path.
return
(
''
,)
...
...
src/OFS/SimpleItem.py
View file @
bef2d017
...
...
@@ -410,13 +410,13 @@ class Item_w__name__(Item):
self
.
__name__
=
id
def
getPhysicalPath
(
self
):
"""Get the physical path of the object.
# Get the physical path of the object.
#
# 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.
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.
"""
path
=
(
self
.
__name__
,)
p
=
aq_parent
(
aq_inner
(
self
))
...
...
src/OFS/Traversable.py
View file @
bef2d017
...
...
@@ -108,13 +108,13 @@ class Traversable:
security
.
declarePublic
(
'getPhysicalPath'
)
def
getPhysicalPath
(
self
):
"""Get the physical path of the object.
# Get the physical path of the object.
#
# 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.
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.
"""
path
=
(
self
.
getId
(),)
p
=
aq_parent
(
aq_inner
(
self
))
...
...
src/OFS/ZDOM.py
View file @
bef2d017
...
...
@@ -95,61 +95,61 @@ class Node:
security
.
declareProtected
(
access_contents_information
,
'getNodeName'
)
def
getNodeName
(
self
):
"""The name of this node, depending on its type"""
# The name of this node, depending on its type.
return
None
security
.
declareProtected
(
access_contents_information
,
'getNodeValue'
)
def
getNodeValue
(
self
):
"""The value of this node, depending on its type"""
# The value of this node, depending on its type.
return
None
security
.
declareProtected
(
access_contents_information
,
'getParentNode'
)
def
getParentNode
(
self
):
"""The parent of this node. All nodes except Document
DocumentFragment and Attr may have a parent"""
# The parent of this node. All nodes except Document,
# DocumentFragment and Attr may have a parent.
return
None
security
.
declareProtected
(
access_contents_information
,
'getChildNodes'
)
def
getChildNodes
(
self
):
"""
Returns a NodeList that contains all children of this node.
If there are no children, this is a empty NodeList"""
#
Returns a NodeList that contains all children of this node.
# If there are no children, this is a empty NodeList
return
NodeList
()
security
.
declareProtected
(
access_contents_information
,
'getFirstChild'
)
def
getFirstChild
(
self
):
"""
The first child of this node. If there is no such node
this returns None."""
#
The first child of this node. If there is no such node
# this returns None.
return
None
security
.
declareProtected
(
access_contents_information
,
'getLastChild'
)
def
getLastChild
(
self
):
"""
The last child of this node. If there is no such node
this returns None."""
#
The last child of this node. If there is no such node
# this returns None.
return
None
security
.
declareProtected
(
access_contents_information
,
'getPreviousSibling'
)
def
getPreviousSibling
(
self
):
"""The node immediately preceding this node. If
there is no such node, this returns None."""
# The node immediately preceding this node.
# If there is no such node, this returns None.
return
None
security
.
declareProtected
(
access_contents_information
,
'getNextSibling'
)
def
getNextSibling
(
self
):
"""The node immediately preceding this node. If
there is no such node, this returns None."""
# The node immediately preceding this node.
# If there is no such node, this returns None.
return
None
security
.
declareProtected
(
access_contents_information
,
'getAttributes'
)
def
getAttributes
(
self
):
"""
Returns a NamedNodeMap containing the attributes
of this node (if it is an element) or None otherwise."""
#
Returns a NamedNodeMap containing the attributes
# of this node (if it is an element) or None otherwise.
return
None
security
.
declareProtected
(
access_contents_information
,
'getOwnerDocument'
)
def
getOwnerDocument
(
self
):
"""
The Document object associated with this node.
When this is a document this is None"""
#
The Document object associated with this node.
# When this is a document this is None.
node
=
self
if
hasattr
(
node
,
'aq_parent'
):
node
=
aq_parent
(
self
)
...
...
@@ -161,8 +161,8 @@ class Node:
security
.
declareProtected
(
access_contents_information
,
'hasChildNodes'
)
def
hasChildNodes
(
self
):
"""
Returns true if the node has any children, false
if it doesn't. """
#
Returns true if the node has any children, false
# if it doesn't.
return
len
(
self
.
objectIds
())
InitializeClass
(
Node
)
...
...
@@ -207,36 +207,36 @@ class Document(Explicit, Node):
# ------------
def
getNodeName
(
self
):
"""The name of this node, depending on its type"""
# The name of this node, depending on its type.
return
'#document'
def
getNodeType
(
self
):
"""A code representing the type of the node."""
# A code representing the type of the node.
return
DOCUMENT_NODE
def
getOwnerDocument
(
self
):
"""
The Document object associated with this node.
When this is a document this is None"""
#
The Document object associated with this node.
# When this is a document this is None.
return
self
def
getChildNodes
(
self
):
"""
Returns a NodeList that contains all children of this node.
If there are no children, this is a empty NodeList"""
#
Returns a NodeList that contains all children of this node.
# If there are no children, this is a empty NodeList.
return
NodeList
([
aq_parent
(
self
)])
def
getFirstChild
(
self
):
"""
The first child of this node. If there is no such node
this returns None."""
#
The first child of this node. If there is no such node
# this returns None.
return
aq_parent
(
self
)
def
getLastChild
(
self
):
"""
The last child of this node. If there is no such node
this returns None."""
#
The last child of this node. If there is no such node
# this returns None.
return
aq_parent
(
self
)
def
hasChildNodes
(
self
):
"""
Returns true if the node has any children, false
if it doesn't. """
#
Returns true if the node has any children, false
# if it doesn't.
return
1
InitializeClass
(
Document
)
...
...
@@ -283,49 +283,49 @@ class Element(Node):
security
.
declareProtected
(
access_contents_information
,
'getTagName'
)
def
getTagName
(
self
):
"""The name of the element"""
# The name of the element.
return
self
.
__class__
.
__name__
# Node Attributes
# ---------------
def
getNodeName
(
self
):
"""The name of this node, depending on its type"""
# The name of this node, depending on its type.
return
self
.
getTagName
()
def
getNodeType
(
self
):
"""A code representing the type of the node."""
# A code representing the type of the node.
return
ELEMENT_NODE
def
getParentNode
(
self
):
"""The parent of this node. All nodes except Document
DocumentFragment and Attr may have a parent"""
# The parent of this node. All nodes except Document,
# DocumentFragment and Attr may have a parent.
return
getattr
(
self
,
'aq_parent'
,
None
)
def
getChildNodes
(
self
):
"""
Returns a NodeList that contains all children of this node.
If there are no children, this is a empty NodeList"""
#
Returns a NodeList that contains all children of this node.
# If there are no children, this is a empty NodeList.
return
NodeList
(
self
.
objectValues
())
def
getFirstChild
(
self
):
"""
The first child of this node. If there is no such node
this returns None"""
#
The first child of this node. If there is no such node
# this returns None
children
=
self
.
getChildNodes
()
if
children
:
return
children
.
_data
[
0
]
return
None
def
getLastChild
(
self
):
"""
The last child of this node. If there is no such node
this returns None."""
#
The last child of this node. If there is no such node
# this returns None.
children
=
self
.
getChildNodes
()
if
children
:
return
children
.
_data
[
-
1
]
return
None
def
getPreviousSibling
(
self
):
"""The node immediately preceding this node. If
there is no such node, this returns None."""
# The node immediately preceding this node.
# If there is no such node, this returns None.
if
hasattr
(
self
,
'aq_parent'
):
parent
=
aq_parent
(
self
)
ids
=
list
(
parent
.
objectIds
())
...
...
@@ -338,8 +338,8 @@ class Element(Node):
return
None
def
getNextSibling
(
self
):
"""The node immediately preceding this node. If
there is no such node, this returns None."""
# The node immediately preceding this node.
# If there is no such node, this returns None.
if
hasattr
(
self
,
'aq_parent'
):
parent
=
aq_parent
(
self
)
ids
=
list
(
parent
.
objectIds
())
...
...
@@ -356,13 +356,13 @@ class Element(Node):
security
.
declareProtected
(
access_contents_information
,
'getAttribute'
)
def
getAttribute
(
self
,
name
):
"""Retrieves an attribute value by name."""
# Retrieves an attribute value by name.
return
None
security
.
declareProtected
(
access_contents_information
,
'getAttributeNode'
)
def
getAttributeNode
(
self
,
name
):
"""
Retrieves an Attr node by name or None if
there is no such attribute. """
#
Retrieves an Attr node by name or None if
# there is no such attribute.
return
None
security
.
declareProtected
(
access_contents_information
,
...
...
@@ -395,8 +395,8 @@ class ElementWithAttributes(Element):
"""
def
getAttributes
(
self
):
"""
Returns a NamedNodeMap containing the attributes
of this node (if it is an element) or None otherwise."""
#
Returns a NamedNodeMap containing the attributes
# of this node (if it is an element) or None otherwise.
attribs
=
{}
for
p
in
self
.
_properties
:
if
p
[
'type'
]
==
'string'
:
...
...
@@ -406,13 +406,13 @@ class ElementWithAttributes(Element):
return
NamedNodeMap
(
attribs
)
def
getAttribute
(
self
,
name
):
"""Retrieves an attribute value by name."""
# Retrieves an attribute value by name.
if
self
.
getPropertyType
(
name
)
==
'string'
:
return
self
.
getProperty
(
name
,
''
)
def
getAttributeNode
(
self
,
name
):
"""
Retrieves an Attr node by name or None if
there is no such attribute. """
#
Retrieves an Attr node by name or None if
# there is no such attribute.
if
self
.
getPropertyType
(
name
)
==
'string'
:
return
Attr
(
name
,
self
.
getProperty
(
name
,
''
)).
__of__
(
self
)
return
None
...
...
@@ -426,22 +426,22 @@ class ElementWithTitle(Element):
"""
def
getAttributes
(
self
):
"""
Returns a NamedNodeMap containing the attributes
of this node (if it is an element) or None otherwise."""
#
Returns a NamedNodeMap containing the attributes
# of this node (if it is an element) or None otherwise.
title
=
self
.
getAttributeNode
(
'title'
)
if
title
is
not
None
:
return
NamedNodeMap
({
'title'
:
title
})
return
NamedNodeMap
()
def
getAttribute
(
self
,
name
):
"""Retrieves an attribute value by name."""
# Retrieves an attribute value by name.
if
name
==
'title'
and
hasattr
(
aq_base
(
self
),
'title'
):
return
self
.
title
return
''
def
getAttributeNode
(
self
,
name
):
"""
Retrieves an Attr node by name or None if
there is no such attribute. """
#
Retrieves an Attr node by name or None if
# there is no such attribute.
value
=
self
.
getAttribute
(
name
)
if
value
:
return
Attr
(
name
,
value
).
__of__
(
self
)
...
...
@@ -454,8 +454,6 @@ class Root(ElementWithAttributes):
"""
def
getOwnerDocument
(
self
):
"""
"""
return
Document
().
__of__
(
self
)
...
...
@@ -547,7 +545,7 @@ class Attr(Implicit, Node):
self
.
specified
=
1
def
getNodeName
(
self
):
"""The name of this node, depending on its type"""
# The name of this node, depending on its type.
return
self
.
name
def
getName
(
self
):
...
...
@@ -555,11 +553,11 @@ class Attr(Implicit, Node):
return
self
.
name
def
getNodeValue
(
self
):
"""The value of this node, depending on its type"""
# The value of this node, depending on its type.
return
self
.
value
def
getNodeType
(
self
):
"""A code representing the type of the node."""
# A code representing the type of the node.
return
ATTRIBUTE_NODE
def
getSpecified
(
self
):
...
...
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