Exemplo n.º 1
0
def _create_function(conn, name, num_args, py_func):
    class func(Function):
        def xFunc(self):
            assert self.args() == num_args
            args = [self.value_string(n) for n in xrange(0, num_args)]
            ret = py_func(*args)
            self.result(ret)
    Function.create(conn, name, func())
Exemplo n.º 2
0
def create_function(conn, name, num_args, py_func):
    from org.sqlite import Function
    class func(Function):
        def xFunc(self):
            assert self.super__args() == num_args
            args = [self.super__value_text(n) for n in xrange(0, num_args)]
            ret = py_func(*args)
            self.super__result(ret)
    Function.create(conn, name, func())
Exemplo n.º 3
0
def create_function(conn, name, num_args, py_func):
    from org.sqlite import Function

    class Impl(Function):
        def xFunc(self):
            assert self.super__args() == num_args
            args = [self.super__value_text(n) for n in xrange(0, num_args)]
            ret = py_func(*args)
            self.super__result(ret)

    Function.create(conn, name, Impl())