Updates to documentation

This commit is contained in:
Joona Hoikkala 2019-08-27 17:26:59 +03:00
parent 6fe450ca13
commit 52a4ed1dc0
No known key found for this signature in database
GPG key ID: D5AA86BBF9B29A5C
2 changed files with 22 additions and 18 deletions

View file

@ -136,11 +136,11 @@ class ParserNode(object):
instance variables. This is not meant to be used directly, but through
specific classes implementing ParserNode interface.
:param ancestor: BlockNode ancestor for this CommentNode.
:param ancestor: BlockNode ancestor for this CommentNode. Required.
:param filepath: Filesystem path for the file where this CommentNode
does or should exist in the filesystem.
does or should exist in the filesystem. Required.
:param bool dirty: Boolean flag for denoting if this CommentNode has been
created or changed after the last save.
created or changed after the last save. Default: False.
"""
@abc.abstractmethod
@ -187,12 +187,12 @@ class CommentNode(ParserNode):
"""
Initializes the CommentNode instance and sets its instance variables.
:param str comment: Contents of the comment.
:param ancestor: BlockNode ancestor for this CommentNode.
:param str comment: Contents of the comment. Required.
:param ancestor: BlockNode ancestor for this CommentNode. Required.
:param filepath: Filesystem path for the file where this CommentNode
does or should exist in the filesystem.
does or should exist in the filesystem. Required.
:param bool dirty: Boolean flag for denoting if this CommentNode has been
created or changed after the last save.
created or changed after the last save. Default: False.
"""
@ -230,18 +230,19 @@ class DirectiveNode(ParserNode):
"""
Initializes the DirectiveNode instance and sets its instance variables.
:param name: Name or key of the DirectiveNode object.
:param name: Name or key of the DirectiveNode object. Required.
:param tuple parameters: Tuple of str parameters for this DirectiveNode.
Default: ().
:param ancestor: BlockNode ancestor for this DirectiveNode, or None for
root configuratio node.
root configuratio node. Required.
:param filepath: Filesystem path for the file where this DirectiveNode
does or should exist in the filesystem, or None for directives introduced
in the httpd command line.
in the httpd command line. Required.
:param bool dirty: Boolean flag for denoting if this DirectiveNode has been
created or changed after the last save.
created or changed after the last save. Default: False.
:param bool enabled: True if this DirectiveNode object is parsed in the active
configuration of the httpd. False if the DirectiveNode exists within a
unmatched conditional configuration block.
unmatched conditional configuration block. Default: True.
"""
@ -298,17 +299,18 @@ class BlockNode(DirectiveNode):
Initializes the BlockNode instance and sets its instance variables.
:param name: Name or key of the BlockNode object, or None for root
configuration node.
configuration node. Required.
:param tuple parameters: Tuple of str parameters for this BlockNode.
Default: ().
:param ancestor: BlockNode ancestor for this BlockNode, or None for root
configuration node.
configuration node. Required.
:param str filepath: Filesystem path for the file where this BlockNode does
or should exist in the filesystem.
or should exist in the filesystem. Required.
:param bool dirty: Boolean flag for denoting if this BlockNode has been
created or changed after the last save.
created or changed after the last save. Default: False.
:param bool enabled: True if this BlockNode object is parsed in the active
configuration object by the httpd. False if the BlockNode exists within
a unmatched conditional configuration block.
a unmatched conditional configuration block. Default: True.
"""
@abc.abstractmethod

View file

@ -3,7 +3,9 @@
def validate_kwargs(kwargs, required_names):
"""
Ensures that the kwargs dict has all the expected values.
Ensures that the kwargs dict has all the expected values. This function modifies
the kwargs dictionary, and hence the returned dictionary should be used instead
in the caller function instead of the original kwargs.
:param dict kwargs: Dictionary of keyword arguments to validate.
:param list required_names: List of required parameter names.