Example #1
0
File: email.py Project: tony/rl
def complete_email(text):
    # Dispatch to username or hostname completion
    if text.startswith('@'):
        return complete_hostname(text)
    else:
        completion.append_character = '@'
        return completion.complete_username(text)
Example #2
0
    def __call__(self, text):
        """Return user names matching 'text'.

        User names are returned without decoration.
        The search string may start with a '~' character, in which case
        the users' home directories are returned instead.
        Home directories start with a '~' and end with a '/' character.
        """
        return completion.complete_username(text)
Example #3
0
    def __call__(self, text):
        """Return user names matching ``text``.

        User names are returned without decoration.
        The search string may start with a ``~`` character, in which case
        the users' home directories are returned instead.
        Home directories start with a ``~`` and end with a ``/`` character.
        """
        return completion.complete_username(text)
Example #4
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)
     return matches
Example #5
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)
     return matches
Example #6
0
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
Example #7
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