# Path: XulDebugTool/webprocess/WebDataHandler.py
# class WebDataHandler:
#     @staticmethod
#     def readData(value):
#         pass
#         # dict = json.loads(value)
#         # action = dict['action']
#         # if action == "click":
#         #     id = dict['Id']
#         #     xml = dict['xml']
#         #     element = Utils.findNodeById(id, xml)
#         #     print('receive %s' % element.tag)
#         #     print('receive %s' % element.text)
#         #     print('receive %s' % element.attrib)
#             # 获得element的子集用getchildren()
#             # children = element.getchildren()
#             # if len(children):
#             #     print(element.text + " " + children[0].text)
#             # else:
#             #     print(element.text)


from PyQt5.QtCore import pyqtProperty, pyqtSignal
from PyQt5.QtWidgets import QWidget
from XulDebugTool.webprocess.WebDataHandler import WebDataHandler
#!/usr/bin/python
# -*- coding: utf-8 -*-

"""
Web桥接对象
author: Allen
last edited: 2017.11.7

"""




class WebShareObject(QWidget):
    jsCallback = pyqtSignal(str)
    def __init__(self):
        super(WebShareObject, self).__init__()

    def _getStrValue(self):
        return '100'

    def _setStrValue(self, value):
        self.jsCallback.emit(str(value))

# Path: XulDebugTool/webprocess/WebDataHandler.py
# class WebDataHandler:
#     @staticmethod
#     def readData(value):
#         pass
#         # dict = json.loads(value)
#         # action = dict['action']
#         # if action == "click":
#         #     id = dict['Id']
#         #     xml = dict['xml']
#         #     element = Utils.findNodeById(id, xml)
#         #     print('receive %s' % element.tag)
#         #     print('receive %s' % element.text)
#         #     print('receive %s' % element.attrib)
#             # 获得element的子集用getchildren()
#             # children = element.getchildren()
#             # if len(children):
#             #     print(element.text + " " + children[0].text)
#             # else:
#             #     print(element.text)


# Path: XulDebugTool/webprocess/WebShareObject.py
from PyQt5.QtCore import pyqtProperty, pyqtSignal
from PyQt5.QtWidgets import QWidget
from XulDebugTool.webprocess.WebDataHandler import WebDataHandler

#!/usr/bin/python
# -*- coding: utf-8 -*-

"""
Web桥接对象
author: Allen
last edited: 2017.11.7

"""




class WebShareObject(QWidget):
    jsCallback = pyqtSignal(str)
    def __init__(self):
        super(WebShareObject, self).__init__()

    def _getStrValue(self):
        return '100'

    def _setStrValue(self, value):
        self.jsCallback.emit(str(value))

        WebDataHandler().readData(value)