Completed
Pull Request — master (#32)
by Oleg
03:16
created

PartNode   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 3
c 2
b 0
f 0
dl 0
loc 32
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 8 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, in_scope, out_scope
0 ignored issues
show
Unused Code introduced by
Unused out_scope imported from sdoc.sdoc2
Loading history...
Unused Code introduced by
Unused in_scope imported from sdoc.sdoc2
Loading history...
10
from sdoc.sdoc2.node.HeadingNode import HeadingNode
11
12
13
class PartNode(HeadingNode):
14
    """
15
    SDoc2 node for parts.
16
    """
17
18
    # ------------------------------------------------------------------------------------------------------------------
19
    def __init__(self, options, argument):
20
        """
21
        PartNode constructor
22
23
        :param dict[str, str] options: The options of this part.
24
        :param str argument: The title of this part.
25
        """
26
        super().__init__('part', options, argument)
27
28
    # ------------------------------------------------------------------------------------------------------------------
29
    def get_command(self):
30
        """
31
        Returns command of this node (i.e. 'part').
32
33
        :rtype: str
34
        """
35
        return 'part'
36
37
    # ------------------------------------------------------------------------------------------------------------------
38
    def get_hierarchy_level(self, parent_hierarchy_level=-1):
39
        """
40
        Returns 0.
41
42
        :rtype: int
43
        """
44
        return 0
45
46
# ----------------------------------------------------------------------------------------------------------------------
47
node_store.register_inline_command('part', PartNode)
48