From: Germán Poo-C. <gp...@gn...> - 2014-11-20 08:26:28
|
On Thu, 2014-11-20 at 04:22 +0000, Frédéric Gobry wrote: > > > > I think it is simpler than the old way. Besides this, instead of using > > PyString_FromString I would use PyUnicode_FromString, and provide > > unicode support from closer to the actual data. That would remove the > > need for encode/decode inside pybliographer in most of the code. > > Nice. This sounds fairly reasonable :) (bear in mind that I wrote that a > long time ago, with little experience in i18n) I just pushed a work-in-progress branch. It contains PyDoc, but I have not added any example nor checked test cases. However, I put a basic example in https://gist.github.com/gpoo/f615b856029d74ad3bfc I have not tested set_native and reverse (renamed to field_set_native and field_reverse), and I think they might need some tweak and validations. The main struct has some noise (3 dummy members) that I used them to play while learning about C Python. help(bibtex) / help(bibtex.BibtexParser) should give some clues of the API. > > In addition, there are some functions that are public in the current > > _bibtex, but I think those are too low level for what could be use. For > > example, get_offset and set_offset. > > Hmm, this is too far away for me to remember why I exposed them. I remove them from the branch, if they were required we can put them back. But I don't see them in pybliographer. -- Germán Poo-Caamaño http://calcifer.org/ |