How to use the ttp.ttp._input_class function in ttp

To help you get started, we’ve selected a few ttp examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github dmulyalin / ttp / ttp / ttp.py View on Github external
def update_input(
        self, element=None, data=None, input_name="Default_Input", groups=["all"]
    ):
        """
        Method to set data for template input
        Args:
            data (list): list of (data_name, data_path,) tuples
            input_name (str): name of the input
            groups (list): list of groups to use for that input
        """
        input = _input_class(
            element=element,
            input_name=input_name,
            template_obj=self,
            groups=groups,
            data=data,
        )
        if input.name in self.inputs:
            self.inputs[input.name].load_data(data=input.data)
            self.inputs[input.name].groups_indexes += input.groups_indexes
            self.inputs[input.name].groups_indexes = list(
                set(self.inputs[input.name].groups_indexes)
            )
            del input
        else:
            self.inputs[input.name] = input