Dean Edwards releases beta of base2

December 20th, 2007 by Leons Petrazickis

Base2 has just come out in beta on Google Code. It’s hosted there and can be included straight off the Google Code server.

I think it’s a really neat library because it basically fixes all browsers so that the built-in DOM, events, etc work the same way. Instead of providing an API of its own, it makes the existing API work consistently and reliably.

Base2 Features:
- A fast implementation of the Selectors API
- Fixes broken browser implementations of the DOM events module including document.createEvent(), dispatchEvent(), addEventListener(), etc
- Supports DOMContentLoaded
- Fixes getAttribute()/hasAttribute()/setAttribute() (Internet Explorer)
- Implements a few other useful DOM methods like getComputedStyle() and compareDocumentPosition()
- Supports a variety of browsers including ancient browsers like IE5.0 (Windows and Mac)

Dean Edwards has also done the excellent Packer Javascript minifier. It has probably the most in-depth support for obscure language features that simpler minifiers tend to mangle.

Posted in javascript, ajax, base2 | No Comments »

How to enable logging in python-ldap

December 18th, 2007 by Leons Petrazickis

When writing Python scripts which rely on python-ldap and openLDAP, it is often useful to turn on debug messages as follows:

import ldap;

# enable python-ldap logging
ldap.set_option(ldap.OPT_DEBUG_LEVEL, 4095)

# enable openLDAP logging
l = ldap.initialize(‘ldap://yourserver:port’, trace_level=2)
 

This is also useful when debugging the LDAP Plugin for Trac.

Posted in python, ldap, trac | No Comments »