コード例 #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
ファイル: console.py プロジェクト: ecustlin/DrozerFuzz
 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 []