Completed
Push — master ( 46b003...a6c900 )
by P.R.
03:57
created

EndParagraphNode.prepare_content_tree()   A

Complexity

Conditions 1

Size

Total Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 1
CRAP Score 1.125

Importance

Changes 0
Metric Value
dl 0
loc 5
ccs 1
cts 2
cp 0.5
rs 9.4285
c 0
b 0
f 0
cc 1
crap 1.125
1
"""
2
SDoc
3
4
Copyright 2016 Set Based IT Consultancy
5
6
Licence MIT
7
"""
8
# ----------------------------------------------------------------------------------------------------------------------
9 1
from sdoc.sdoc2.NodeStore import NodeStore
10 1
from sdoc.sdoc2.node.Node import Node
11
12
13 1
class EndParagraphNode(Node):
14
    """
15
    SDoc2 node for end of paragraphs.
16
17
    Note: End of paragraphs will are temporary used during the content tree preparation. Before and after the content
18
          preparation end of paragraph nodes do not exist.
19
    """
20
21
    # ------------------------------------------------------------------------------------------------------------------
22 1
    def __init__(self, io, options, argument):
23
        """
24
        Object constructor.
25
26
        :param None|cleo.styles.output_style.OutputStyle io: The IO object.
27
        :param dict[str,str] options: Not used.
28
        :param str argument: Not used.
29
        """
30 1
        super().__init__(io, 'end_paragraph', options, argument)
31
32
    # ------------------------------------------------------------------------------------------------------------------
33 1
    def get_command(self):
34
        """
35
        Returns the command of this node, i.e. end_paragraph.
36
37
        :rtype: str
38
        """
39 1
        return 'end_paragraph'
40
41
    # ------------------------------------------------------------------------------------------------------------------
42 1
    def is_block_command(self):
43
        """
44
        Returns False.
45
46
        :rtype: bool
47
        """
48
        return False
49
50
    # ------------------------------------------------------------------------------------------------------------------
51 1
    def is_inline_command(self):
52
        """
53
        Returns False.
54
55
        :rtype: bool
56
        """
57
        return False
58
59
    # ------------------------------------------------------------------------------------------------------------------
60 1
    def prepare_content_tree(self):
61
        """
62
        Not implemented for end paragraph nodes.
63
        """
64
        raise RuntimeError()
65
66
67
# ----------------------------------------------------------------------------------------------------------------------
68
NodeStore.register_inline_command('end_paragraph', EndParagraphNode)
69