Rhodes 0.1 Preview Released

For the last few weeks I have been working on a project called “Rhodes”. Rhodes is aimed to be a desktop automation scripting environment for the Linux Desktop. With Rhodes, users will be able to write small scripts to automate simple (and perhaps complex) tasks using a few lines of JavaScript.

For example, a user might want to create a script that helps them sync their portable music device. The script could prompt the user with some questions about the genre’s of the music they would like to sync and then query HAL for portable music devices and allow them to choose the device from a dialog. Rhodes will eventually provide a simple set of APIs that will make these kinds of automation tasks possible.

The current preview release does not contain this functionality yet but I’m working on it.

The APIs as mentioned above are able to be written in Python then exported to the Mozilla JavaScript runtime. Python was chosen so that developers working on API’s for Rhodes would not be messing around in C so that these API’s can be developed and prototyped quickly.

In the rhodes-python module a developer can make a Python object available by simply doing the following in Python:

In helloworld.py:


from rhodes import *

def printout(value):
	print value

def join_string(string1, string2):
	return string1 + string2

r = Rhodes() #Create a new Rhodes runtime
r.export(printout) #Exports the printout method to JavaScript
r.export(join_string) # Exports join_string method to JavaScript
r.run("helloworld.js") #Runs the JavaScript

Which then the python methods can be accessed by the following in JavaScript:

In helloworld.js:


var x = join_string("Hello, ", "World!")

printout(x);

When you run the python script (You will need to have the python-dbg package installed on your system) like the following:


james@plex:~/tmp$ python-dbg helloworld.py

The runtime will export the methods to JavaScript runtime, run the JavaScript and kindly output the following:


james@plex:~/tmp$ python-dbg helloworld.py
Hello, World!

To get the source code thats compatible with this example you can get it here.

Or if you want to have a look at the source code you can grab it using Baazar by:


bzr clone http://beta.unstated.net/~james/code/rhodes/

I’ll post more about Rhodes in a couple of days or so but for now your comments, suggestions and questions are welcome.

UPDATE: I’ve used the LGPL 3.0 license for Rhodes

Leave a Reply