Example #1
0
 def ctrl_c(signum, f):
     raise urwid.ExitMainLoop()
Example #2
0
 def exit(self):
     raise urwid.ExitMainLoop()
Example #3
0
 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
Example #4
0
def on_exit_clicked(button):
    raise urwid.ExitMainLoop()
Example #5
0
 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)
Example #6
0
 def _handle_input(self, input):
     if input in ("q", "Q"):
         raise urwid.ExitMainLoop()
Example #7
0
def generate_gif_with_subtitle(button, edit):
    global subtitle
    subtitle = edit.edit_text
    raise urwid.ExitMainLoop()
Example #8
0
    def quit(self):
        """Quit the app."""

        raise urwid.ExitMainLoop()
Example #9
0
def sigint_handler(app, signum, frame):
    app.command = EXIT_REDIAL
    raise urwid.ExitMainLoop()
Example #10
0
 def _handle_input(inp):
     if inp in ('q', 'Q'):
         raise urwid.ExitMainLoop()
Example #11
0
def quit_tormon(*args, **kwargs):
    raise urwid.ExitMainLoop()
Example #12
0
def show_or_exit(key):
    if key in ('q', 'Q'):
        raise urwid.ExitMainLoop()
Example #13
0
		def ok_pressed(*args, **kwargs):
			raise urwid.ExitMainLoop()
Example #14
0
File: install.py Project: ri0t/hfos
 def exit_on_q(key):
     if key in ('q', 'Q'):
         raise urwid.ExitMainLoop()
Example #15
0
 def _close(*args):
     raise urwid.ExitMainLoop()
Example #16
0
    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
Example #17
0
def unhandled_input(key):
    if key in ('q', 'Q'):
        raise urwid.ExitMainLoop()
Example #18
0
 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)
Example #19
0
def generate_gif(button):
    raise urwid.ExitMainLoop()
Example #20
0
 def exit():
     raise urwid.ExitMainLoop()
Example #21
0
def exit(button):
    global index
    index = None
    raise urwid.ExitMainLoop()
def keypress(key):
    if key in ("q", "Q", "esc"):
        raise urwid.ExitMainLoop()
Example #23
0
def show_or_exit(key):
    if key in ('q','Q'):
        raise urwid.ExitMainLoop()
    txt.set_text(repr(key))
Example #24
0
    def handle_input(self, key):

        # Module specific key
        if key == 'ctrl x':
            raise urwid.ExitMainLoop()
Example #25
0
 def keypress(key):
     if key in ('q', 'Q'):
         raise urwid.ExitMainLoop()
Example #26
0
 def quitter(self, touche):
     if touche in ('q', 'Q'):
         raise urwid.ExitMainLoop()
Example #27
0
 def exit(self):
     self.active = False
     raise urwid.ExitMainLoop()
Example #28
0
File: ui.py Project: rayx/pypick
 def global_keypress(self, key):
     if key in ('q', 'esc'):
         raise urwid.ExitMainLoop()
Example #29
0
def exit_program(button):
    raise urwid.ExitMainLoop()
def show_or_exit(key):
    if key in ("q", "Q"):
        raise urwid.ExitMainLoop()