Пример #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
 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
 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 []