Test Failed
Push — master ( 728016...1ac98c )
by P.R.
01:34
created

SectionNode   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 1 Features 0
Metric Value
wmc 3
c 1
b 1
f 0
dl 0
loc 33
ccs 0
cts 7
cp 0
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A get_hierarchy_level() 0 7 1
A get_command() 0 7 1
A __init__() 0 9 1
1
"""
2
SDoc
3
4
Copyright 2016 Set Based IT Consultancy
5
6
Licence MIT
7
"""
8
# ----------------------------------------------------------------------------------------------------------------------
9
from sdoc.sdoc2.NodeStore import NodeStore
10
from sdoc.sdoc2.node.HeadingNode import HeadingNode
11
12
13
class SectionNode(HeadingNode):
14
    """
15
    SDoc2 node for sections.
16
    """
17
18
    # ------------------------------------------------------------------------------------------------------------------
19
    def __init__(self, io, options, argument):
20
        """
21
        Object constructor.
22
23
        :param None|cleo.styles.output_style.OutputStyle io: The IO object.
24
        :param dict[str,str] options: The options of this section.
25
        :param str argument: The title of this section.
26
        """
27
        super().__init__(io, 'section', options, argument)
28
29
    # ------------------------------------------------------------------------------------------------------------------
30
    def get_command(self):
31
        """
32
        Returns the command of this node, i.e. section.
33
34
        :rtype: str
35
        """
36
        return 'section'
37
38
    # ------------------------------------------------------------------------------------------------------------------
39
    def get_hierarchy_level(self, parent_hierarchy_level=-1):
40
        """
41
        Returns 2.
42
43
        :rtype: int
44
        """
45
        return 2
46
47
48
# ----------------------------------------------------------------------------------------------------------------------
49
NodeStore.register_inline_command('section', SectionNode)
50