Enrico Zini: Polysms
Polysms
Here is my first software designed for the FreeRunner:
polysms. It's a commandline tool: you pass it a
polygen grammar name and a phone number, and it will send a SMS to
that phone number using the polygen output for that grammar as the
SMS text:
# polyrun manager 0012345678
And here is the code, that works on the http://www.freesmartphone.org
dbus framework:
#!/usr/bin/python # (C) 2008 Enrico Zini # Most bits of this are stripped from zhone, which is: # (C) 2007 Johannes 'Josch' Schauer # (C) 2008 Michael 'Mickey' Lauer <mlauer@vanille-media.de> # (C) 2008 Jan 'Shoragan' Luebbe # (C) 2008 Daniel 'Alphaone' Willmann # (C) 2008 Openmoko, Inc. # GPLv2 or later from dbus import SystemBus, Interface from dbus.exceptions import DBusException import logging logger = logging.getLogger( __name__ ) from dbus.mainloop.glib import DBusGMainLoop DBusGMainLoop(set_as_default=True) import gobject import sys from subprocess import Popen, PIPE class Phone: def tryGetProxy( self, busname, objname ): try: return self.bus.get_object( busname, objname ) except DBusException, e: logger.warning( "could not create proxy for %s:%s" % ( busname, objname ) ) def __init__(self): try: self.bus = SystemBus() except DBusException, e: logger.error( "could not connect to dbus_object system bus: %s" % e ) return False # Phone self.gsm_device_obj = self.tryGetProxy( 'org.freesmartphone.ogsmd', '/org/freesmartphone/GSM/Device' ) if ( self.gsm_device_obj is not None ): self.gsm_device_iface = Interface(self.gsm_device_obj, 'org.freesmartphone.GSM.Device') self.gsm_sim_iface = Interface(self.gsm_device_obj, 'org.freesmartphone.GSM.SIM') self.gsm_network_iface = Interface(self.gsm_device_obj, 'org.freesmartphone.GSM.Network') self.gsm_call_iface = Interface(self.gsm_device_obj, 'org.freesmartphone.GSM.Call') self.gsm_test_iface = Interface(self.gsm_device_obj, 'org.freesmartphone.GSM.Test') # Main loop self.loop = gobject.MainLoop() def send(self, number, message): def onSent(): print "SENT" self.loop.quit() def onStore(index): print "STORED AS", index self.gsm_sim_iface.SendStoredMessage( index, reply_handler=onSent, error_handler=self.onError ) self.gsm_sim_iface.StoreMessage( number, message, reply_handler=onStore, error_handler=self.onError ) def onError(self, result): print "ERROR", result def mainloop(self): self.loop.run() if len(sys.argv) != 3: print >>sys.stderr, "Usage: %s grammarname phonenumber" sys.exit(1) message = Popen(["/usr/bin/polyrun", sys.argv[1]], stdout=PIPE).communicate()[0] number = sys.argv[2] print "Sending to %s:" % number print message phone = Phone() phone.send(number, message) phone.mainloop()
I got several emails in reply to my previous
I like
Daniel, you are
Unfortunately, Matthew is correct, and it seems that
Hi folks!
We’re almost done for the official Summer of Code program and I thought that I couldn’t let it end without another update, so here we are (you may thank Daniel Burrows for additional poking).
The Gtk+ interface for Aptitude is making great progress. The product is not final yet but already implements many of the planned ideas, with others to come.
Here are the screenies:
Not too bad, but if I render it in
Of course, for very thin text columns (and the above is arguably
pushing it), hyphenation and text justification aren't what you want.
But it would be nice to be able to at least see what it looked like.
Figuring that
The one intriguing thing I noticed, although it's not GTK+ at all, was
the 


The first thing to do is to include the portions of cwidget that our
program will use. Most importantly, we need the
After some time and various patches there's a new version of
Debian 4.0 version of Ruby is open to the, now widely known,
I spent Saturday at BarCamp Belfast. There were more people than I expected; I'm no good at judging exact numbers but the wiki lists 62. As it turned out not everyone ended up talking; this worked out well for me because I don't think I'm Web2.0 enough (is that a bit ironic given I'm writing this on a blog?). I don't really do user interfaces or website stuff and that seemed to be the primary focus of a lot of the attendees. Nice to know there's a fairly active crowd in