IPC.py

#
from JAK.Utils import Instance
#
  • Usage: from JAK import IPC
  • Create your own class and point to this one: IPC.Bind = MyOverrride
class Bind:
#
  • Do something with the data.
  • :param data:
  • :return: url output
    @staticmethod
    def listen(data):
#
        raise NotImplementedError()
#

Call python methods from JavaScript.

class Communication:
#
    @staticmethod
    def send(url) -> None:
        if ":" in url:
            url = url.split(':')[1]
        if url.endswith("()"):
            eval(f"Bind.{url}")
        else:
            Bind.listen(url)