Including an jython library in Gogoego

59 views
Skip to first unread message

Trevor Glen

unread,
Jun 7, 2010, 9:55:08 AM6/7/10
to GoGoEgo
Hi All,

I have a jython "library" called jyson (http://jyson.xhaus.com/) that
I have converted into an OSGi plugin and am trying to get jython to
instantiate objects within GoGoEgo.

So what I'm trying to do is this:

from java.net import URL
from java.io import InputStreamReader
from java.io import BufferedReader
from com.xhaus.jyson import JysonCodec as json

url = URL("http://feeds.delicious.com/v2/json/adhoc?count=10")
reader = BufferedReader(InputStreamReader(url.openStream()))
try:
str = reader.readLine()
while str != None:
bookmarks += str
str = reader.readLine()

document.write(json.loads(bookmarks))
finally:
reader.close()

But it fails with:
Exception running script: Traceback (innermost last):
File "<unknown>", line 5, in ?
ImportError: no module named xhaus

Help, please!

Cheers,
Trev

Trevor Glen

unread,
Jun 7, 2010, 9:57:03 AM6/7/10
to GoGoEgo
Oh, and if there is a better way to get a json feed and convert it, please let me know!

Ta,
Trev
Reply all
Reply to author
Forward
0 new messages