var viewChangeHandler = function() {
var yaw = view.yaw();
var act_yaw=yaw;
var d_yaw=yaw/(Math.PI/180)
console.log(d_yaw);
};#CefPython Event
class ClientHandler():
#hilarious method but work
def OnConsoleMessage(self, browser, message, source, line):
source = config.DEFAULT_URL
Geo360Dialog.ActualOrientation(yaw=message)
return
python
isLocal = False
def doStuff():
pass
def connects():
pass
class MyClass():
def __init__(self):
pass
def myMethodGetsClientFn(clientSideMethodName = None):
if clientSideMethodName is not None:
connects()
else:
doStuff()
#interface
class ClientHandler():
# generic method: gets messages from console.log in javascript client side
# browser: is the object wich we must to return from create CreateBrowserSync method
# message: the message sent from javascript
# source: the source from the message (if it comes from a file or from url- the url passed to CreateBrowserSync(settings, url="http:/bla/index.html") )
# line : no idea
def OnConsoleMessage(self, browser, message, source, line):
#source receives from config the url
source = config.DEFAULT_URL
MyClass.myMethodGetsClientFn(fnToSendAsStr = messageFromFunction)
return
js
fnToSendAsStr = function(){
return "fnInPython"+ ":" + "param1" + "param2" + "paramList" ;
};
my_js_method = """
var my_js_callback = function() {
console.log(fnToSendAsStr);
};