Пример #1
0
 def input(self, key):
     if key in self.keymap:
         self.keymap[key]()
     elif util.mbslen(key) == 1:
         self.insert(key)
     else:
         return True
Пример #2
0
 def input(self, key):
     if key in self.keymap:
         self.keymap[key]()
     else:
         if key == "SPC":
             self.insert(" ")
         elif util.mbslen(key) == 1:
             self.insert(key)
Пример #3
0
 def start(self, mode, text="", pos=-1):
     self.mode = mode
     self.settext(text)
     self.show()
     self.prompt = self.mode.prompt
     if pos >= 0:
         self.cursor = pos
     else:
         self.cursor = util.mbslen(self.text) + 1 + pos
     self.history.start()
Пример #4
0
 def input(self, key):
     if key in self.keymap:
         self.keymap[key]()
     elif key == "SPC":
         self.textbox.insert(" ")
     elif util.mbslen(key) == 1:
         self.textbox.insert(key)
     else:
         self.finish()
         self.cmdline.input(key)
Пример #5
0
    def insert(self, entry=None):
        if entry is None:
            entry = self.cursor_entry()
        escape = False
        if self.cmdline.mode.__class__.__name__ == "Shell" and \
                not self.parser.now_in_quote() and \
                not isinstance(entry, Argument):
            escape = True

        text = entry.match(self.parser.part[1])
        if escape:
            text = util.string_to_safe(text)

        self.cmdline.settext(self.parser.part[0] + text + self.parser.part[2])
        self.cmdline.cursor = util.mbslen(self.parser.part[0]+text)
        self.finish()
Пример #6
0
 def setbottom(self):
     self.cursor = util.mbslen(self.text)