forked from python-excel/xlrd
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpkg_doc.py
More file actions
31 lines (25 loc) · 695 Bytes
/
pkg_doc.py
File metadata and controls
31 lines (25 loc) · 695 Bytes
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
from pythondoc import ET, parse, CompactHTML
import sys
MODULE_NAME = "xlrd"
PATH_TO_FILES = sys.argv[1]
module = ET.Element("module", name=MODULE_NAME)
parts = [
'__init__',
'sheet',
'xldate',
# 'compdoc',
'biffh',
'formatting',
'formula',
]
flist = ["%s/%s.py" % (PATH_TO_FILES, p) for p in parts]
for fname in flist:
print "about to parse", fname
elem = parse(fname)
for elem in elem:
if module and elem.tag == "info":
# skip all module info sections except the first
continue
module.append(elem)
formatter = CompactHTML()
print formatter.save(module, MODULE_NAME), "ok"