Completed
Push — master ( 57e7bf...8a74a7 )
by P.R.
01:36
created

sdoc.sdoc2.node.Sub2SectionNode   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 31
Duplicated Lines 0 %
Metric Value
dl 0
loc 31
rs 10
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A Sub2SectionNode.get_command() 0 7 1
A Sub2SectionNode.__init__() 0 8 1
A Sub2SectionNode.get_hierarchy_level() 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.HeadingNode import HeadingNode
11
12
13
class Sub2SectionNode(HeadingNode):
14
    """
15
    SDoc2 node for sub-subsections.
16
    """
17
    # ------------------------------------------------------------------------------------------------------------------
18
    def __init__(self, options, argument):
19
        """
20
        Object constructor.
21
22
        :param dict[str,str] options: The options of this section.
23
        :param str argument: The title of this section.
24
        """
25
        super().__init__('sub2section', options, argument)
26
27
    # ------------------------------------------------------------------------------------------------------------------
28
    def get_command(self):
29
        """
30
        Returns the command of this node, i.e. sub2section.
31
32
        :rtype: str
33
        """
34
        return 'sub2section'
35
36
    # ------------------------------------------------------------------------------------------------------------------
37
    def get_hierarchy_level(self, parent_hierarchy_level=-1):
38
        """
39
        Returns 4.
40
41
        :rtype: int
42
        """
43
        return 4
44
45
46
# ----------------------------------------------------------------------------------------------------------------------
47
node_store.register_inline_command('sub2section', Sub2SectionNode)
48
node_store.register_inline_command('subsubsection', Sub2SectionNode)
49