The Obnoxious Activity Monitor

I have also been hacking in free moments on a tool for tracking what I'm spending time on while working. It is a much more obnoxious tool than gtimelog, for two reasons: first, I was forgetting to update gtimelog when I switched to working on something else, and second, when I left my computer to get lunch or a coffee gtimelog would not stop tracking my time. That last point may be desirable for some people who sometimes work away from their computer, but I never do, so it was problematic when I left without telling gtimelog I was taking a break.

The Obnoxious Activity Monitor pops up a window every five minutes asking what you're working on, with a text entry for typing it in. The window will steal your keyboard focus, but it kindly blocks all input for one second so you don't accidentally activate anything. Whatever you typed in last time will be filled in by default, so if you are still working on that, you can just hit enter. If you have started working on something else, type in the new thing (it'll overwrite what's there because the text is selected by default). When you hit enter an ~/activity.txt file will be updated with your latest entry. If you don't respond to dialog box for more than 30 seconds, O-A-M will stop tracking your time, assuming that you have gone on a coffee break or something. When you get back, latte in hand, the dialog box will still be there awaiting your next task.

You may have noticed that I was quite detailed in describing the workflow and all the minor UI behavior of interacting with the window. This is important; if the application were not ergonomic enough, it would not be usable since I have to interact with it on such a regular basis. The common case is to simply hit the enter key, and nothing else (no clicking-to-focus, no clicking a button).

The ~/activity.txt file is compatible with gtimelog, so you can use that to generate your daily or weekly reports (although you will have spurious lines in your report called 'start'; just delete them. I might actually get around to a real fix for that).

The project is hosted on Launchpad: obnoxious-activity-monitor.

bzr and commit messages and IRC bots

I was playing around with the bzrlib API because I was writing a post-commit hook for sending messages to IRC, which I don't think has been done for bzr yet.

It accompanies an IRC bot which I wrote which will hopefully be the last IRC bot I ever write (holy crap, I hate writing IRC bots): the bot simply listens on a TCP port for data to send to arbitrary IRC channels. This lets me solve a lot of IRC-notification use cases without writing any IRC code. The first application of it is the bzr commit bot.

The project is hosted on Launchpad: publish-bot. If you want to use it, you first have to set up the publish-bot on a machine accessible from where you want to do the bzr-committing, and then set up the bzr commit message post-commit hook. The README file should explain this sufficiently.

Web 1.0 mashup

Remember The Milk and Google Calendar

Bazaar API

I've been using the bzrlib API a bit lately to mess around with my bzr branches. Here's what I've learned.

To get a BzrBranch object representing your on-disk branch:

>>> from bzrlib.branch import BzrBranch
>>> branch = BzrBranch.open('.')
>>> branch
BzrBranch5('file:///home/radix/Projects/test-project/')

To get the revision ID:
>>> branch.last_revision()
u'radix@twistedmatrix.com-20070210010145-s6am6e28f4lhbuyf'

To get the log message for the latest revision:
>>> revision = branch.repository.get_revision(branch.last_revision())
>>> revision.message
'testing multi\nline commits\n'

Or for an arbitrary revision number
>>> branch.repository.get_revision(branch.get_rev_id(1)).message
'hi'

How about some more data from that particular revision:
>>> revision.committer
'Christopher Armstrong <radix@twistedmatrix.com>'
>>> revision.timestamp, revision.timezone
(1171069305.8210001, -18000)


This should get you started. dir() and help() are your friend.