def completer(self): """Command completer. If cursor is after path, returns PathCompleter or GlobCompleter """ if self._path is not None: return PathCompleter(self._path) else: try: curDir = os.getcwd() except: return None return PathCompleter(curDir + '/')
def completer(self): """Command Completer. Return PathCompleter. """ if self._path is not None: return PathCompleter(self._path) else: try: curDir = os.getcwd() except: return None return PathCompleter(curDir + '/')
def completer(self, text, pos): """Command Completer. Returns PathCompleter, if cursor stays after path """ if pos == self._pathLocation + len(self._path) or \ (not self._path and pos == len(text)): return PathCompleter(self._path, pos - self._pathLocation) else: return None