Kraken Jython

  • Depends on Jython 2.5.1

Quick Start

  • Install
    • pkg.install kraken-jython
  • Run
    • jython.run
    • Press Ctrl-C or Ctrl-D to break
    • "bc" variable is a BundleContext and is defined in global scope. You can use all OSGi services through it.

Example

kraken> jython.run
>>> 1 + 2
3

>>> 'Hello' * 10
'HelloHelloHelloHelloHelloHelloHelloHelloHelloHello'

>>> lll
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>

NameError: name 'lll' is not defined

>>> class Test:
...   def hello(self, name):
...     print 'hello ' + name
...
>>> t = Test()
>>> t.hello('xeraph')
hello xeraph

>>> bc
org.apache.felix.ipojo.IPojoContext@1d5b89c

>>> bc.getClass().getName()
u'org.apache.felix.ipojo.IPojoContext'

>>> bc.getBundles()
array(org.osgi.framework.Bundle, [org.apache.felix.framework [0], org.apache.felix.ipojo [1], org.krakenapps.ipojo [2], org.krakenapps.jython [3]])

>>> interrupted