Completed
Push — master ( 6d5d5a...9a966b )
by Oleg
10s
created

sdoc.sdoc2.node.EndParagraphNode   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 50
Duplicated Lines 0 %
Metric Value
dl 0
loc 50
rs 10
wmc 5

5 Methods

Rating   Name   Duplication   Size   Complexity  
A __init__() 0 8 1
A is_inline_command() 0 7 1
A is_block_command() 0 7 1
A prepare_content_tree() 0 5 1
A get_command() 0 7 1
1
"""
2
SDoc
3
4
Copyright 2016 Set Based IT Consultancy
5
6
Licence MIT
7
"""
8
# ----------------------------------------------------------------------------------------------------------------------
9
from sdoc.sdoc2 import node_store
10
from sdoc.sdoc2.node.Node import Node
11
12
13
class EndParagraphNode(Node):
0 ignored issues
show
Unused Code introduced by
This abstract class does not seem to be used anywhere.
Loading history...
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
    def __init__(self, options, argument):
22
        """
23
        Object constructor.
24
25
        :param dict[str,str] options: Not used.
26
        :param str argument: Not used.
27
        """
28
        super().__init__('end_paragraph', options, argument)
29
30
    # ------------------------------------------------------------------------------------------------------------------
31
    def get_command(self):
32
        """
33
        Returns the command of this node, i.e. end_paragraph.
34
35
        :rtype: str
36
        """
37
        return 'end_paragraph'
38
39
    # ------------------------------------------------------------------------------------------------------------------
40
    def is_block_command(self):
41
        """
42
        Returns False.
43
44
        :rtype: bool
45
        """
46
        return False
47
48
    # ------------------------------------------------------------------------------------------------------------------
49
    def is_inline_command(self):
50
        """
51
        Returns False.
52
53
        :rtype: bool
54
        """
55
        return False
56
57
    # ------------------------------------------------------------------------------------------------------------------
58
    def prepare_content_tree(self):
59
        """
60
        Not implemented for end paragraph nodes.
61
        """
62
        raise NotImplementedError()
63
64
# ----------------------------------------------------------------------------------------------------------------------
65
node_store.register_inline_command('end_paragraph', EndParagraphNode)
66