Category Archives: python module

weasyprint and glyphicons font on Windows 7: couldn’t load font “Glyphicons Halflings Not-Rotated 21px”

I recently developed tooling using python 2.7. It runs on Windows 7 (using portable python) and Linux, will do something and produce both HTML and PDF output. I used Twitter Bootstrap to format the HTML page and I created a PDF using that HTML page. Should be easy, as weasyprint is pretty mature and actually works on Windows, but pango was emitting couldn't load font messages. Simply installing the font was impossible, as it required administrator access to the operating system Continue reading weasyprint and glyphicons font on Windows 7: couldn’t load font “Glyphicons Halflings Not-Rotated 21px”

Parsing json with HTML style comments using python

I recently needed to add version control information into a file which had data stored in json format. As it turns out, I’m not the only one who learned about the issues surrounding json and comments. I wanted an HTML style comment at the end of the file. The solution was real simple, when using pyparsing. Continue reading Parsing json with HTML style comments using python

Making python xmlrpclib.ServerProxy log method names and parameters revisited

In my previous post I described a procedure to log XMLRPC client calls. The procedure will do the job, but it does not suffice when you’re connecting to multiple XMLRPC servers from a single process and you want to log calls sent to one specific server. So, here’s an improvement. Continue reading Making python xmlrpclib.ServerProxy log method names and parameters revisited