Пример #1
0
 def _setup_headers(self):
     """
     Setup Headers callback
     :return: None
     """
     PropertyEditor.get_instance(
         text='Load Headers',
         columns=['Header', 'Value'],
         data=self._load_headers,
         empty=["X-New-Header", "X-New-Header-Value"])
Пример #2
0
 def _setup(self):
     """
     Setup callback
     :return: None
     """
     PropertyEditor.get_instance(text="Configure InQL",
                                 columns=['Property', 'Value'],
                                 data=self._run_config,
                                 actions=[
                                     ExecutorAction(
                                         "Setup Load Headers",
                                         lambda _: self._setup_headers())
                                 ])
Пример #3
0
    def actionPerformed(self, e):
        """
        Overrides ActionListener behaviour, when clicked it opens the headers property editor for the given host.

        :param e: unused
        :return:
        """
        if self._host:
            try:
                self._overrideheaders[self._host]
            except KeyError:
                print("No custom header for %s, generating an empty set" %
                      self._host)
                self._overrideheaders[self._host] = []
            PropertyEditor.get_instance(
                "Set Custom Header for %s" % self._host,
                columns=["Header", "Value"],
                data=self._overrideheaders[self._host],
                empty=["X-New-Header", "X-New-Header-Value"])