MCPcopy Create free account
hub / github.com/ImageEngine/cortex / __walk

Method __walk

python/IECore/SequenceLsOp.py:183–210  ·  view source on GitHub ↗
(top, topdown=True, followlinks=False)

Source from the content-addressed store, hash-verified

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 ) :

Callers 1

doOperationMethod · 0.80

Calls 2

joinFunction · 0.85
appendMethod · 0.80

Tested by

no test coverage detected