BlogMatrix
 

Distutils and Setuptools

edit David P. Janes 2007-08-22 22:45 UTC add comment  ·

Here's an article on creating a python apps and libraries for distribution using distutils. And from this, here's an article on setuptools, an enhanced version that's been making our lives hell in terms of making totally self contained distributions.

No BlogMatrix Platform on Windows

edit David P. Janes 2007-08-12 12:09 UTC add comment  ·  ·  ·

I think it may be doable, but it's quite a time sink. We're leave all our mods in the code base for another day but the core issue is that the Windows "shortcut" is a third-class citizen compared to UNIX's symbolic link. And we use a lot of symbolic links, especially when constructing the "htdocs" directory for Apache. Now, in Python we can get around this (not efficiently, but good enough) but Apache just doesn't have the proper code to do this. The other option would be to run it all under Cygwin, except mod_python isn't really supported and that's a whole other can of worms.

Apache mod_deflate problem solved

edit David P. Janes 2007-05-07 12:17 UTC 4 comments  ·

We are trying to serve some of our overlarge Javascript programs using mod_deflate to reduce network traffic and hopefully speed up load times on your end. This could potentially make a lot of difference.

Normal:

$ curl http://semantic.xxx.org/:root/packed/MochiKit_standard.js --head
HTTP/1.1 200 OK
Date: Mon, 07 May 2007 12:09:02 GMT
Server: Apache/2.0.59 (Unix) DAV/2 mod_python/3.2.10 Python/2.4.4
Last-Modified: Sun, 06 May 2007 11:58:48 GMT
ETag: "bf4172-3659a-e83cae00"
Accept-Ranges: bytes
Content-Length: 222618
Vary: Accept-Encoding
Connection: close
Content-Type: application/x-javascript

Compressed:

$ curl http://semantic.xxx.org/:root/packed/MochiKit_standard.js --compressed --head
HTTP/1.1 200 OK
Date: Mon, 07 May 2007 12:08:50 GMT
Server: Apache/2.0.59 (Unix) DAV/2 mod_python/3.2.10 Python/2.4.4
Last-Modified: Sun, 06 May 2007 11:58:48 GMT
ETag: "bf4172-3659a-e83cae00"
Accept-Ranges: bytes
Vary: Accept-Encoding
Content-Encoding: gzip
Content-Length: 55248
Connection: close
Content-Type: application/x-javascript

But unfortunately, we couldn't start Apache because we were getting the following error:

actl semantic/semantic start
Syntax error on line 862 of /usr/blogmatrix/apache/semantic/semantic/conf/httpd.conf:
Cannot load /usr/blogmatrix/apache/semantic/semantic/modules/mod_deflate.so into server:
/usr/blogmatrix/apache/semantic/semantic/modules/mod_deflate.so: undefined symbol: deflate

The solution turns out to be fairly simple -- just add LoadFile for zlib into the apache conf

LoadFile /usr/lib/libz.so
LoadModule deflate_module modules/mod_deflate.so
AddOutputFilterByType DEFLATE application/x-javascript text/javascript text/css

Note to self

edit David P. Janes 2006-09-27 10:23 UTC add comment  ·  ·  ·

Frequently test against Internet Explorer.

Yahoo adds "Python Developer Center" to their Developer Network

edit David P. Janes 2006-08-09 17:35 UTC add comment  ·  ·  ·

Yahoo has added a Python Developer Center to their Developer Network (tip: Slashdot):

Welcome to the Python Developer Center

Python is a dynamic object-oriented programming language that can be used for many kinds of software development. It offers strong support for integration with other languages and tools, comes with extensive standard libraries, and can be learned in a few days. This site is your source for information about using Python with Yahoo! Web Services APIs. Here you'll find:

  • HOWTO Articles to help you understand our technologies and how you can use them better with Python.
  • Useful Resources on the web where you can find source code and helpful tools.
  • Educational sites where you can learn how to program using Python.
  • Community Resources where you can join our mailing list and discuss the Yahoo! APIs with us and with other Python developers.

Pretty cool. We originally were using Yahoo Maps when we started adding mapping extensions to the BlogMatrix Platform. However, the maturity wasn't there and due to client demands we migrated to Google. That's not to say we didn't like Yahoo; they're a hell of a lot easier to get an answer out of and they have lots of other great APIs, services and libraries -- such as the Javascript Yahoo UI library, which this site does use -- available.

Update: g*dd*mn*t. no RSS feed. Get it together guys.