Continuous integration in python using watchdog

watchdog is a cross-platform python module for watching directories for changes. I use watchdog to run continuous integration on my projects: every time a file changes (e.g. is saved, deleted, or created) in the directory I am watching, a script will automatically run unit tests, compile libraries, build docs, and run other tests, as necessary. […]

Setting contentEditable in a wxPython IEHtmlWindow

wxPython's iewin.IEHtmlWindow lets you host the Internet Explorer browser control in a wxPython window. Doing so is quite simple: import wx from wx.lib import iewin class MyFrame(wx.Frame):     def __init__(self):         wx.Frame.__init__(self, None, title="IEHtmlWindow")         self.ie = iewin.IEHtmlWindow(self)         self.ie.Navigate("http://example.com/") # your URL here app […]

cpptempl: A string templating library for C++

cpptempl is a simple string templating language (or templating engine) for C++. It has loops, conditionals, and variable interpolation. cpptempl relies on the boost libraries (shared_ptr, string_algo, and lexical_cast). I originally wrote this engine because I was generating HTML files in C++, and generating the HTML right in the C++ quickly got very hairy, besides […]

py2exe gotcha: Building on Windows Vista/7, deploying to XP

py2exe is a fantastic module that will package up a Python program into an executable that will run on Windows. py2exe is amazingly good at sussing out your program's dependencies, but it's a complex task, and inevitably there are some gotchas. One of them is the DLL file "POWRPROF.DLL". This happens when building your executable […]

If you’re not writing code for your users, you’re doing it wrong

Paul Querna recently asked in his blog, "Who are you writing code for?" He listed several possible people/goals: the deadline, management's metrics (lines of code, test coverage, etc.), the computer, yourself, and the programmers who will maintain your code. What surprised me is that nowhere in Paul's post did he mention the only person you […]

Rapid website development with django and jQuery UI

Last week, I launched my latest development project: The official site for the band Murasaki (紫). I was happy to take on this project, partly because Murasaki is something of a legend in the Japanese rock scene (and especially here in their home prefecture of Okinawa), and partly because it would be a good chance […]

mailer module uploaded to bitbucket

I've created a repository for my mailer module on bitbucket. Here's the project URL: http://bitbucket.org/ginstrom/mailer Apparently you can't open write access to everyone, so if you'd like write privileges, then please let me know your account name. About mailer mailer is a wrapper around the Python email and mimetypes libraries.

Simple Ajax with cherrypy and jQuery

All the cool kids these days are putting Ajax into their web applications. Ajax is great for when you want to update data on a page without reloading the entire page. Most of the Ajax tutorials use PHP, so I want to show here how easy it is to do Ajax with cherrpy. Ajax stands […]

Implementing IDocHostUIHandler in a C++ WTL/ATL project

I recently implemented IDocHostUIHandler in one of my WTL projects hosting the web browser. You need to implement this interface if you want to do things like control the context menu of the web browser. I had to go spelunking in various forums and documentation to piece together how to do this, and I never […]

Easy SFTP uploading with paramiko

paramiko makes it so easy to use SFTP that it's hard to believe it's legal in this day and age. Command Line Warriors has a wonderful post showing how to use paramiko to do SFTP uploads/downloads. In this post, I want to share a small helper module called sftp (zip file) (code in post below) […]