IPC.py

#

Jade Application Kit

  • https://codesardine.github.io/Jade-Application-Kit
  • Vitor Lopes Copyright (c) 2016 - 2020
  • https://vitorlopes.me
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 activate(url) -> None:
        if ":" in url:
            url = url.split(':')[1]
        if url.endswith("()"):
            eval(f"Bind.{url}")
        else:
            Bind.listen(url)