def __call__(self, text): """Return filenames matching 'text'. Starts at the current working directory. """ matches = [] # Dequoting early allows us to skip some hooks if completion.found_quote: text = self.dequote_filename(text, completion.quote_character) if text.startswith('~') and (os.sep not in text): matches = completion.complete_username(text) if not matches: matches = completion.complete_filename(text) # HFS Plus uses "decomposed" UTF-8 if sys.platform == 'darwin': if not matches: matches = completion.complete_filename(decompose(text)) matches = [compose(x) for x in matches] return matches
def __call__(self, text): """Return filenames matching ``text``. Starts at the current working directory. """ matches = [] # Dequoting early allows us to skip some hooks if completion.found_quote: text = self.dequote_filename(text, completion.quote_character) if text.startswith('~') and (os.sep not in text): matches = completion.complete_username(text) if not matches: matches = completion.complete_filename(text) return matches
def complete_filename(text): matches = [] # Dequote immediately to avoid a tilde-expansion bug. This # also simplifies subsequent hooks. if completion.found_quote: text = dequote_filename(text, completion.quote_character) # Complete usernames if text.startswith('~') and '/' not in text: matches = completion.complete_username(text) # Complete filenames if not matches: matches = completion.complete_filename(text) return matches
def filecomplete(text): return completion.complete_filename(text)
def completefilename(text): # Use the built-in filename completion return completion.complete_filename(text)