Skip to content

Commit 058cb15

Browse files
authored
Fix tutorial demo (#269)
* closes #266 * fixed BibTeX entry and removed unnecessary temproary file
1 parent bab046f commit 058cb15

1 file changed

Lines changed: 53 additions & 0 deletions

File tree

docs/source/demo.py

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
import logging
2+
import logging.config
3+
import io
4+
5+
logger = logging.getLogger(__name__)
6+
7+
logging.config.dictConfig({
8+
'version': 1,
9+
'disable_existing_loggers': False,
10+
'formatters': {
11+
'standard': {
12+
'format': '%(asctime)s [%(levelname)s] %(name)s %(funcName)s:%(lineno)d: %(message)s'
13+
},
14+
},
15+
'handlers': {
16+
'default': {
17+
'level':'DEBUG',
18+
'formatter': 'standard',
19+
'class':'logging.StreamHandler',
20+
},
21+
},
22+
'loggers': {
23+
'': {
24+
'handlers': ['default'],
25+
'level': 'DEBUG',
26+
'formatter': 'standard',
27+
'propagate': True
28+
}
29+
}
30+
})
31+
32+
33+
if __name__ == '__main__':
34+
bibtex_source = """@ARTICLE{Cesar2013,
35+
author = {Jean César},
36+
title = {An amazing title},
37+
year = {2013},
38+
month = {1},
39+
volume = {12},
40+
pages = {12--23},
41+
journal = {Nice Journal},
42+
abstract = {This is an abstract. This line should be long enough to test
43+
multilines...},
44+
comments = {A comment},
45+
keywords = {keyword1, keyword2},
46+
}
47+
"""
48+
49+
from bibtexparser.bparser import BibTexParser
50+
51+
with io.StringIO(bibtex_source) as f:
52+
bp = BibTexParser(f.read())
53+
print(bp.get_entry_list())

0 commit comments

Comments
 (0)