Completed
Pull Request — master (#17)
by
unknown
01:20
created

sdoc.sdoc2.node.LabelNode.get_command()   A

Complexity

Conditions 1

Size

Total Lines 7

Duplication

Lines 0
Ratio 0 %
Metric Value
cc 1
dl 0
loc 7
rs 9.4285
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.Node import Node
11
12
13
class LabelNode(Node):
14
    """
15
    SDoc2 node for labels.
16
    """
17
18
    # ------------------------------------------------------------------------------------------------------------------
19
    def __init__(self, options, argument):
20
        """
21
        Object constructor.
22
23
        :param dict[str,str] options: The options of this label.
24
        :param str argument: The title of this label.
25
        """
26
        super().__init__('label', options, argument)
27
28
    # ------------------------------------------------------------------------------------------------------------------
29
    def get_command(self):
30
        """
31
        Returns the command of this node, i.e. label.
32
33
        :rtype: str
34
        """
35
        return 'label'
36
37
    # ------------------------------------------------------------------------------------------------------------------
38
    def is_block_command(self):
39
        """
40
        Returns False.
41
42
        :rtype: bool
43
        """
44
        return False
45
46
    # ------------------------------------------------------------------------------------------------------------------
47
    def is_inline_command(self):
48
        """
49
        Returns True.
50
51
        :rtype: bool
52
        """
53
        return True
54
55
# ----------------------------------------------------------------------------------------------------------------------
56
node_store.register_inline_command('label', LabelNode)
57