def ctrl_c(signum, f): raise urwid.ExitMainLoop()
def exit(self): raise urwid.ExitMainLoop()
def keyHandler(self, input): """We leave if user press a quit char""" if input in ('esc', 'q', 'Q'): raise urwid.ExitMainLoop() else: return self.menu.checkShortcuts(input) #needed to manage shortcuts
def on_exit_clicked(button): raise urwid.ExitMainLoop()
def key_handler(key): if key in ('q', 'Q', 'esc'): raise urwid.ExitMainLoop() elif key == 'ctrl r': python = sys.executable os.execl(python, python, *sys.argv)
def _handle_input(self, input): if input in ("q", "Q"): raise urwid.ExitMainLoop()
def generate_gif_with_subtitle(button, edit): global subtitle subtitle = edit.edit_text raise urwid.ExitMainLoop()
def quit(self): """Quit the app.""" raise urwid.ExitMainLoop()
def sigint_handler(app, signum, frame): app.command = EXIT_REDIAL raise urwid.ExitMainLoop()
def _handle_input(inp): if inp in ('q', 'Q'): raise urwid.ExitMainLoop()
def quit_tormon(*args, **kwargs): raise urwid.ExitMainLoop()
def show_or_exit(key): if key in ('q', 'Q'): raise urwid.ExitMainLoop()
def ok_pressed(*args, **kwargs): raise urwid.ExitMainLoop()
def exit_on_q(key): if key in ('q', 'Q'): raise urwid.ExitMainLoop()
def _close(*args): raise urwid.ExitMainLoop()
def on_key_press(self, key: str, w: UITreeWidget): this_node = w.get_node().get_value() folder_node = this_node if (w.get_node().get_parent() is None or this_node.nodetype == "folder") \ else w.get_node().get_parent().get_value() parent_node = None if w.get_node().get_parent( ) is None else w.get_node().get_parent().get_value() if key in ['q', 'Q', 'ctrl d']: self.command = EXIT_REDIAL raise urwid.ExitMainLoop() elif key == "enter": if isinstance(w.get_node(), UITreeNode): self.command = w.get_node().get_value( ).hostinfo.get_ssh_command() raise urwid.ExitMainLoop() elif key == "f3" and w.is_leaf: if (len(get_public_ssh_keys())) == 0: MessageDialog( "Error", "There is no public SSH Key (.pub) in ~/.ssh folder. You can use ssh-keygen to " "generate SSH key pairs", self.close_dialog).show(self.loop) else: self.log = "SSH key is copied successfully" CopySSHKeyDialog(this_node, self.close_dialog_and_run, self.change_log).show(self.loop) elif key == "f5" and w.is_leaf: if package_available(package_name="mc"): self.command = this_node.hostinfo.get_mc_command() raise urwid.ExitMainLoop() else: MessageDialog( "Error", "Please install mc (Midnight Commander) package" " to use this feature", self.close_dialog).show(self.loop) elif key == "f6": AddFolderDialog(folder_node, Node("", "folder"), self.save_and_focus).show(self.loop) elif key == "f7": AddHostDialog(folder_node, Node("", "session", HostInfo("")), self.save_and_focus).show(self.loop) elif key == "f8": if this_node.nodetype == "folder": # TODO implement removing folder MessageDialog("Error", "Folders can not be removed", self.close_dialog).show(self.loop) else: RemoveHostDialog(parent_node, this_node, self.save_and_focus).show(self.loop) elif key == "f9" and w.is_leaf: AddHostDialog(parent_node, this_node, self.save_and_focus).show(self.loop) elif key in ["meta down", "ctrl down"]: if parent_node is None: return i = parent_node.children.index(this_node) if i == len(parent_node.children) - 1: return # at bottom parent_node.children[i], parent_node.children[ i + 1] = parent_node.children[i + 1], parent_node.children[i] self.save_and_focus(this_node) elif key in ["meta up", "ctrl up"]: if parent_node is None: return i = parent_node.children.index(this_node) if i == 0: return # at top parent_node.children[i], parent_node.children[ i - 1] = parent_node.children[i - 1], parent_node.children[i] self.save_and_focus(this_node) else: return key
def unhandled_input(key): if key in ('q', 'Q'): raise urwid.ExitMainLoop()
def handle_key(self, key): if key in config.KEYMAP['quit']: raise urwid.ExitMainLoop() elif key in config.KEYMAP['refresh']: self.message_frame.refresh(self.HOST, self.buddy)
def generate_gif(button): raise urwid.ExitMainLoop()
def exit(): raise urwid.ExitMainLoop()
def exit(button): global index index = None raise urwid.ExitMainLoop()
def keypress(key): if key in ("q", "Q", "esc"): raise urwid.ExitMainLoop()
def show_or_exit(key): if key in ('q','Q'): raise urwid.ExitMainLoop() txt.set_text(repr(key))
def handle_input(self, key): # Module specific key if key == 'ctrl x': raise urwid.ExitMainLoop()
def keypress(key): if key in ('q', 'Q'): raise urwid.ExitMainLoop()
def quitter(self, touche): if touche in ('q', 'Q'): raise urwid.ExitMainLoop()
def exit(self): self.active = False raise urwid.ExitMainLoop()
def global_keypress(self, key): if key in ('q', 'esc'): raise urwid.ExitMainLoop()
def exit_program(button): raise urwid.ExitMainLoop()
def show_or_exit(key): if key in ("q", "Q"): raise urwid.ExitMainLoop()