-
-
Notifications
You must be signed in to change notification settings - Fork 426
/
Copy pathText.py
64 lines (52 loc) · 1.22 KB
/
Text.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
from typing import Optional
from pyDataExtraction.commonTypes.base import DataType
"""
interface Text {
kind: { text: true };
text: string;
mimeType?: string;
fileName?: string;
}
"""
class Text(DataType):
def __init__(
self,
text_data: str,
mimeType: Optional[str] = None,
fileName: Optional[str] = None,
):
super().__init__()
self.kind["text"] = True
self.text = text_data
if mimeType is None:
self.mimeType = mimeType
if fileName is None:
self.fileName = fileName
"""
interface Svg extends Text {
kind: { text: true; svg: true };
}
"""
class Svg(Text):
def __init__(
self,
text_data: str,
mimeType: Optional[str] = None,
fileName: Optional[str] = None,
):
self.kind["svg"] = True
super().__init__(text_data, mimeType, fileName)
"""
interface DotGraph extends Text {
kind: { text: true; dotGraph: true };
}
"""
class DotGraph(Text):
def __init__(
self,
text_data: str,
mimeType: Optional[str] = None,
fileName: Optional[str] = None,
):
self.kind["dotGraph"] = True
super().__init__(text_data, mimeType, fileName)