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 EndParagraphNode(Node): |
|
|
|
|
14
|
|
|
""" |
15
|
|
|
SDoc2 node for end of paragraphs. |
16
|
|
|
|
17
|
|
|
Note: End of paragraphs will are temporary used during the content tree preparation. Before and after the content |
18
|
|
|
preparation end of paragraph nodes do not exist. |
19
|
|
|
""" |
20
|
|
|
# ------------------------------------------------------------------------------------------------------------------ |
21
|
|
|
def __init__(self, options, argument): |
22
|
|
|
""" |
23
|
|
|
Object constructor. |
24
|
|
|
|
25
|
|
|
:param dict[str,str] options: Not used. |
26
|
|
|
:param str argument: Not used. |
27
|
|
|
""" |
28
|
|
|
super().__init__('end_paragraph', options, argument) |
29
|
|
|
|
30
|
|
|
# ------------------------------------------------------------------------------------------------------------------ |
31
|
|
|
def get_command(self): |
32
|
|
|
""" |
33
|
|
|
Returns the command of this node, i.e. end_paragraph. |
34
|
|
|
|
35
|
|
|
:rtype: str |
36
|
|
|
""" |
37
|
|
|
return 'end_paragraph' |
38
|
|
|
|
39
|
|
|
# ------------------------------------------------------------------------------------------------------------------ |
40
|
|
|
def is_block_command(self): |
41
|
|
|
""" |
42
|
|
|
Returns False. |
43
|
|
|
|
44
|
|
|
:rtype: bool |
45
|
|
|
""" |
46
|
|
|
return False |
47
|
|
|
|
48
|
|
|
# ------------------------------------------------------------------------------------------------------------------ |
49
|
|
|
def is_inline_command(self): |
50
|
|
|
""" |
51
|
|
|
Returns False. |
52
|
|
|
|
53
|
|
|
:rtype: bool |
54
|
|
|
""" |
55
|
|
|
return False |
56
|
|
|
|
57
|
|
|
# ------------------------------------------------------------------------------------------------------------------ |
58
|
|
|
def prepare_content_tree(self): |
59
|
|
|
""" |
60
|
|
|
Not implemented for end paragraph nodes. |
61
|
|
|
""" |
62
|
|
|
raise NotImplementedError() |
63
|
|
|
|
64
|
|
|
# ---------------------------------------------------------------------------------------------------------------------- |
65
|
|
|
node_store.register_inline_command('end_paragraph', EndParagraphNode) |
66
|
|
|
|