'Perform completion of filesystem path.'

def _complete_path(self, path=None):

    if (not path):
        return os.listdir('.')
    (dirname, rest) = os.path.split(path)
    tmp = (dirname if dirname else '.')
    res = [os.path.join(dirname, p) for p in os.listdir(tmp) if p.startswith(rest)]
    if ((len(res) > 1) or (not os.path.exists(path))):
        return res
    if os.path.isdir(path):
        return [os.path.join(path, p) for p in os.listdir(path)]
    return [(path + '    ')]
