This is probably going to read very fragmented…I’ve been coding all day and can’t really think right now.


So. first off, after spending all day porting code from the GJS module…

DBus = imports.dbus;
GLib =;

function PlayerEngine() {

PlayerEngine.prototype = {
    _init: function() {
	DBus.session.proxifyObject (this, 'org.bansheeproject.Banshee','/org/bansheeproject/Banshee/PlayerEngine');

var PlayerEngineIface = {
    name: 'org.bansheeproject.Banshee.PlayerEngine',
    methods: [{name:'Play', inSignature: ''},
	      {name:'Open', inSignature: 's'}],

DBus.proxifyPrototype (PlayerEngine.prototype, PlayerEngineIface);

proxy = new PlayerEngine();
    Seed.print("proxy.PlayRemote returned");

mainloop = GLib.main_loop_new();

It’s pretty fun! Server side part is almost done also (and is really entirely trivial to use API wise…). Big thanks to everyone working on GJS, as a significant portion of the code between the GJS/Seed DBus bindings is shared (and the rest is modeled after the GJS bindings).

Sandboxes and REPLs

Seed also got a REPL with multiline input (like python)

> if (a == 3){
..  Seed.print("a is three!");

It makes it a lot easier to mess around with things, and is just one of those things that seems kind of necessary to have. I also added a “sandbox” module to Seed, which lets you create a (very lightweight) context with a new global object, and you can control what you expose to it, and evaluate code in that context, it’s pretty neat because the default global object has more or less nothing exposed, so you can safely evaluate more or less anything.


This is the obligatory life section of a blog post…I’m hope from RPI for a month, so right now I don’t have one. I do miss everyone though.

3 Responses to “DBus, sandboxes, REPLs, Life”

  1. […] Robert Carr added a D-Bus module to Seed, he wrote about it in DBus, sandboxes, REPLs, Life. […]

  2. By the way, what’s “#!/usr/local/bin/seed”. Looks like some form of ECMAscript or maybe even Vala.

  3. racarr Says:

    It’s ECMA/JavaScript from WebKit’s JavaScriptCore.

Leave a Reply