forked from vadmium/python-altium
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdump.py
More file actions
23 lines (20 loc) · 618 Bytes
/
dump.py
File metadata and controls
23 lines (20 loc) · 618 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#! /usr/bin/env python3
import altium
from sys import argv
def main(file):
with open(file, "rb") as file:
file = altium.OleFileIO(file)
stream = file.openstream("FileHeader")
objects = altium.iter_records(stream)
for [i, o] in enumerate(objects):
o = altium.parse_properties(stream, o)
if not i:
i = "Header"
else:
i = format(i - 1)
print("{}: {}".format(i, o))
if __name__ == "__main__":
try:
main(*argv[1:])
except (KeyboardInterrupt, ConnectionError):
raise SystemExit(1)