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

UnknownNode   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 49
Duplicated Lines 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 5
c 2
b 0
f 0
dl 0
loc 49
rs 10

5 Methods

Rating   Name   Duplication   Size   Complexity  
A is_block_command() 0 7 1
A is_phrasing() 0 7 1
A __init__() 0 8 1
A is_inline_command() 0 7 1
A get_command() 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.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