Saved for later reference

online repository of stuff I had to google for hours to figure out

lxml for Python 2.6/win32

Tags: , , , ,

A quick post today: Using these instructions, I’ve built a statically linked lxml 2.2.4 for Windows.

I used the following versions of the libraries:

1
2
3
4
5
6
STATIC_INCLUDE_DIRS = [
"..\\libxml2-2.7.6.win32\\include",
"..\\libxslt-1.1.26.win32\\include",
"..\\zlib-1.2.3.win32\\include",
"..\\iconv-1.9.2.win32\\include"
]
1
2
3
4
5
6
STATIC_LIBRARY_DIRS = [
"..\\libxml2-2.7.6.win32\\lib",
"..\\libxslt-1.1.26.win32\\lib",
"..\\zlib-1.2.3.win32\\lib",
"..\\iconv-1.9.2.win32\\lib"
]

Download it here: lxml-2.2.4.win32-py2.6

  • Share/Bookmark

PC-like Norwegian keyboard layout for Windows on Mac

Tags: , ,

Here’s a quick keyboard layout for 32bit/64bit Windows in BootCamp, which puts all the keys at their “PC Keyboard” positions in Norwegian.

(The default Mac layout has horrible finger-gymnastics to get “{[]}” and other often used programming keys)

NoMac.zip

  • Share/Bookmark

Patched libgmail for unicode handling

Tags: , , , , ,

libgmail 0.1.11 has a bug with unicode handling, when the sender of an email has a name with one or more non-ASCII character in it.

I’ve applied the patch I described in the link above, adding the function:

1
2
3
4
5
6
7
8
9
10
def to_unicode(xstr):
    '''
    Forces string to unicode
    '
''
    if type(xstr) == unicode:
        return xstr
    elif type(xstr) == str:
        return xstr.decode('utf-8')
    else:
        return xstr

And changed all calls to var.decode(‘utf-8′) to to_unicode(var).

libgmail-0.1.11p1.zip (source package)
libgmail-0.1.11p1.win32.exe (win32 installer)

  • Share/Bookmark

© 2009 Saved for later reference. All Rights Reserved.

This blog is powered by Wordpress and Magatheme by Bryan Helmig.