Passed
Branch master (0442a2)
by P.R.
02:00
created

UnknownNode.is_inline_command()   A

Complexity

Conditions 1

Size

Total Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 7
rs 9.4285
cc 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.Node import Node
11
12
13
class UnknownNode(Node):
14
    """
15
    SDoc2 node for development testing.
16
    """
17
    # ------------------------------------------------------------------------------------------------------------------
18
    def __init__(self, options, argument=''):
19
        """
20
        Object constructor.
21
22
        :param dict[str,str] options: The options of this smile.
23
        :param str argument: Not used.
24
        """
25
        super().__init__('unknown', options, argument)
26
27
    # ------------------------------------------------------------------------------------------------------------------
28
    def get_command(self):
29
        """
30
        Returns the command of this node, i.e. unknown.
31
32
        :rtype: str
33
        """
34
        return 'unknown'
35
36
    # ------------------------------------------------------------------------------------------------------------------
37
    def is_block_command(self):
38
        """
39
        Returns False.
40
41
        :rtype: bool
42
        """
43
        return False
44
45
    # ------------------------------------------------------------------------------------------------------------------
46
    def is_inline_command(self):
47
        """
48
        Returns True.
49
50
        :rtype: bool
51
        """
52
        return False
53
54
    # ------------------------------------------------------------------------------------------------------------------
55
    def is_phrasing(self):
56
        """
57
        Returns True.
58
59
        :rtype: bool
60
        """
61
        return True
62
63
64
# ----------------------------------------------------------------------------------------------------------------------
65
node_store.register_block_command('unknown', UnknownNode)
66
node_store.register_inline_command('unknown', UnknownNode)
67