コード例 #1
0
 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
コード例 #2
0
ファイル: filename.py プロジェクト: stefanholek/kmd
 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
コード例 #3
0
ファイル: filename.py プロジェクト: sim-pdf/kmd
 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
コード例 #4
0
ファイル: filename.py プロジェクト: stefanholek/rl
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
コード例 #5
0
ファイル: test_callhooks.py プロジェクト: tony/rl
def filecomplete(text):
    return completion.complete_filename(text)
コード例 #6
0
ファイル: test_callhooks.py プロジェクト: stefanholek/rl
def filecomplete(text):
    return completion.complete_filename(text)
コード例 #7
0
def completefilename(text):
    # Use the built-in filename completion
    return completion.complete_filename(text)
コード例 #8
0
ファイル: test_quoting.py プロジェクト: sim-pdf/kmd
def completefilename(text):
    # Use the built-in filename completion
    return completion.complete_filename(text)