pyxllib 0.0.43__py3-none-any.whl → 0.3.197__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- pyxllib/__init__.py +9 -2
- pyxllib/algo/__init__.py +8 -0
- pyxllib/algo/disjoint.py +54 -0
- pyxllib/algo/geo.py +541 -0
- pyxllib/{util/mathlib.py → algo/intervals.py} +172 -36
- pyxllib/algo/matcher.py +389 -0
- pyxllib/algo/newbie.py +166 -0
- pyxllib/algo/pupil.py +629 -0
- pyxllib/algo/shapelylib.py +67 -0
- pyxllib/algo/specialist.py +241 -0
- pyxllib/algo/stat.py +494 -0
- pyxllib/algo/treelib.py +149 -0
- pyxllib/algo/unitlib.py +66 -0
- pyxllib/autogui/__init__.py +5 -0
- pyxllib/autogui/activewin.py +246 -0
- pyxllib/autogui/all.py +9 -0
- pyxllib/autogui/autogui.py +852 -0
- pyxllib/autogui/uiautolib.py +362 -0
- pyxllib/autogui/virtualkey.py +102 -0
- pyxllib/autogui/wechat.py +827 -0
- pyxllib/autogui/wechat_msg.py +421 -0
- pyxllib/autogui/wxautolib.py +84 -0
- pyxllib/cv/__init__.py +1 -11
- pyxllib/cv/expert.py +267 -0
- pyxllib/cv/{imlib.py → imfile.py} +18 -83
- pyxllib/cv/imhash.py +39 -0
- pyxllib/cv/pupil.py +9 -0
- pyxllib/cv/rgbfmt.py +1525 -0
- pyxllib/cv/slidercaptcha.py +137 -0
- pyxllib/cv/trackbartools.py +163 -49
- pyxllib/cv/xlcvlib.py +1040 -0
- pyxllib/cv/xlpillib.py +423 -0
- pyxllib/data/__init__.py +0 -0
- pyxllib/data/echarts.py +240 -0
- pyxllib/data/jsonlib.py +89 -0
- pyxllib/{util/oss2_.py → data/oss.py} +11 -9
- pyxllib/data/pglib.py +1127 -0
- pyxllib/data/sqlite.py +568 -0
- pyxllib/{util → data}/sqllib.py +13 -31
- pyxllib/ext/JLineViewer.py +505 -0
- pyxllib/ext/__init__.py +6 -0
- pyxllib/{util → ext}/demolib.py +119 -35
- pyxllib/ext/drissionlib.py +277 -0
- pyxllib/ext/kq5034lib.py +12 -0
- pyxllib/{util/main.py → ext/old.py} +122 -284
- pyxllib/ext/qt.py +449 -0
- pyxllib/ext/robustprocfile.py +497 -0
- pyxllib/ext/seleniumlib.py +76 -0
- pyxllib/{util/tklib.py → ext/tk.py} +10 -11
- pyxllib/ext/unixlib.py +827 -0
- pyxllib/ext/utools.py +351 -0
- pyxllib/{util/webhooklib.py → ext/webhook.py} +45 -17
- pyxllib/ext/win32lib.py +40 -0
- pyxllib/ext/wjxlib.py +88 -0
- pyxllib/ext/wpsapi.py +124 -0
- pyxllib/ext/xlwork.py +9 -0
- pyxllib/ext/yuquelib.py +1105 -0
- pyxllib/file/__init__.py +17 -0
- pyxllib/file/docxlib.py +761 -0
- pyxllib/{util → file}/gitlib.py +40 -27
- pyxllib/file/libreoffice.py +165 -0
- pyxllib/file/movielib.py +148 -0
- pyxllib/file/newbie.py +10 -0
- pyxllib/file/onenotelib.py +1469 -0
- pyxllib/file/packlib/__init__.py +330 -0
- pyxllib/{util → file/packlib}/zipfile.py +598 -195
- pyxllib/file/pdflib.py +426 -0
- pyxllib/file/pupil.py +185 -0
- pyxllib/file/specialist/__init__.py +685 -0
- pyxllib/{basic/_5_dirlib.py → file/specialist/dirlib.py} +364 -93
- pyxllib/file/specialist/download.py +193 -0
- pyxllib/file/specialist/filelib.py +2829 -0
- pyxllib/file/xlsxlib.py +3131 -0
- pyxllib/file/xlsyncfile.py +341 -0
- pyxllib/prog/__init__.py +5 -0
- pyxllib/prog/cachetools.py +64 -0
- pyxllib/prog/deprecatedlib.py +233 -0
- pyxllib/prog/filelock.py +42 -0
- pyxllib/prog/ipyexec.py +253 -0
- pyxllib/prog/multiprogs.py +940 -0
- pyxllib/prog/newbie.py +451 -0
- pyxllib/prog/pupil.py +1197 -0
- pyxllib/{sitepackages.py → prog/sitepackages.py} +5 -3
- pyxllib/prog/specialist/__init__.py +391 -0
- pyxllib/prog/specialist/bc.py +203 -0
- pyxllib/prog/specialist/browser.py +497 -0
- pyxllib/prog/specialist/common.py +347 -0
- pyxllib/prog/specialist/datetime.py +199 -0
- pyxllib/prog/specialist/tictoc.py +240 -0
- pyxllib/prog/specialist/xllog.py +180 -0
- pyxllib/prog/xlosenv.py +108 -0
- pyxllib/stdlib/__init__.py +17 -0
- pyxllib/{util → stdlib}/tablepyxl/__init__.py +1 -3
- pyxllib/{util → stdlib}/tablepyxl/style.py +1 -1
- pyxllib/{util → stdlib}/tablepyxl/tablepyxl.py +2 -4
- pyxllib/text/__init__.py +8 -0
- pyxllib/text/ahocorasick.py +39 -0
- pyxllib/text/airscript.js +744 -0
- pyxllib/text/charclasslib.py +121 -0
- pyxllib/text/jiebalib.py +267 -0
- pyxllib/text/jinjalib.py +32 -0
- pyxllib/text/jsa_ai_prompt.md +271 -0
- pyxllib/text/jscode.py +922 -0
- pyxllib/text/latex/__init__.py +158 -0
- pyxllib/text/levenshtein.py +303 -0
- pyxllib/text/nestenv.py +1215 -0
- pyxllib/text/newbie.py +300 -0
- pyxllib/text/pupil/__init__.py +8 -0
- pyxllib/text/pupil/common.py +1121 -0
- pyxllib/text/pupil/xlalign.py +326 -0
- pyxllib/text/pycode.py +47 -0
- pyxllib/text/specialist/__init__.py +8 -0
- pyxllib/text/specialist/common.py +112 -0
- pyxllib/text/specialist/ptag.py +186 -0
- pyxllib/text/spellchecker.py +172 -0
- pyxllib/text/templates/echart_base.html +11 -0
- pyxllib/text/templates/highlight_code.html +17 -0
- pyxllib/text/templates/latex_editor.html +103 -0
- pyxllib/text/vbacode.py +17 -0
- pyxllib/text/xmllib.py +747 -0
- pyxllib/xl.py +39 -0
- pyxllib/xlcv.py +17 -0
- pyxllib-0.3.197.dist-info/METADATA +48 -0
- pyxllib-0.3.197.dist-info/RECORD +126 -0
- {pyxllib-0.0.43.dist-info → pyxllib-0.3.197.dist-info}/WHEEL +4 -5
- pyxllib/basic/_1_strlib.py +0 -945
- pyxllib/basic/_2_timelib.py +0 -488
- pyxllib/basic/_3_pathlib.py +0 -916
- pyxllib/basic/_4_loglib.py +0 -419
- pyxllib/basic/__init__.py +0 -54
- pyxllib/basic/arrow_.py +0 -250
- pyxllib/basic/chardet_.py +0 -66
- pyxllib/basic/dirlib.py +0 -529
- pyxllib/basic/dprint.py +0 -202
- pyxllib/basic/extension.py +0 -12
- pyxllib/basic/judge.py +0 -31
- pyxllib/basic/log.py +0 -204
- pyxllib/basic/pathlib_.py +0 -705
- pyxllib/basic/pytictoc.py +0 -102
- pyxllib/basic/qiniu_.py +0 -61
- pyxllib/basic/strlib.py +0 -761
- pyxllib/basic/timer.py +0 -132
- pyxllib/cv/cv.py +0 -834
- pyxllib/cv/cvlib/_1_geo.py +0 -543
- pyxllib/cv/cvlib/_2_cvprcs.py +0 -309
- pyxllib/cv/cvlib/_2_imgproc.py +0 -594
- pyxllib/cv/cvlib/_3_pilprcs.py +0 -80
- pyxllib/cv/cvlib/_4_cvimg.py +0 -211
- pyxllib/cv/cvlib/__init__.py +0 -10
- pyxllib/cv/debugtools.py +0 -82
- pyxllib/cv/fitz_.py +0 -300
- pyxllib/cv/installer.py +0 -42
- pyxllib/debug/_0_installer.py +0 -38
- pyxllib/debug/_1_typelib.py +0 -277
- pyxllib/debug/_2_chrome.py +0 -198
- pyxllib/debug/_3_showdir.py +0 -161
- pyxllib/debug/_4_bcompare.py +0 -140
- pyxllib/debug/__init__.py +0 -49
- pyxllib/debug/bcompare.py +0 -132
- pyxllib/debug/chrome.py +0 -198
- pyxllib/debug/installer.py +0 -38
- pyxllib/debug/showdir.py +0 -158
- pyxllib/debug/typelib.py +0 -278
- pyxllib/image/__init__.py +0 -12
- pyxllib/torch/__init__.py +0 -20
- pyxllib/torch/modellib.py +0 -37
- pyxllib/torch/trainlib.py +0 -344
- pyxllib/util/__init__.py +0 -20
- pyxllib/util/aip_.py +0 -141
- pyxllib/util/casiadb.py +0 -59
- pyxllib/util/excellib.py +0 -495
- pyxllib/util/filelib.py +0 -612
- pyxllib/util/jsondata.py +0 -27
- pyxllib/util/jsondata2.py +0 -92
- pyxllib/util/labelmelib.py +0 -139
- pyxllib/util/onepy/__init__.py +0 -29
- pyxllib/util/onepy/onepy.py +0 -574
- pyxllib/util/onepy/onmanager.py +0 -170
- pyxllib/util/pyautogui_.py +0 -219
- pyxllib/util/textlib.py +0 -1305
- pyxllib/util/unorder.py +0 -22
- pyxllib/util/xmllib.py +0 -639
- pyxllib-0.0.43.dist-info/METADATA +0 -39
- pyxllib-0.0.43.dist-info/RECORD +0 -80
- pyxllib-0.0.43.dist-info/top_level.txt +0 -1
- {pyxllib-0.0.43.dist-info → pyxllib-0.3.197.dist-info/licenses}/LICENSE +0 -0
pyxllib/util/onepy/onepy.py
DELETED
@@ -1,574 +0,0 @@
|
|
1
|
-
from .onmanager import ONProcess
|
2
|
-
from xml.etree import ElementTree
|
3
|
-
|
4
|
-
namespace = ""
|
5
|
-
|
6
|
-
|
7
|
-
class OneNote:
|
8
|
-
|
9
|
-
def __init__(self):
|
10
|
-
self.process = ONProcess()
|
11
|
-
global namespace
|
12
|
-
namespace = self.process.namespace
|
13
|
-
self.xml = self.process.get_hierarchy("", 4)
|
14
|
-
self.object_tree = ElementTree.fromstring(self.xml)
|
15
|
-
self.hierarchy = Hierarchy(self.object_tree)
|
16
|
-
|
17
|
-
def get_page_content(self, page_id):
|
18
|
-
page_content_xml = ElementTree.fromstring(self.process.get_page_content(page_id))
|
19
|
-
return PageContent(page_content_xml)
|
20
|
-
# return page_content_xml
|
21
|
-
|
22
|
-
def names(self):
|
23
|
-
"""所有笔记本的名称"""
|
24
|
-
ls = list(map(lambda x: x.name, self.hierarchy))
|
25
|
-
return ls
|
26
|
-
|
27
|
-
def nicknames(self):
|
28
|
-
"""所有笔记本的昵称"""
|
29
|
-
ls = list(map(lambda x: x.nickname, self.hierarchy))
|
30
|
-
return ls
|
31
|
-
|
32
|
-
def __getitem__(self, item):
|
33
|
-
"""通过编号或名称索引获得笔记本"""
|
34
|
-
return self.hierarchy[item]
|
35
|
-
|
36
|
-
|
37
|
-
class Hierarchy:
|
38
|
-
|
39
|
-
def __init__(self, xml=None):
|
40
|
-
self.xml = xml
|
41
|
-
self._children = []
|
42
|
-
if xml is not None:
|
43
|
-
self.__deserialize_from_xml(xml)
|
44
|
-
|
45
|
-
def __deserialize_from_xml(self, xml):
|
46
|
-
self._children = [Notebook(n) for n in xml]
|
47
|
-
|
48
|
-
def __iter__(self):
|
49
|
-
for c in self._children:
|
50
|
-
yield c
|
51
|
-
|
52
|
-
def __getitem__(self, item):
|
53
|
-
"""通过编号或名称索引子节点内容"""
|
54
|
-
if isinstance(item, int):
|
55
|
-
return self._children[item]
|
56
|
-
elif isinstance(item, str):
|
57
|
-
for nb in self:
|
58
|
-
if nb.nickname == item:
|
59
|
-
return nb
|
60
|
-
return None
|
61
|
-
|
62
|
-
|
63
|
-
class HierarchyNode:
|
64
|
-
|
65
|
-
def __init__(self, parent=None):
|
66
|
-
self.name = ""
|
67
|
-
self.path = ""
|
68
|
-
self.id = ""
|
69
|
-
self.last_modified_time = ""
|
70
|
-
self.synchronized = ""
|
71
|
-
|
72
|
-
def deserialize_from_xml(self, xml):
|
73
|
-
self.name = xml.get("name")
|
74
|
-
self.path = xml.get("path")
|
75
|
-
self.id = xml.get("ID")
|
76
|
-
self.last_modified_time = xml.get("lastModifiedTime")
|
77
|
-
|
78
|
-
|
79
|
-
class Notebook(HierarchyNode):
|
80
|
-
|
81
|
-
def __init__(self, xml=None):
|
82
|
-
self.xml = xml
|
83
|
-
super().__init__(self)
|
84
|
-
self.nickname = ""
|
85
|
-
self.color = ""
|
86
|
-
self.is_currently_viewed = ""
|
87
|
-
self.recycleBin = None
|
88
|
-
self._children = []
|
89
|
-
if xml is not None:
|
90
|
-
self.__deserialize_from_xml(xml)
|
91
|
-
|
92
|
-
def __deserialize_from_xml(self, xml):
|
93
|
-
HierarchyNode.deserialize_from_xml(self, xml)
|
94
|
-
self.nickname = xml.get("nickname")
|
95
|
-
self.color = xml.get("color")
|
96
|
-
self.is_currently_viewed = xml.get("isCurrentlyViewed")
|
97
|
-
self.recycleBin = None
|
98
|
-
for node in xml:
|
99
|
-
if node.tag == namespace + "Section":
|
100
|
-
self._children.append(Section(node, self))
|
101
|
-
|
102
|
-
elif node.tag == namespace + "SectionGroup":
|
103
|
-
if node.get("isRecycleBin"):
|
104
|
-
self.recycleBin = SectionGroup(node, self)
|
105
|
-
else:
|
106
|
-
self._children.append(SectionGroup(node, self))
|
107
|
-
|
108
|
-
def __iter__(self):
|
109
|
-
for c in self._children:
|
110
|
-
yield c
|
111
|
-
|
112
|
-
def __str__(self):
|
113
|
-
return self.name
|
114
|
-
|
115
|
-
def __getitem__(self, item):
|
116
|
-
"""通过编号或名称索引子节点内容"""
|
117
|
-
if isinstance(item, int):
|
118
|
-
return self._children[item]
|
119
|
-
elif isinstance(item, str):
|
120
|
-
for nb in self:
|
121
|
-
if nb.name == item:
|
122
|
-
return nb
|
123
|
-
return None
|
124
|
-
|
125
|
-
|
126
|
-
class SectionGroup(HierarchyNode):
|
127
|
-
|
128
|
-
def __init__(self, xml=None, parent_node=None):
|
129
|
-
self.xml = xml
|
130
|
-
super().__init__(self)
|
131
|
-
self.is_recycle_Bin = False
|
132
|
-
self._children = []
|
133
|
-
self.parent = parent_node
|
134
|
-
if xml is not None:
|
135
|
-
self.__deserialize_from_xml(xml)
|
136
|
-
|
137
|
-
def __iter__(self):
|
138
|
-
for c in self._children:
|
139
|
-
yield c
|
140
|
-
|
141
|
-
def __str__(self):
|
142
|
-
return self.name
|
143
|
-
|
144
|
-
def __deserialize_from_xml(self, xml):
|
145
|
-
HierarchyNode.deserialize_from_xml(self, xml)
|
146
|
-
self.is_recycle_Bin = xml.get("isRecycleBin")
|
147
|
-
for node in xml:
|
148
|
-
if node.tag == namespace + "SectionGroup":
|
149
|
-
self._children.append(SectionGroup(node, self))
|
150
|
-
if node.tag == namespace + "Section":
|
151
|
-
self._children.append(Section(node, self))
|
152
|
-
|
153
|
-
def __getitem__(self, item):
|
154
|
-
"""通过编号或名称索引子节点内容"""
|
155
|
-
if isinstance(item, int):
|
156
|
-
return self._children[item]
|
157
|
-
elif isinstance(item, str):
|
158
|
-
for nb in self:
|
159
|
-
if nb.name == item:
|
160
|
-
return nb
|
161
|
-
return None
|
162
|
-
|
163
|
-
|
164
|
-
class Section(HierarchyNode):
|
165
|
-
|
166
|
-
def __init__(self, xml=None, parent_node=None):
|
167
|
-
self.xml = xml
|
168
|
-
super().__init__(self)
|
169
|
-
self.color = ""
|
170
|
-
self.read_only = False
|
171
|
-
self.is_currently_viewed = False
|
172
|
-
self._children = []
|
173
|
-
self.parent = parent_node
|
174
|
-
if xml is not None:
|
175
|
-
self.__deserialize_from_xml(xml)
|
176
|
-
|
177
|
-
def __iter__(self):
|
178
|
-
for c in self._children:
|
179
|
-
yield c
|
180
|
-
|
181
|
-
def __str__(self):
|
182
|
-
return self.name
|
183
|
-
|
184
|
-
def __deserialize_from_xml(self, xml):
|
185
|
-
HierarchyNode.deserialize_from_xml(self, xml)
|
186
|
-
self.color = xml.get("color")
|
187
|
-
try:
|
188
|
-
self.read_only = xml.get("readOnly")
|
189
|
-
except Exception as e:
|
190
|
-
self.read_only = False
|
191
|
-
try:
|
192
|
-
self.is_currently_viewed = xml.get("isCurrentlyViewed")
|
193
|
-
except Exception as e:
|
194
|
-
self.is_currently_viewed = False
|
195
|
-
|
196
|
-
self._children = [Page(node, self) for node in xml]
|
197
|
-
|
198
|
-
def __getitem__(self, item):
|
199
|
-
"""通过编号或名称索引子节点内容"""
|
200
|
-
if isinstance(item, int):
|
201
|
-
return self._children[item]
|
202
|
-
elif isinstance(item, str):
|
203
|
-
for nb in self:
|
204
|
-
if nb.name == item:
|
205
|
-
return nb
|
206
|
-
return None
|
207
|
-
|
208
|
-
|
209
|
-
class Page:
|
210
|
-
|
211
|
-
def __init__(self, xml=None, parent_node=None):
|
212
|
-
self.xml = xml
|
213
|
-
self.name = ""
|
214
|
-
self.id = ""
|
215
|
-
self.date_time = ""
|
216
|
-
self.last_modified_time = ""
|
217
|
-
self.page_level = ""
|
218
|
-
self.is_currently_viewed = ""
|
219
|
-
self._children = []
|
220
|
-
self.parent = parent_node
|
221
|
-
if xml is not None: # != None is required here, since this can return false
|
222
|
-
self.__deserialize_from_xml(xml)
|
223
|
-
|
224
|
-
def __iter__(self):
|
225
|
-
for c in self._children:
|
226
|
-
yield c
|
227
|
-
|
228
|
-
def __str__(self):
|
229
|
-
return self.name
|
230
|
-
|
231
|
-
# Get / Set Meta
|
232
|
-
|
233
|
-
def __deserialize_from_xml(self, xml):
|
234
|
-
self.xml = xml
|
235
|
-
self.name = xml.get("name")
|
236
|
-
self.id = xml.get("ID")
|
237
|
-
self.date_time = xml.get("dateTime")
|
238
|
-
self.last_modified_time = xml.get("lastModifiedTime")
|
239
|
-
self.page_level = xml.get("pageLevel")
|
240
|
-
self.is_currently_viewed = xml.get("isCurrentlyViewed")
|
241
|
-
self._children = [Meta(node) for node in xml]
|
242
|
-
|
243
|
-
def getxml(self):
|
244
|
-
"""获得页面的"""
|
245
|
-
return ONProcess().get_page_content(self.id)
|
246
|
-
|
247
|
-
|
248
|
-
class Meta:
|
249
|
-
|
250
|
-
def __init__(self, xml=None):
|
251
|
-
self.xml = xml
|
252
|
-
self.name = ""
|
253
|
-
self.content = ""
|
254
|
-
if xml is not None:
|
255
|
-
self.__deserialize_from_xml(xml)
|
256
|
-
|
257
|
-
def __str__(self):
|
258
|
-
return self.name
|
259
|
-
|
260
|
-
def __deserialize_from_xml(self, xml):
|
261
|
-
self.name = xml.get("name")
|
262
|
-
self.id = xml.get("content")
|
263
|
-
|
264
|
-
def getxml(self):
|
265
|
-
"""获得页面的"""
|
266
|
-
return ONProcess().get_page_content(self.id)
|
267
|
-
|
268
|
-
|
269
|
-
class PageContent:
|
270
|
-
|
271
|
-
def __init__(self, xml=None):
|
272
|
-
self.xml = xml
|
273
|
-
self.name = ""
|
274
|
-
self.id = ""
|
275
|
-
self.date_time = ""
|
276
|
-
self.last_modified_time = ""
|
277
|
-
self.page_level = ""
|
278
|
-
self.lang = ""
|
279
|
-
self.is_currently_viewed = ""
|
280
|
-
self._children = []
|
281
|
-
self.files = []
|
282
|
-
if xml is not None:
|
283
|
-
self.__deserialize_from_xml(xml)
|
284
|
-
|
285
|
-
def __iter__(self):
|
286
|
-
for c in self._children:
|
287
|
-
yield c
|
288
|
-
|
289
|
-
def __str__(self):
|
290
|
-
return self.name
|
291
|
-
|
292
|
-
def __deserialize_from_xml(self, xml):
|
293
|
-
self.name = xml.get("name")
|
294
|
-
self.id = xml.get("ID")
|
295
|
-
self.date_time = xml.get("dateTime")
|
296
|
-
self.last_modified_time = xml.get("lastModifiedTime")
|
297
|
-
self.page_level = xml.get("pageLevel")
|
298
|
-
self.lang = xml.get("lang")
|
299
|
-
self.is_currently_viewed = xml.get("isCurrentlyViewed")
|
300
|
-
for node in xml:
|
301
|
-
if node.tag == namespace + "Outline":
|
302
|
-
self._children.append(Outline(node))
|
303
|
-
elif node.tag == namespace + "Ink":
|
304
|
-
self.files.append(Ink(node))
|
305
|
-
elif node.tag == namespace + "Image":
|
306
|
-
self.files.append(Image(node))
|
307
|
-
elif node.tag == namespace + "InsertedFile":
|
308
|
-
self.files.append(InsertedFile(node))
|
309
|
-
elif node.tag == namespace + "Title":
|
310
|
-
self._children.append(Title(node))
|
311
|
-
|
312
|
-
|
313
|
-
class Title:
|
314
|
-
|
315
|
-
def __init__(self, xml=None):
|
316
|
-
self.xml = xml
|
317
|
-
self.style = ""
|
318
|
-
self.lang = ""
|
319
|
-
self._children = []
|
320
|
-
if xml is not None:
|
321
|
-
self.__deserialize_from_xml(xml)
|
322
|
-
|
323
|
-
def __str__(self):
|
324
|
-
return "Page Title"
|
325
|
-
|
326
|
-
def __iter__(self):
|
327
|
-
for c in self._children:
|
328
|
-
yield c
|
329
|
-
|
330
|
-
def __deserialize_from_xml(self, xml):
|
331
|
-
self.style = xml.get("style")
|
332
|
-
self.lang = xml.get("lang")
|
333
|
-
for node in xml:
|
334
|
-
if node.tag == namespace + "OE":
|
335
|
-
self._children.append(OE(node, self))
|
336
|
-
|
337
|
-
|
338
|
-
class Outline:
|
339
|
-
|
340
|
-
def __init__(self, xml=None):
|
341
|
-
self.xml = xml
|
342
|
-
self.author = ""
|
343
|
-
self.author_initials = ""
|
344
|
-
self.last_modified_by = ""
|
345
|
-
self.last_modified_by_initials = ""
|
346
|
-
self.last_modified_time = ""
|
347
|
-
self.id = ""
|
348
|
-
self._children = []
|
349
|
-
if xml is not None:
|
350
|
-
self.__deserialize_from_xml(xml)
|
351
|
-
|
352
|
-
def __iter__(self):
|
353
|
-
for c in self._children:
|
354
|
-
yield c
|
355
|
-
|
356
|
-
def __str__(self):
|
357
|
-
return "Outline"
|
358
|
-
|
359
|
-
def __deserialize_from_xml(self, xml):
|
360
|
-
self.author = xml.get("author")
|
361
|
-
self.author_initials = xml.get("authorInitials")
|
362
|
-
self.last_modified_by = xml.get("lastModifiedBy")
|
363
|
-
self.last_modified_by_initials = xml.get("lastModifiedByInitials")
|
364
|
-
self.last_modified_time = xml.get("lastModifiedTime")
|
365
|
-
self.id = xml.get("objectID")
|
366
|
-
append = self._children.append
|
367
|
-
for node in xml:
|
368
|
-
if node.tag == namespace + "OEChildren":
|
369
|
-
for childNode in node:
|
370
|
-
if childNode.tag == namespace + "OE":
|
371
|
-
append(OE(childNode, self))
|
372
|
-
|
373
|
-
|
374
|
-
class Position:
|
375
|
-
|
376
|
-
def __init__(self, xml=None, parent_node=None):
|
377
|
-
self.xml = xml
|
378
|
-
self.x = ""
|
379
|
-
self.y = ""
|
380
|
-
self.z = ""
|
381
|
-
self.parent = parent_node
|
382
|
-
if xml is not None:
|
383
|
-
self.__deserialize_from_xml(xml)
|
384
|
-
|
385
|
-
def __deserialize_from_xml(self, xml):
|
386
|
-
self.x = xml.get("x")
|
387
|
-
self.y = xml.get("y")
|
388
|
-
self.z = xml.get("z")
|
389
|
-
|
390
|
-
|
391
|
-
class Size:
|
392
|
-
|
393
|
-
def __init__(self, xml=None, parent_node=None):
|
394
|
-
self.xml = xml
|
395
|
-
self.width = ""
|
396
|
-
self.height = ""
|
397
|
-
self.parent = parent_node
|
398
|
-
if xml is not None:
|
399
|
-
self.__deserialize_from_xml(xml)
|
400
|
-
|
401
|
-
def __deserialize_from_xml(self, xml):
|
402
|
-
self.width = xml.get("width")
|
403
|
-
self.height = xml.get("height")
|
404
|
-
|
405
|
-
|
406
|
-
class OE:
|
407
|
-
|
408
|
-
def __init__(self, xml=None, parent_node=None):
|
409
|
-
self.xml = xml
|
410
|
-
self.creation_time = ""
|
411
|
-
self.last_modified_time = ""
|
412
|
-
self.last_modified_by = ""
|
413
|
-
self.id = ""
|
414
|
-
self.alignment = ""
|
415
|
-
self.quick_style_index = ""
|
416
|
-
self.style = ""
|
417
|
-
self.text = ""
|
418
|
-
self._children = []
|
419
|
-
self.parent = parent_node
|
420
|
-
self.files = []
|
421
|
-
if xml is not None:
|
422
|
-
self.__deserialize_from_xml(xml)
|
423
|
-
|
424
|
-
def __iter__(self):
|
425
|
-
for c in self._children:
|
426
|
-
yield c
|
427
|
-
|
428
|
-
def __str__(self):
|
429
|
-
try:
|
430
|
-
return self.text
|
431
|
-
except AttributeError:
|
432
|
-
return "Empty OE"
|
433
|
-
|
434
|
-
def __deserialize_from_xml(self, xml):
|
435
|
-
self.creation_time = xml.get("creationTime")
|
436
|
-
self.last_modified_time = xml.get("lastModifiedTime")
|
437
|
-
self.last_modified_by = xml.get("lastModifiedBy")
|
438
|
-
self.id = xml.get("objectID")
|
439
|
-
self.alignment = xml.get("alignment")
|
440
|
-
self.quick_style_index = xml.get("quickStyleIndex")
|
441
|
-
self.style = xml.get("style")
|
442
|
-
|
443
|
-
for node in xml:
|
444
|
-
if node.tag == namespace + "T":
|
445
|
-
if node.text is not None:
|
446
|
-
self.text = node.text
|
447
|
-
else:
|
448
|
-
self.text = "NO TEXT"
|
449
|
-
|
450
|
-
elif node.tag == namespace + "OEChildren":
|
451
|
-
for childNode in node:
|
452
|
-
if childNode.tag == namespace + "OE":
|
453
|
-
self._children.append(OE(childNode, self))
|
454
|
-
|
455
|
-
elif node.tag == namespace + "Image":
|
456
|
-
self.files.append(Image(node, self))
|
457
|
-
|
458
|
-
elif node.tag == namespace + "InkWord":
|
459
|
-
self.files.append(Ink(node, self))
|
460
|
-
|
461
|
-
elif node.tag == namespace + "InsertedFile":
|
462
|
-
self.files.append(InsertedFile(node, self))
|
463
|
-
|
464
|
-
|
465
|
-
class InsertedFile:
|
466
|
-
|
467
|
-
# need to add position data to this class
|
468
|
-
|
469
|
-
def __init__(self, xml=None, parent_node=None):
|
470
|
-
self.xml = xml
|
471
|
-
self.path_cache = ""
|
472
|
-
self.path_source = ""
|
473
|
-
self.preferred_name = ""
|
474
|
-
self.last_modified_time = ""
|
475
|
-
self.last_modified_by = ""
|
476
|
-
self.id = ""
|
477
|
-
self.parent = parent_node
|
478
|
-
if xml is not None:
|
479
|
-
self.__deserialize_from_xml(xml)
|
480
|
-
|
481
|
-
def __iter__(self):
|
482
|
-
yield None
|
483
|
-
|
484
|
-
def __str__(self):
|
485
|
-
try:
|
486
|
-
return self.preferredName
|
487
|
-
except AttributeError:
|
488
|
-
return "Unnamed File"
|
489
|
-
|
490
|
-
def __deserialize_from_xml(self, xml):
|
491
|
-
self.path_cache = xml.get("pathCache")
|
492
|
-
self.path_source = xml.get("pathSource")
|
493
|
-
self.preferred_name = xml.get("preferredName")
|
494
|
-
self.last_modified_time = xml.get("lastModifiedTime")
|
495
|
-
self.last_modified_by = xml.get("lastModifiedBy")
|
496
|
-
self.id = xml.get("objectID")
|
497
|
-
|
498
|
-
|
499
|
-
class Ink:
|
500
|
-
|
501
|
-
# need to add position data to this class
|
502
|
-
|
503
|
-
def __init__(self, xml=None, parent_node=None):
|
504
|
-
self.xml = xml
|
505
|
-
self.recognized_text = ""
|
506
|
-
self.x = ""
|
507
|
-
self.y = ""
|
508
|
-
self.ink_origin_x = ""
|
509
|
-
self.ink_origin_y = ""
|
510
|
-
self.width = ""
|
511
|
-
self.height = ""
|
512
|
-
self.data = ""
|
513
|
-
self.callback_id = ""
|
514
|
-
self.parent = parent_node
|
515
|
-
|
516
|
-
if xml is not None:
|
517
|
-
self.__deserialize_from_xml(xml)
|
518
|
-
|
519
|
-
def __iter__(self):
|
520
|
-
yield None
|
521
|
-
|
522
|
-
def __str__(self):
|
523
|
-
try:
|
524
|
-
return self.recognizedText
|
525
|
-
except AttributeError:
|
526
|
-
return "Unrecognized Ink"
|
527
|
-
|
528
|
-
def __deserialize_from_xml(self, xml):
|
529
|
-
self.recognized_text = xml.get("recognizedText")
|
530
|
-
self.x = xml.get("x")
|
531
|
-
self.y = xml.get("y")
|
532
|
-
self.ink_origin_x = xml.get("inkOriginX")
|
533
|
-
self.ink_origin_y = xml.get("inkOriginY")
|
534
|
-
self.width = xml.get("width")
|
535
|
-
self.height = xml.get("height")
|
536
|
-
|
537
|
-
for node in xml:
|
538
|
-
if node.tag == namespace + "CallbackID":
|
539
|
-
self.callback_id = node.get("callbackID")
|
540
|
-
elif node.tag == namespace + "Data":
|
541
|
-
self.data = node.text
|
542
|
-
|
543
|
-
|
544
|
-
class Image:
|
545
|
-
|
546
|
-
def __init__(self, xml=None, parent_node=None):
|
547
|
-
self.xml = xml
|
548
|
-
self.format = ""
|
549
|
-
self.original_page_number = ""
|
550
|
-
self.last_modified_time = ""
|
551
|
-
self.id = ""
|
552
|
-
self.callback_id = None
|
553
|
-
self.data = ""
|
554
|
-
self.parent = parent_node
|
555
|
-
if xml is not None:
|
556
|
-
self.__deserialize_from_xml(xml)
|
557
|
-
|
558
|
-
def __iter__(self):
|
559
|
-
yield None
|
560
|
-
|
561
|
-
def __str__(self):
|
562
|
-
return self.format + " Image"
|
563
|
-
|
564
|
-
def __deserialize_from_xml(self, xml):
|
565
|
-
self.format = xml.get("format")
|
566
|
-
self.original_page_number = xml.get("originalPageNumber")
|
567
|
-
self.last_modified_time = xml.get("lastModifiedTime")
|
568
|
-
self.id = xml.get("objectID")
|
569
|
-
for node in xml:
|
570
|
-
if node.tag == namespace + "CallbackID":
|
571
|
-
self.callback_id = node.get("callbackID")
|
572
|
-
elif node.tag == namespace + "Data":
|
573
|
-
if node.text is not None:
|
574
|
-
self.data = node.text
|