示例#1
0
Registry.load_default_settings()
s  = Registry.getSchema('org.pybliographer/bibtex/0.1')
db = Store.get('memory').dbcreate(None, s)

style = u'This has key ' + B[one('id')]
formatter = style(db)

# tests begin here
oo = OOo()
oo.connect()

oo.text.setString(u'')

refs = [(1, 'a', 'bibtex-a'),
        (2, 'b', 'bibtex-b')]
oo.cite(refs, None)

# check that the citations have been inserted in the document
r = oo.text.getString()
assert r == u'[a][b]', repr(r)

# check that the document can return the existing citations
r = oo.fetch()
assert r == refs, repr(r)

# create the bibliography
insert = oo.update_biblio()
insert.begin_biblio()
for uid, key, extra in refs:
    insert.begin_reference(key)
    r = Store.Record()