1 | 1 | from typing import Dict |
|
2 | |||
3 | 1 | from cleo.io.io import IO |
|
4 | |||
5 | 1 | from sdoc.sdoc2.node.Node import Node |
|
6 | 1 | from sdoc.sdoc2.NodeStore import NodeStore |
|
7 | |||
8 | |||
9 | 1 | View Code Duplication | class EndParagraphNode(Node): |
0 ignored issues
–
show
Duplication
introduced
by
![]() |
|||
10 | """ |
||
11 | SDoc2 node for end of paragraphs. |
||
12 | |||
13 | Note: End of paragraphs will are temporary used during the content tree preparation. Before and after the content |
||
14 | preparation end of paragraph nodes do not exist. |
||
15 | """ |
||
16 | |||
17 | # ------------------------------------------------------------------------------------------------------------------ |
||
18 | 1 | def __init__(self, io: IO, options: Dict[str, str], argument: str): |
|
19 | """ |
||
20 | Object constructor. |
||
21 | |||
22 | :param OutputStyle io: The IO object. |
||
23 | :param dict[str,str] options: Not used. |
||
24 | :param str argument: Not used. |
||
25 | """ |
||
26 | 1 | super().__init__(io, 'end_paragraph', options, argument) |
|
27 | |||
28 | # ------------------------------------------------------------------------------------------------------------------ |
||
29 | 1 | def get_command(self) -> str: |
|
30 | """ |
||
31 | Returns the command of this node, i.e. end_paragraph. |
||
32 | |||
33 | :rtype: str |
||
34 | """ |
||
35 | 1 | return 'end_paragraph' |
|
36 | |||
37 | # ------------------------------------------------------------------------------------------------------------------ |
||
38 | 1 | def is_block_command(self) -> bool: |
|
39 | """ |
||
40 | Returns False. |
||
41 | """ |
||
42 | return False |
||
43 | |||
44 | # ------------------------------------------------------------------------------------------------------------------ |
||
45 | 1 | def is_inline_command(self) -> bool: |
|
46 | """ |
||
47 | Returns False. |
||
48 | """ |
||
49 | return False |
||
50 | |||
51 | # ------------------------------------------------------------------------------------------------------------------ |
||
52 | 1 | def prepare_content_tree(self) -> None: |
|
53 | """ |
||
54 | Not implemented for end paragraph nodes. |
||
55 | """ |
||
56 | raise RuntimeError() |
||
57 | |||
58 | |||
59 | # ---------------------------------------------------------------------------------------------------------------------- |
||
60 | NodeStore.register_inline_command('end_paragraph', EndParagraphNode) |
||
61 |