serialize class method
parent
a82d35eed8
commit
113959b7d7
|
@ -8,6 +8,11 @@ js_ajax = None
|
||||||
|
|
||||||
live_methods = {}
|
live_methods = {}
|
||||||
|
|
||||||
|
class STUB:
|
||||||
|
def stub_method(self):
|
||||||
|
pass
|
||||||
|
stub_class = STUB()
|
||||||
|
|
||||||
class FuncWithParams:
|
class FuncWithParams:
|
||||||
def __init__(self, func, params):
|
def __init__(self, func, params):
|
||||||
self.func = func
|
self.func = func
|
||||||
|
@ -31,6 +36,8 @@ def encode(o):
|
||||||
return '\'%s\'' % o
|
return '\'%s\'' % o
|
||||||
elif isinstance(o, types.FunctionType):
|
elif isinstance(o, types.FunctionType):
|
||||||
return str(function(js_ajax(o)))
|
return str(function(js_ajax(o)))
|
||||||
|
elif isinstance(o, type(stub_class.stub_method)):
|
||||||
|
return str(function(js_ajax(o)))
|
||||||
elif isinstance(o, FuncWithParams):
|
elif isinstance(o, FuncWithParams):
|
||||||
return str(function(js_ajax(o.func, o.params)))
|
return str(function(js_ajax(o.func, o.params)))
|
||||||
elif isinstance(o, JsFunction):
|
elif isinstance(o, JsFunction):
|
||||||
|
|
Loading…
Reference in New Issue