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/
...
@@ -8,10 +8,12 @@ http://docs.zope.org/zope2/
2.13.25 (unreleased)
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
- Optimized the `OFS.ObjectManager.__contains__` method to do the
least amount of work necessary.
least amount of work necessary.
2.13.24 (2016-02-29)
2.13.24 (2016-02-29)
--------------------
--------------------
...
...
src/OFS/Application.py
View file @
bef2d017
...
@@ -202,13 +202,13 @@ class Application(ApplicationDefaultPermissions,
...
@@ -202,13 +202,13 @@ class Application(ApplicationDefaultPermissions,
return
self
return
self
def
getPhysicalPath
(
self
):
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
#
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.
# access this object again later, for example in a copy/paste
getPhysicalRoot() and getPhysicalPath() are designed to operate
# operation. getPhysicalRoot() and getPhysicalPath() are designed to
together.
# operate
together.
"""
#
# We're at the base of the path.
# We're at the base of the path.
return
(
''
,)
return
(
''
,)
...
...
src/OFS/SimpleItem.py
View file @
bef2d017
...
@@ -410,13 +410,13 @@ class Item_w__name__(Item):
...
@@ -410,13 +410,13 @@ class Item_w__name__(Item):
self
.
__name__
=
id
self
.
__name__
=
id
def
getPhysicalPath
(
self
):
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__
,)
path
=
(
self
.
__name__
,)
p
=
aq_parent
(
aq_inner
(
self
))
p
=
aq_parent
(
aq_inner
(
self
))
...
...
src/OFS/Traversable.py
View file @
bef2d017
...
@@ -108,13 +108,13 @@ class Traversable:
...
@@ -108,13 +108,13 @@ class Traversable:
security
.
declarePublic
(
'getPhysicalPath'
)
security
.
declarePublic
(
'getPhysicalPath'
)
def
getPhysicalPath
(
self
):
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
(),)
path
=
(
self
.
getId
(),)
p
=
aq_parent
(
aq_inner
(
self
))
p
=
aq_parent
(
aq_inner
(
self
))
...
...
src/OFS/ZDOM.py
View file @
bef2d017
...
@@ -95,61 +95,61 @@ class Node:
...
@@ -95,61 +95,61 @@ class Node:
security
.
declareProtected
(
access_contents_information
,
'getNodeName'
)
security
.
declareProtected
(
access_contents_information
,
'getNodeName'
)
def
getNodeName
(
self
):
def
getNodeName
(
self
):
"""The name of this node, depending on its type"""
# The name of this node, depending on its type.
return
None
return
None
security
.
declareProtected
(
access_contents_information
,
'getNodeValue'
)
security
.
declareProtected
(
access_contents_information
,
'getNodeValue'
)
def
getNodeValue
(
self
):
def
getNodeValue
(
self
):
"""The value of this node, depending on its type"""
# The value of this node, depending on its type.
return
None
return
None
security
.
declareProtected
(
access_contents_information
,
'getParentNode'
)
security
.
declareProtected
(
access_contents_information
,
'getParentNode'
)
def
getParentNode
(
self
):
def
getParentNode
(
self
):
"""The parent of this node. All nodes except Document
# The parent of this node. All nodes except Document,
DocumentFragment and Attr may have a parent"""
# DocumentFragment and Attr may have a parent.
return
None
return
None
security
.
declareProtected
(
access_contents_information
,
'getChildNodes'
)
security
.
declareProtected
(
access_contents_information
,
'getChildNodes'
)
def
getChildNodes
(
self
):
def
getChildNodes
(
self
):
"""
Returns a NodeList that contains all children of this node.
#
Returns a NodeList that contains all children of this node.
If there are no children, this is a empty NodeList"""
# If there are no children, this is a empty NodeList
return
NodeList
()
return
NodeList
()
security
.
declareProtected
(
access_contents_information
,
'getFirstChild'
)
security
.
declareProtected
(
access_contents_information
,
'getFirstChild'
)
def
getFirstChild
(
self
):
def
getFirstChild
(
self
):
"""
The first child of this node. If there is no such node
#
The first child of this node. If there is no such node
this returns None."""
# this returns None.
return
None
return
None
security
.
declareProtected
(
access_contents_information
,
'getLastChild'
)
security
.
declareProtected
(
access_contents_information
,
'getLastChild'
)
def
getLastChild
(
self
):
def
getLastChild
(
self
):
"""
The last child of this node. If there is no such node
#
The last child of this node. If there is no such node
this returns None."""
# this returns None.
return
None
return
None
security
.
declareProtected
(
access_contents_information
,
security
.
declareProtected
(
access_contents_information
,
'getPreviousSibling'
)
'getPreviousSibling'
)
def
getPreviousSibling
(
self
):
def
getPreviousSibling
(
self
):
"""The node immediately preceding this node. If
# The node immediately preceding this node.
there is no such node, this returns None."""
# If there is no such node, this returns None.
return
None
return
None
security
.
declareProtected
(
access_contents_information
,
'getNextSibling'
)
security
.
declareProtected
(
access_contents_information
,
'getNextSibling'
)
def
getNextSibling
(
self
):
def
getNextSibling
(
self
):
"""The node immediately preceding this node. If
# The node immediately preceding this node.
there is no such node, this returns None."""
# If there is no such node, this returns None.
return
None
return
None
security
.
declareProtected
(
access_contents_information
,
'getAttributes'
)
security
.
declareProtected
(
access_contents_information
,
'getAttributes'
)
def
getAttributes
(
self
):
def
getAttributes
(
self
):
"""
Returns a NamedNodeMap containing the attributes
#
Returns a NamedNodeMap containing the attributes
of this node (if it is an element) or None otherwise."""
# of this node (if it is an element) or None otherwise.
return
None
return
None
security
.
declareProtected
(
access_contents_information
,
'getOwnerDocument'
)
security
.
declareProtected
(
access_contents_information
,
'getOwnerDocument'
)
def
getOwnerDocument
(
self
):
def
getOwnerDocument
(
self
):
"""
The Document object associated with this node.
#
The Document object associated with this node.
When this is a document this is None"""
# When this is a document this is None.
node
=
self
node
=
self
if
hasattr
(
node
,
'aq_parent'
):
if
hasattr
(
node
,
'aq_parent'
):
node
=
aq_parent
(
self
)
node
=
aq_parent
(
self
)
...
@@ -161,8 +161,8 @@ class Node:
...
@@ -161,8 +161,8 @@ class Node:
security
.
declareProtected
(
access_contents_information
,
'hasChildNodes'
)
security
.
declareProtected
(
access_contents_information
,
'hasChildNodes'
)
def
hasChildNodes
(
self
):
def
hasChildNodes
(
self
):
"""
Returns true if the node has any children, false
#
Returns true if the node has any children, false
if it doesn't. """
# if it doesn't.
return
len
(
self
.
objectIds
())
return
len
(
self
.
objectIds
())
InitializeClass
(
Node
)
InitializeClass
(
Node
)
...
@@ -207,36 +207,36 @@ class Document(Explicit, Node):
...
@@ -207,36 +207,36 @@ class Document(Explicit, Node):
# ------------
# ------------
def
getNodeName
(
self
):
def
getNodeName
(
self
):
"""The name of this node, depending on its type"""
# The name of this node, depending on its type.
return
'#document'
return
'#document'
def
getNodeType
(
self
):
def
getNodeType
(
self
):
"""A code representing the type of the node."""
# A code representing the type of the node.
return
DOCUMENT_NODE
return
DOCUMENT_NODE
def
getOwnerDocument
(
self
):
def
getOwnerDocument
(
self
):
"""
The Document object associated with this node.
#
The Document object associated with this node.
When this is a document this is None"""
# When this is a document this is None.
return
self
return
self
def
getChildNodes
(
self
):
def
getChildNodes
(
self
):
"""
Returns a NodeList that contains all children of this node.
#
Returns a NodeList that contains all children of this node.
If there are no children, this is a empty NodeList"""
# If there are no children, this is a empty NodeList.
return
NodeList
([
aq_parent
(
self
)])
return
NodeList
([
aq_parent
(
self
)])
def
getFirstChild
(
self
):
def
getFirstChild
(
self
):
"""
The first child of this node. If there is no such node
#
The first child of this node. If there is no such node
this returns None."""
# this returns None.
return
aq_parent
(
self
)
return
aq_parent
(
self
)
def
getLastChild
(
self
):
def
getLastChild
(
self
):
"""
The last child of this node. If there is no such node
#
The last child of this node. If there is no such node
this returns None."""
# this returns None.
return
aq_parent
(
self
)
return
aq_parent
(
self
)
def
hasChildNodes
(
self
):
def
hasChildNodes
(
self
):
"""
Returns true if the node has any children, false
#
Returns true if the node has any children, false
if it doesn't. """
# if it doesn't.
return
1
return
1
InitializeClass
(
Document
)
InitializeClass
(
Document
)
...
@@ -283,49 +283,49 @@ class Element(Node):
...
@@ -283,49 +283,49 @@ class Element(Node):
security
.
declareProtected
(
access_contents_information
,
'getTagName'
)
security
.
declareProtected
(
access_contents_information
,
'getTagName'
)
def
getTagName
(
self
):
def
getTagName
(
self
):
"""The name of the element"""
# The name of the element.
return
self
.
__class__
.
__name__
return
self
.
__class__
.
__name__
# Node Attributes
# Node Attributes
# ---------------
# ---------------
def
getNodeName
(
self
):
def
getNodeName
(
self
):
"""The name of this node, depending on its type"""
# The name of this node, depending on its type.
return
self
.
getTagName
()
return
self
.
getTagName
()
def
getNodeType
(
self
):
def
getNodeType
(
self
):
"""A code representing the type of the node."""
# A code representing the type of the node.
return
ELEMENT_NODE
return
ELEMENT_NODE
def
getParentNode
(
self
):
def
getParentNode
(
self
):
"""The parent of this node. All nodes except Document
# The parent of this node. All nodes except Document,
DocumentFragment and Attr may have a parent"""
# DocumentFragment and Attr may have a parent.
return
getattr
(
self
,
'aq_parent'
,
None
)
return
getattr
(
self
,
'aq_parent'
,
None
)
def
getChildNodes
(
self
):
def
getChildNodes
(
self
):
"""
Returns a NodeList that contains all children of this node.
#
Returns a NodeList that contains all children of this node.
If there are no children, this is a empty NodeList"""
# If there are no children, this is a empty NodeList.
return
NodeList
(
self
.
objectValues
())
return
NodeList
(
self
.
objectValues
())
def
getFirstChild
(
self
):
def
getFirstChild
(
self
):
"""
The first child of this node. If there is no such node
#
The first child of this node. If there is no such node
this returns None"""
# this returns None
children
=
self
.
getChildNodes
()
children
=
self
.
getChildNodes
()
if
children
:
if
children
:
return
children
.
_data
[
0
]
return
children
.
_data
[
0
]
return
None
return
None
def
getLastChild
(
self
):
def
getLastChild
(
self
):
"""
The last child of this node. If there is no such node
#
The last child of this node. If there is no such node
this returns None."""
# this returns None.
children
=
self
.
getChildNodes
()
children
=
self
.
getChildNodes
()
if
children
:
if
children
:
return
children
.
_data
[
-
1
]
return
children
.
_data
[
-
1
]
return
None
return
None
def
getPreviousSibling
(
self
):
def
getPreviousSibling
(
self
):
"""The node immediately preceding this node. If
# The node immediately preceding this node.
there is no such node, this returns None."""
# If there is no such node, this returns None.
if
hasattr
(
self
,
'aq_parent'
):
if
hasattr
(
self
,
'aq_parent'
):
parent
=
aq_parent
(
self
)
parent
=
aq_parent
(
self
)
ids
=
list
(
parent
.
objectIds
())
ids
=
list
(
parent
.
objectIds
())
...
@@ -338,8 +338,8 @@ class Element(Node):
...
@@ -338,8 +338,8 @@ class Element(Node):
return
None
return
None
def
getNextSibling
(
self
):
def
getNextSibling
(
self
):
"""The node immediately preceding this node. If
# The node immediately preceding this node.
there is no such node, this returns None."""
# If there is no such node, this returns None.
if
hasattr
(
self
,
'aq_parent'
):
if
hasattr
(
self
,
'aq_parent'
):
parent
=
aq_parent
(
self
)
parent
=
aq_parent
(
self
)
ids
=
list
(
parent
.
objectIds
())
ids
=
list
(
parent
.
objectIds
())
...
@@ -356,13 +356,13 @@ class Element(Node):
...
@@ -356,13 +356,13 @@ class Element(Node):
security
.
declareProtected
(
access_contents_information
,
'getAttribute'
)
security
.
declareProtected
(
access_contents_information
,
'getAttribute'
)
def
getAttribute
(
self
,
name
):
def
getAttribute
(
self
,
name
):
"""Retrieves an attribute value by name."""
# Retrieves an attribute value by name.
return
None
return
None
security
.
declareProtected
(
access_contents_information
,
'getAttributeNode'
)
security
.
declareProtected
(
access_contents_information
,
'getAttributeNode'
)
def
getAttributeNode
(
self
,
name
):
def
getAttributeNode
(
self
,
name
):
"""
Retrieves an Attr node by name or None if
#
Retrieves an Attr node by name or None if
there is no such attribute. """
# there is no such attribute.
return
None
return
None
security
.
declareProtected
(
access_contents_information
,
security
.
declareProtected
(
access_contents_information
,
...
@@ -395,8 +395,8 @@ class ElementWithAttributes(Element):
...
@@ -395,8 +395,8 @@ class ElementWithAttributes(Element):
"""
"""
def
getAttributes
(
self
):
def
getAttributes
(
self
):
"""
Returns a NamedNodeMap containing the attributes
#
Returns a NamedNodeMap containing the attributes
of this node (if it is an element) or None otherwise."""
# of this node (if it is an element) or None otherwise.
attribs
=
{}
attribs
=
{}
for
p
in
self
.
_properties
:
for
p
in
self
.
_properties
:
if
p
[
'type'
]
==
'string'
:
if
p
[
'type'
]
==
'string'
:
...
@@ -406,13 +406,13 @@ class ElementWithAttributes(Element):
...
@@ -406,13 +406,13 @@ class ElementWithAttributes(Element):
return
NamedNodeMap
(
attribs
)
return
NamedNodeMap
(
attribs
)
def
getAttribute
(
self
,
name
):
def
getAttribute
(
self
,
name
):
"""Retrieves an attribute value by name."""
# Retrieves an attribute value by name.
if
self
.
getPropertyType
(
name
)
==
'string'
:
if
self
.
getPropertyType
(
name
)
==
'string'
:
return
self
.
getProperty
(
name
,
''
)
return
self
.
getProperty
(
name
,
''
)
def
getAttributeNode
(
self
,
name
):
def
getAttributeNode
(
self
,
name
):
"""
Retrieves an Attr node by name or None if
#
Retrieves an Attr node by name or None if
there is no such attribute. """
# there is no such attribute.
if
self
.
getPropertyType
(
name
)
==
'string'
:
if
self
.
getPropertyType
(
name
)
==
'string'
:
return
Attr
(
name
,
self
.
getProperty
(
name
,
''
)).
__of__
(
self
)
return
Attr
(
name
,
self
.
getProperty
(
name
,
''
)).
__of__
(
self
)
return
None
return
None
...
@@ -426,22 +426,22 @@ class ElementWithTitle(Element):
...
@@ -426,22 +426,22 @@ class ElementWithTitle(Element):
"""
"""
def
getAttributes
(
self
):
def
getAttributes
(
self
):
"""
Returns a NamedNodeMap containing the attributes
#
Returns a NamedNodeMap containing the attributes
of this node (if it is an element) or None otherwise."""
# of this node (if it is an element) or None otherwise.
title
=
self
.
getAttributeNode
(
'title'
)
title
=
self
.
getAttributeNode
(
'title'
)
if
title
is
not
None
:
if
title
is
not
None
:
return
NamedNodeMap
({
'title'
:
title
})
return
NamedNodeMap
({
'title'
:
title
})
return
NamedNodeMap
()
return
NamedNodeMap
()
def
getAttribute
(
self
,
name
):
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'
):
if
name
==
'title'
and
hasattr
(
aq_base
(
self
),
'title'
):
return
self
.
title
return
self
.
title
return
''
return
''
def
getAttributeNode
(
self
,
name
):
def
getAttributeNode
(
self
,
name
):
"""
Retrieves an Attr node by name or None if
#
Retrieves an Attr node by name or None if
there is no such attribute. """
# there is no such attribute.
value
=
self
.
getAttribute
(
name
)
value
=
self
.
getAttribute
(
name
)
if
value
:
if
value
:
return
Attr
(
name
,
value
).
__of__
(
self
)
return
Attr
(
name
,
value
).
__of__
(
self
)
...
@@ -454,8 +454,6 @@ class Root(ElementWithAttributes):
...
@@ -454,8 +454,6 @@ class Root(ElementWithAttributes):
"""
"""
def
getOwnerDocument
(
self
):
def
getOwnerDocument
(
self
):
"""
"""
return
Document
().
__of__
(
self
)
return
Document
().
__of__
(
self
)
...
@@ -547,7 +545,7 @@ class Attr(Implicit, Node):
...
@@ -547,7 +545,7 @@ class Attr(Implicit, Node):
self
.
specified
=
1
self
.
specified
=
1
def
getNodeName
(
self
):
def
getNodeName
(
self
):
"""The name of this node, depending on its type"""
# The name of this node, depending on its type.
return
self
.
name
return
self
.
name
def
getName
(
self
):
def
getName
(
self
):
...
@@ -555,11 +553,11 @@ class Attr(Implicit, Node):
...
@@ -555,11 +553,11 @@ class Attr(Implicit, Node):
return
self
.
name
return
self
.
name
def
getNodeValue
(
self
):
def
getNodeValue
(
self
):
"""The value of this node, depending on its type"""
# The value of this node, depending on its type.
return
self
.
value
return
self
.
value
def
getNodeType
(
self
):
def
getNodeType
(
self
):
"""A code representing the type of the node."""
# A code representing the type of the node.
return
ATTRIBUTE_NODE
return
ATTRIBUTE_NODE
def
getSpecified
(
self
):
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