Category archives: Snaking

Discussions of programming, particularly of programming Python

RSS feed of Snaking

bzr-svn for those stuck with svn servers...

At work I need to interact with an svn (1.4) repository, but honestly I'm so spoiled by bzr that it just drives me nuts, particularly the (frustratingly frequent) situations where I miss a particular change-set/revision when merging into my tree and wind up reverting someone's changes.  The VCS should bloody-well track what revisions are missing, ...

Continue reading

Python 3.x Porting Notes

Decided to see how much work getting PyOpenGL ported to Python 3.x would be.  Notes so far:

  • ubuntu has Python 3.1 packaged (yay)
  • also has distribute and -dev, you'll need both
  • virtualenv -- this is key for my porting work-flow (not just for PyOpenGL, for almost every project), had to use an hg branch to ...

Continue reading

Mocker's hidden gem...

Mocker has one uber-nice feature... it will mock out an object in basically all namespaces, so you can do a .proxy( 'mymodule.this.that' ) and have the resulting mock object replace the target "that" wherever it's been imported.  It won't, for instance, pick up references in lists, sets and the like, but for basic namespaces (dictionaries) ...

Continue reading

Stub/Mock-a-Process Module

Say you want to have a test suite that tests logic which runs command-line processes that should *not* be run on the test machine (e.g. they would cause the test machine's configuration to be totally messed up).  You want to test right down to the point where the call is made (i.e. you don't way ...

Continue reading

Anyone with PostgreSQL-on-EC2 recipes that work?

Seeing ridiculously slow PostgreSQL performance on an application.  Can't claim the application is particularly tightly coded for DB usage (too much ORM-ish-ness), so there's room to improve there, but right now we're seeing the same app 10x slower on the EC2 instances than on my (somewhat high-end) laptop... which makes me wonder if there's some ...

Continue reading

Python 2.5 PIL Gone in Lucid?

Why do half my tests suddenly fail, thinks me?  Me thinks, me looks, me finds no PIL!  Egadzooks, thinks me, thinking thinkily, what has become of my Python 2.5 PIL?  Aptitude thinks, and returns no thoughts of a Python 2.5 python-imaging?  Me thinks methinks me thoughts must turn to source.

[Update] For those who encounter ...

Continue reading

Duh! But upstart on 1.5 year old OS not so great...

My little experiment in Upstart is going to get rolled back, it appears.  While the system worked perfectly on modern Linux (Karmic Ubuntu), it wouldn't even recognize the scripts as valid on the Fedora 10 servers.  Given that the release of Upstart is so old, I'm thinking I'll wind up managing the 6-7 state transitions/events ...

Continue reading

Upstart seems kinda nice

Been doing system-level wiring for a low-level process for the last few hours, target is Fedora 10, so I can (theoretically) use Upstart for the init scripts... pretty slick stuff, the configs are simple, and I can create my 4-5 somewhat-interdependent processes such that they just kick each other off based on sending events.  The ...

Continue reading

Extract all fields of a DER-encoded PKCS7 file?

Say you have a PKCS#7 file with an embedded code-image as a field, how would you go about extracting that field's contents?  pyOpenSSL doesn't seem to have mechanisms for extracting/viewing arbitrary fields from PKCS7.  pyasn1 can load the structures, but of course it doesn't have access to the meaning of the fields, and it doesn't ...

Continue reading

Generic Binary-Data Pack/Unpack Module?

Having just written yet another module to pack/unpack data into a particular binary format, I'm wondering if someone has a more effective method they'd like to share?  I'm thinking some module that can handle RLE/TLV type stuff, complex "encodings" such as utf-8 continued charcters, struct-like pack/unpack for static elements, efficient loading of arrays, and bit-field ...

Continue reading