Example #1
0
 def objects(self):
   """
   Description:
   -----------
   Interface to the main Javascript Classes and Primitives
   """
   return JsObjects.JsObjects(self)
Example #2
0
File: Data.py Project: ylwb/epyk-ui
    def object(self, varName, value):
        """
    Description:
    ------------

    Attributes:
    ----------
    :param varName: String. The Javascript variable name
    :param value: Float or Integer. Object passed to the Javascript layer
    """
        JsUtils.getJsValid(varName, fail=True)
        return JsObjects.JsObjects().new(value,
                                         varName=varName,
                                         report=self._report)
Example #3
0
    def object(self, js_code: str, value: float):
        """
    Description:
    ------------
    Transform a Python object to a JavaScript object.

    Attributes:
    ----------
    :param str js_code: The Javascript variable name.
    :param float value: Object passed to the Javascript layer.
    """
        JsUtils.getJsValid(js_code, fail=True)
        return JsObjects.JsObjects().new(value,
                                         js_code=js_code,
                                         page=self.page)
Example #4
0
File: Data.py Project: ylwb/epyk-ui
    def list(self, varName, data):
        """
    Description:
    ------------

    Attributes:
    ----------
    :param varName: String. The Javascript variable name
    :param data: List. Object passed to the Javascript layer
    """
        JsUtils.getJsValid(varName, fail=True)
        return JsObjects.JsObjects().array(data,
                                           varName=varName,
                                           setVar=True,
                                           report=self._report)
Example #5
0
    def number(self, js_code: str, value):
        """
    Description:
    ------------
    Transform a Python number to a JavaScript one.

    Attributes:
    ----------
    :param str js_code: The Javascript variable name.
    :param value: Float | Integer. Object passed to the Javascript layer.
    """
        JsUtils.getJsValid(js_code, fail=True)
        return JsObjects.JsObjects().number(value,
                                            js_code=js_code,
                                            set_var=True,
                                            page=self.page)
Example #6
0
    def list(self, js_code: str, data):
        """
    Description:
    ------------
    Transform a Python object to a JavaScript list.

    Attributes:
    ----------
    :param str js_code: The Javascript variable name.
    :param data: List. Object passed to the Javascript layer.W
    """
        JsUtils.getJsValid(js_code, fail=True)
        return JsObjects.JsObjects().array(data,
                                           js_code=js_code,
                                           set_var=True,
                                           page=self.page)