예제 #1
0
파일: base.py 프로젝트: khairy/editxt
def load_options(command, history):
    predicate = make_command_predicate(command)
    argstr = next(history.iter_matching(predicate), None)
    if argstr is not None:
        try:
            return command.parse(argstr)
        except Exception:
            log.warn("cannot load options: %s", argstr, exc_info=True)
    return command.arg_parser.default_options()
예제 #2
0
파일: base.py 프로젝트: khairy/editxt
def load_options(command, history):
    predicate = make_command_predicate(command)
    argstr = next(history.iter_matching(predicate), None)
    if argstr is not None:
        try:
            return command.parse(argstr)
        except Exception:
            log.warn("cannot load options: %s", argstr, exc_info=True)
    return command.arg_parser.default_options()
예제 #3
0
파일: find.py 프로젝트: editxt/editxt
 def recent_finds(self):
     predicate = make_command_predicate(find)
     items = self.app.text_commander.history.iter_matching(predicate)
     result = []
     for i, item in enumerate(items):
         if i < 10:
             result.append(item)
         else:
             break
     return result
예제 #4
0
 def recent_finds(self):
     # HACK global resource
     predicate = make_command_predicate(find)
     items = editxt.app.text_commander.history.iter_matching(predicate)
     result = []
     for i, item in enumerate(items):
         if i < 10:
             result.append(item)
         else:
             break
     return result