-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathtest_pubs.py
More file actions
29 lines (24 loc) · 842 Bytes
/
test_pubs.py
File metadata and controls
29 lines (24 loc) · 842 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
#!/usr/bin/env python
### Test all bib files
### Requires installation of github.com/personalrobotics/prl-website
from personalrobotics.main.publications import RenderableEntry
import os
import sys
import pybtex.database
if __name__ == "__main__":
bibdir = os.path.dirname(os.path.realpath(__file__))
for filename in os.listdir(bibdir):
if not filename.endswith('.bib'):
continue
print("Checking Bib File: " + filename)
with open(os.path.join(bibdir, filename), 'r') as file:
try:
database = pybtex.database.parse_string(file.read(), "bibtex")
entries = [RenderableEntry("Publication", e) for e in database.entries.values()]
for entry in entries:
entry.__str__()
except Exception as e:
print(type(e))
print(e.args)
print(e)
sys.exit(-1)