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

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

        # Module specific key
        if key == 'ctrl x':
            raise urwid.ExitMainLoop()
예제 #25
0
파일: main.py 프로젝트: mgk/humu-download
 def keypress(key):
     if key in ('q', 'Q'):
         raise urwid.ExitMainLoop()
예제 #26
0
 def quitter(self, touche):
     if touche in ('q', 'Q'):
         raise urwid.ExitMainLoop()
예제 #27
0
파일: app.py 프로젝트: swipswaps/Congruence
 def exit(self):
     self.active = False
     raise urwid.ExitMainLoop()
예제 #28
0
파일: ui.py 프로젝트: rayx/pypick
 def global_keypress(self, key):
     if key in ('q', 'esc'):
         raise urwid.ExitMainLoop()
예제 #29
0
def exit_program(button):
    raise urwid.ExitMainLoop()
def show_or_exit(key):
    if key in ("q", "Q"):
        raise urwid.ExitMainLoop()