def listdir(self, fil=None, sort=None): |
""" return a sequence of Paths. |
|
listdir will return either a tuple or a list of paths |
depending on implementation choices. |
""" |
if isinstance(fil, str): |
fil = common.fnmatch(fil) |
|
def notsvn(path): |
return path.basename != '.svn' |
|
paths = [] |
for localpath in self.localpath.listdir(notsvn): |
p = self.__class__(localpath) |
paths.append(p) |
|
if fil or sort: |
paths = filter(fil, paths) |
paths = isinstance(paths, list) and paths or list(paths) |
if callable(sort): |
paths.sort(sort) |
elif sort: |
-> paths.sort() |
return paths |