Completed
Push — master ( 2f8739...45a29f )
by P.R.
02:09 queued 18s
created

PartNode.number()   A

Complexity

Conditions 2

Size

Total Lines 15

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 15
rs 9.4285
cc 2
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