-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.py
59 lines (43 loc) · 1.49 KB
/
test.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
#!/usr/bin/python
import epub
import os
#test = epub.epubFile(os.path.join(os.path.dirname(__file__), "test_files/sample_file.epub"))
#test = epub.epubFile(os.path.join(os.path.dirname(__file__), "test_files/sample_file.epub"))
test = epub.epubFile(os.path.join(os.path.dirname(__file__), "test_files/arduino.epub"))
#get opf location test
#print test.info._getOPFLocation()
#contents test
#for item in test.info.contents:
# print item.info()
#contents test2
#print test.info.contents.opfIdDir
#print test.info.opf.contents.opfIdDir
#manifest test
#for item in test.info.opf.manifest:
# print item.info()
#spine test
#for item in test.info.opf.spine:
# print item.opfRelLoc
#random test 1
#item = test.info.opf.manifest[1]
#print item.info()
metadata = test.info.meta
#meta data test
#print(test.info.meta.data)
#meta data test2
#metadata.addDataTemplate("test", "test", None, None, metadata.UNIQUE | metadata.UNIQUE)
#meta data test3
#print metadata._testFlag(metadata.REQUIRED | metadata.TEXTVALUE | metadata.ATTRVALUE, metadata.REQUIRED)
#meta data test4
print(metadata.getMetaData("cover").opfRelLoc)
print(metadata.getMetaData("title"))
print(metadata.getMetaData("author"))
print(metadata.getMetaData("identifer"))
print(metadata.getMetaData("language"))
print(metadata.getMetaData("description"))
print(metadata.getMetaData("date"))
print(metadata.getMetaData("datepub"))
print(metadata.getMetaData("datemod"))
#id finder test
#test.info.findIDreferences("navPoint-6")
#test.info.findIDreferences()