(top, topdown=True, followlinks=False)
| 181 | |
| 182 | @staticmethod |
| 183 | def __walk(top, topdown=True, followlinks=False): |
| 184 | |
| 185 | from os.path import join, isdir, islink |
| 186 | from os import listdir, error |
| 187 | |
| 188 | try: |
| 189 | names = listdir(top) |
| 190 | except error : |
| 191 | return |
| 192 | |
| 193 | dirs, nondirs = [], [] |
| 194 | for name in names: |
| 195 | if isdir(join(top, name)): |
| 196 | dirs.append(name) |
| 197 | else: |
| 198 | nondirs.append(name) |
| 199 | |
| 200 | if topdown: |
| 201 | yield top, dirs, nondirs |
| 202 | |
| 203 | for name in dirs: |
| 204 | path = join(top, name) |
| 205 | if followlinks or not islink(path): |
| 206 | for x in IECore.SequenceLsOp.__walk(path, topdown, followlinks): |
| 207 | yield x |
| 208 | |
| 209 | if not topdown: |
| 210 | yield top, dirs, nondirs |
| 211 | |
| 212 | |
| 213 | def doOperation( self, operands ) : |
no test coverage detected