Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
ids = self.ids_get()
if not obj_id and ids and len(ids):
obj_id = ids[0]
if obj_id:
ctx = self.context.copy()
if 'active_ids' in ctx:
del ctx['active_ids']
if 'active_id' in ctx:
del ctx['active_id']
return Action.exec_keyword(keyword, self.window, {
'model': self.model,
'id': obj_id,
'ids':ids,
}, context=ctx, warning=warning)
else:
common.message(_('No record selected!'), self.window)
return False
filename = filename.decode('utf-8')
try:
CONFIG['client.default_path'] = \
os.path.dirname(filename)
CONFIG.save()
except IOError:
pass
if response == gtk.RESPONSE_OK:
if width and height and filename:
if not filename.endswith('.png'):
filename = filename + '.png'
try:
graph.export_png(filename, width, height)
break
except MemoryError:
common.message(_('Image size too large!'), dia,
gtk.MESSAGE_ERROR)
else:
break
parent.present()
dia.destroy()
return
def sig_test_expand_row(self, widget, iter, path):
model = self.tree_res.view.get_model()
iter_children = model.iter_children(iter)
if iter_children and model.get(iter_children, 0)[0] in model.to_reload:
hostname = rpc._SOCK.hostname
port = rpc._SOCK.port
while True:
password = common.ask(_('Password:'), self.window,
visibility=False)
if password is None:
return True
res = rpc.login(rpc._USERNAME, password, hostname, port,
rpc._DATABASE)
if res == -1:
common.message(_('Connection error!\n' \
'Unable to connect to the server!'), self.window)
return True
if res < 0:
continue
return False
return False