christopher-ramirez / secretary

Take the power of Jinja2 templates to OpenOffice and LibreOffice.
Other
190 stars 48 forks source link

use lxml as xml parser #22

Closed giorgiogiustiniani closed 8 years ago

giorgiogiustiniani commented 8 years ago

Hi, I've used your library to work with odt templates. I've changed the xml library to boost performance,with lxml the time od xml processing is around 1/3

I've not changed all the implementation ( es markdown ) but only what I' needed,for substitution of placeholders,tables and images.

I send you the source,it works in production environment with thousand of requests

bijanebrahimi commented 8 years ago

You should add lxml module to projects dependencies in setup.py to pass the checks.

giorgiogiustiniani commented 8 years ago

there's no python sources for lxml

it's a .so library compiled on freeBsd from c sources do you need the c sources to compile or the .so linux freeBsd library?

Il 28.10.2015 16:16 bijan ha scritto:

You should add lxml module to projects dependencies in setup.py to pass [1] the checks.

Reply to this email directly or view it on GitHub [2].

Connetti gratis il mondo con la nuova indoona: hai la chat, le chiamate, le video chiamate e persino le chiamate di gruppo. E chiami gratis anche i numeri fissi e mobili nel mondo! Scarica subito l’app Vai su https://www.indoona.com/

christopher-ramirez commented 8 years ago

Hello @giorgiogiustiniani! Thanks for your contributions! Performance enhancements are always welcome. Will have to check issue mentioned by @bijanebrahimi.

giorgiogiustiniani commented 8 years ago

lxml is a native wrapper for libxml2 library,I have compilated the sources to produce .so files. I've pushed the lxml dir containing the builded .so native module imported from my secretary modified sources,but don't know the SO infrastructure of your Continuous Integration build machine,It could not work. I suggest you to download the source for your infrastucture if you want to test your library with lxml This is the link for the sources to compile https://github.com/lxml/lxml/

Best Regards

christopher-ramirez commented 8 years ago

I tried running your code but couldn't install lxml using pip. I tried installing several dist packags, e.g. python-lxml, xmllib2, etc. but stil wasn't able to install lxml on a test environment.

This issue stops me from merging your contributions. Doing so will complicate secretary installs on systems without a proper installation of lxml (e.g. Appengine).

What I'm thinking is maybe subclass Renderer and reimplement xml _handle_document_tags routine, among others, to work with lxml. This may be implemented in future versions.

Regards, Chris