Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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"])
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"])
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()),
ExecutorAction("Reset",
lambda _: self._reset())
]
d = str(self._dtm.getValueAt(i, j)).lower()
if d == 'none' or d == '':
self._data[i][j] = None
elif d == 'true' or d == 't':
self._data[i][j] = True
elif d == 'false' or d == 'f':
self._data[i][j] = False
else:
try:
self._data[i][j] = int(self._dtm.getValueAt(i, j))
except ValueError:
self._data[i][j] = self._dtm.getValueAt(i, j)
if __name__ == "__main__":
data = [['a', 'b'], ['c', 'd']]
pe = PropertyEditor.get_instance(columns=['ciao', 'bao'], data=data, empty=['e1', 'e2'])
while True:
time.sleep(10)
pe = PropertyEditor.get_instance(columns=['ciao', 'bao'], data=data, empty=['e1', 'e2'])
PropertyEditor.get_instance(text='test2', columns=['ciao', 'bao'], data=data, empty=['e1', 'e2'])
print(pe._data)
self._data[i][j] = True
elif d == 'false' or d == 'f':
self._data[i][j] = False
else:
try:
self._data[i][j] = int(self._dtm.getValueAt(i, j))
except ValueError:
self._data[i][j] = self._dtm.getValueAt(i, j)
if __name__ == "__main__":
data = [['a', 'b'], ['c', 'd']]
pe = PropertyEditor.get_instance(columns=['ciao', 'bao'], data=data, empty=['e1', 'e2'])
while True:
time.sleep(10)
pe = PropertyEditor.get_instance(columns=['ciao', 'bao'], data=data, empty=['e1', 'e2'])
PropertyEditor.get_instance(text='test2', columns=['ciao', 'bao'], data=data, empty=['e1', 'e2'])
print(pe._data)
elif d == 'true' or d == 't':
self._data[i][j] = True
elif d == 'false' or d == 'f':
self._data[i][j] = False
else:
try:
self._data[i][j] = int(self._dtm.getValueAt(i, j))
except ValueError:
self._data[i][j] = self._dtm.getValueAt(i, j)
if __name__ == "__main__":
data = [['a', 'b'], ['c', 'd']]
pe = PropertyEditor.get_instance(columns=['ciao', 'bao'], data=data, empty=['e1', 'e2'])
while True:
time.sleep(10)
pe = PropertyEditor.get_instance(columns=['ciao', 'bao'], data=data, empty=['e1', 'e2'])
PropertyEditor.get_instance(text='test2', columns=['ciao', 'bao'], data=data, empty=['e1', 'e2'])
print(pe._data)