#!/usr/bin/env python
import coral


L = coral.Language("testlang", 1, 0)
E = coral.ElementDefinition(L, "ED1")

def op1(self, x):
    print "---"
    print "In operation 1:"
    print self
    print x
    print "---"
    
def __browse__(self, x):
    print "We're in the browse operation!"
    print "The element is", self
    print "The operation is", x
    print "Now we're supposed to return the suitable operation..."
    return op1

O = coral.PyOperation(__browse__, "python", "xxx", False)
E.__addOperation__(O)

e = E()
e.op1(e,"foobar")
