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

EndParagraphNode   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 52
Duplicated Lines 0 %

Test Coverage

Coverage 72.72%

Importance

Changes 1
Bugs 1 Features 0
Metric Value
wmc 5
dl 0
loc 52
ccs 8
cts 11
cp 0.7272
rs 10
c 1
b 1
f 0

5 Methods

Rating   Name   Duplication   Size   Complexity  
A is_block_command() 0 7 1
A __init__() 0 9 1
A get_command() 0 7 1
A is_inline_command() 0 7 1
A prepare_content_tree() 0 5 1
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