예제 #1
0
 def get_completion_suggestions(self, action, text, line, **kwargs):
     if action.dest == "server":
         return ["localhost:31415"]
     elif action.dest == "file":
         return path_completion.complete(text)
     elif action.dest == "resource":
         return ["/view.jsp"]
예제 #2
0
파일: server.py 프로젝트: 601040605/drozer
 def get_completion_suggestions(self, action, text, line, **kwargs):
     if action.dest == "server":
         return ["localhost:31415"]
     elif action.dest == "file":
         return path_completion.complete(text)
     elif action.dest == "resource":
         return ["/view.jsp"]
예제 #3
0
파일: console.py 프로젝트: Syi/mercury
 def get_completion_suggestions(self, action, text, **kwargs):
     if action.dest == "server":
         return ["localhost:31415"]
     elif action.dest == "file":
         return path_completion.complete(text)
     elif action.dest == "device":
         return None
     elif action.dest == "onecmd":
         return None
예제 #4
0
 def get_completion_suggestions(self, action, text, line, **kwargs):
     if action.dest == "server":
         return ["localhost:31415"]
     elif action.dest == "file":
         return path_completion.complete(text)
     elif action.dest == "device":
         return None
     elif action.dest == "onecmd":
         return None
예제 #5
0
 def __get_suggestions_for(self, action, text, line, **kwargs):
     """
     Calculate suggestions for a particular action, given some initial text.
     Where possible, this method provides the suggestions itself, otherwise
     it defers to the suggestion provider.
     """
     if action.choices != None:                          # this is pick-from-a-list
         suggestions = action.choices
     elif isinstance(action.type, argparse.FileType):    # this is local path completion
         suggestions = path_completion.complete(text)
     else:                                               # we don't know, defer to the provider
         suggestions = self.provider.get_completion_suggestions(action, text, line, **kwargs)
     
     if suggestions != None:
         return suggestions
     else:
         return []