boxee Python-REPL app
What is it?
Recently I got my hands on a Boxee Box, and got to work poking around to see what it can do. For its apps, it uses Python as its scripting language, specifically version 2.4. While there is documentation, it is a bit sparse, doesn't go into details and the API is a bit quirky (probably because it is simply a wrapper around the C API; even then, they could've done a better job abstracting it).
To make things easier, I wrote an app that replicates the Python REPL functionality inside a live boxee app, allowing you to poke around and see what's possible and what isn't without having to litter your code with log methods, firing up boxee, loading the app, closing boxee and examining the logs, rinse and repeat.
It is very barebones, and there is one annoying issue with it - the command history text doesn't scroll, because I haven't worked out how to use a TextBox (docs don't mention how you can get a TextBox in code to manipulate it). The workaround is to clear the history once it fills up the screen.
How do I get it?
The app is available at my boxee repository - simply add http://edgylogic.com/media/boxee to your repositories list (Apps -> Repositories (under Extras) -> Add Repository).
(Visiting that URL directly will return a 403 Forbidden; it needs to be entered into boxee.)
Useful things to know
- The Python implementation doesn't allow writing to files to protect rogue apps from doing bad things. If you try, you'll get an error. There doesn't seem to be any directories that are exempted, e.g. temp directories, or the app directory.
- You can't execute commands either, for the same reason.