Passed
Push — master ( 1ac98c...ed1e15 )
by P.R.
01:49
created

Sub2SectionNode.__init__()   A

Complexity

Conditions 1

Size

Total Lines 9

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 9
ccs 2
cts 2
cp 1
rs 9.6666
c 0
b 0
f 0
cc 1
crap 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.HeadingNode import HeadingNode
11
12
13 1
class Sub2SectionNode(HeadingNode):
14
    """
15
    SDoc2 node for sub-subsections.
16
    """
17
18
    # ------------------------------------------------------------------------------------------------------------------
19 1
    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 1
        super().__init__(io, 'sub2section', options, argument)
28
29
    # ------------------------------------------------------------------------------------------------------------------
30 1
    def get_command(self):
31
        """
32
        Returns the command of this node, i.e. sub2section.
33
34
        :rtype: str
35
        """
36 1
        return 'sub2section'
37
38
    # ------------------------------------------------------------------------------------------------------------------
39 1
    def get_hierarchy_level(self, parent_hierarchy_level=-1):
40
        """
41
        Returns 4.
42
43
        :rtype: int
44
        """
45 1
        return 4
46
47
48
# ----------------------------------------------------------------------------------------------------------------------
49 1
NodeStore.register_inline_command('sub2section', Sub2SectionNode)
50
NodeStore.register_inline_command('subsubsection', Sub2SectionNode)
51