[arch-projects] Two small projects

Dusty Phillips buchuki at gmail.com
Thu Mar 17 12:24:07 EST 2005


Ok, I had my break from coding last night. After having spent some
eight months on the same project, I'm looking at some really small
ones to scratch little itches i've developed. To be honest, I doubt
anybody else would be interested, but I wanted to present the ideas.
If people are interested, it means I'll put more work into it, and may
affect my choice of languages. ;-)

First, I've been looking for a CLI weather station. This started when
I used XFCE4 for a while and it had the neat little weather applet.
Now I'm using WMI. I wrote a simple script that uses PyMETAR
(http://www.schwarzvogel.de/software-pymetar.shtml) to download
weather, and I run this with WMI remote in my status bar.  The problem
with this solution is that METAR data doesn't seem to be quite as
reliable as weather.com data, at least, not in my area. To that end, I
found "CurseTheWeather"
(http://opensource.hld.ca/trac.cgi/wiki/CurseTheWeather) an ncurses
based weather app that includes a weather.com module I can use for the
same script.

There's another problem with this solution though, and that is that it
doesn't allow me to easily get the forecast. What I want is an app
that allows me to get the current weather conditions on the command
line, using a formatting string very much like the format of the date
command (man date).  However, I ALSO want it to provide me with CLI
AND GUI options to view a five day forecast. I haven't found any
programs that do this.  The GUI version is more important to me; I
want to have current conditions on my WMI status bar, and have the
forecast available in a window at the press of a key.

So I'm planning on writing a script that does all this. If anybody was
interested, I'd go the full mile and implement everything I just
described. If nobody is interested, I'll probably skip the 'formatted
like date' command and do the formatting inside the script and stuff
like that.

Depending on whether or not anybody is interested, I will either do
this in Python, using the weather.com module from CurseTheWeather, or
will do it in Groovy, writing my own Weather.com data parsing unit
from scratch. I lose either way, really. I hate doing GUI work in
Python. But I also hate working with XML, and weather.com data is in
XML; CurseTheWeather has already taken care of messing with the XML.

But I'll probably use Groovy for that unless other people are
interested -- if they are, I'm sure most people would be more likely
to use a Python app than  Groovy one.

My second mini-project is probably about a half hour's work, so lets
call it a subcompact mini-project. I've noticed all good text editors
allow you to access the console, either directly, or via a plugin that
simulates a console within the editor. I think this is kind of dumb,
I'd rather use a terminal on the side and not have it run by the
editor. Keeps things neater and smaller. The only thing is, I love
being able to change to the current buffer's directory. For example,
in JEdit, if you use the console plugin, you can type cd ${d} to
change to the open buffer's directory.  If I use an xterm on the side,
I can't do this.

That's what I aim to fix. Here's how I propose to do it: I'll write a
JEdit plugin that writes the location of the current file out to
$HOME/.currentbuffer or something like that. Then all I have to do is
add something like B=$(cat $HOME/.currentbuffer) to my ~/.bashrc, and
I can type cd $B any time I want to go to the directory of the current
buffer.

So the only hard part is writing a plugin for JEdit. By hard, I mean
half hour's work. ;-) Again, NOBODY is interested in this because they
don't use JEdit, but I thought it might be interesting to present the
idea, since some people might theoretically want to use the same idea
with their chosen editor, and it would make sense to settle on a
filename (ie: $HOME/.currentbuffer). More importantly, somebody may
know that such a mechanism already exists, and can tell me a better
way to code it for JEdit. :-)

Dusty




More information about the arch-projects mailing list