GFX::Monk Home

Posts tagged: "application" - page 3

Autonose: continuous test runner for python's nosetests

Today I’ve put up the first “releaseable” version of autonose. Basically, it analyses your code’s imports, and determines exactly which tests rely on which code. So whenever you change a file, it’ll automatically run the tests that depend on the changed file (be it directly or transitively). Give it a go, and please let me know your feedback.

All you need do is:

$ easy_install autonose
$ cd [project_with_some_tests_in_it]
$ autonose

See the github project page for further information (and a screenshot).

A better snap-open (for gedit)

snap-open is handy. Unfortunately, it’s terribly crippled if you have a lot of files, since:

  • it uses the linux find command, instead of an index-based file list
  • it doesn’t run in a separate thread, so it locks up your entire GUI while it goes off to trawl your file heirarchy every time you change a letter in the find box

So I fixed it a bit. It is now threaded, and uses the linux locate command. This is still not ideal, it would be much better to use beagle. But I couldn’t figure out how to do that real quick, so locate it is (for now).

Update: As MadsBuus Points out in the comments, SnapOpen has improved a lot since then. Also, I’ve taken a similar plugin (gedit-openfiles) and turned it into a console-based file finder that allows you to open files with your preferred editor. Since I no longer use gedit, I think having a file finder independent of your editor is a pretty neat feature.

google-reader-iphone-sync

A small, cobbled-together tool which allows you to read your Google Reader feed items offline on your iPhone or iPod Touch.

[i made this!]

(view link)

HTML to PDF converter

Given the integration of PDF into Mac OS X, I was surprised to find that there didn’t seem to be any tool to convert HTML files into PDFs. So, like any frustrated coder I wrote my own little script to do it: html2pdf.py

Requires python and OSX 10.5 (Leopard). It uses a WebKit view for the rendering, so in theory it should work with any URL that safari can handle - but I haven’t exactly tested it thoroughly…

Trashy.app

In any OSX “document window”, there is a little icon representing the current document. If you click and hold this icon, it becomes a draggable alias for the file. You can then use that alias much as you would the file itself (as if you had dragged it from the finder) - but one thing you can’t do is delete the file by dropping it in the trash.

Trashy is a simple program to fix that. Put it in your dock, and it will send anything you drag onto it into the trash. Click here to download Trashy.

Here’s the entire source code applescript, if you’re curious (or just naturally suspicious of running random programs you found on internet, as you ought to be):

on open fileList
	tell application "Finder"
		repeat with f in fileList
			set n to 0
			repeat while class of f is alias file
				if n is less than 5 then
					set n to n + 1
					set f to original item of f
				end if
			end repeat
			move f to the trash
		end repeat
	end tell
end open

on run
	tell application "Finder" to open the trash
end run

MetaMonkey.app

[I made this]

A Lightweight Metadata manager for OSX, allowing you to easily tag and rate any type of file (which is then indexed by spotlight). This is basically my iPhoto replacement now, after spending a week trying to fix its broken database, orphan files, duplicates and all that rubbish. This is much simpler, and it can be used to tag any type of file I want.

This is the result of 2 days work, and just 400 lines of code. That’s pretty decent in my book, the combination of python and cocoa is a pretty powerful beast. Once you get past all the runtime errors and pyobjc bridge troubles, that is…

(view link)