def METHOD_NAME(self, path=None, ftype=''):
    "Perform completion of filesystem path."
    if not path:
        return self._listdir('.')
    dirname, rest = os.path.split(path)
    tmp = os.path.expanduser(dirname) if dirname else '.'
    res = [
        os.path.join(dirname, p)
        for p in self._listdir(tmp) if p.startswith(rest)
    ]
    # filter list by extention
    res = [p for p in res if p.endswith((ftype, '/'))]
    if len(res) == 1 and os.path.isdir(os.path.expanduser(res[-1])):
        # resolved to a single directory, so return list of files below it
        subdirs = self.METHOD_NAME(res[-1])
        return subdirs + res
    if len(res) > 1 or not os.path.exists(path):
        # more than one match, or single match which does not exist (typo)
        return res
    if os.path.isfile(path):
        # exact file match terminates this completion
        return [path + ' ']
    return [path]