MCPcopy Create free account
hub / github.com/twisted/twisted / _packagePaths

Method _packagePaths

src/twisted/python/modules.py:418–437  ·  view source on GitHub ↗

Yield a sequence of FilePath-like objects which represent path segments.

(self)

Source from the content-addressed store, hash-verified

416 return self.name + "." + mn
417
418 def _packagePaths(self):
419 """
420 Yield a sequence of FilePath-like objects which represent path segments.
421 """
422 if not self.isPackage():
423 return
424 if self.isLoaded():
425 load = self.load()
426 if hasattr(load, "__path__"):
427 for fn in load.__path__:
428 if fn == self.parentPath.path:
429 # this should _really_ exist.
430 assert self.parentPath.exists()
431 yield self.parentPath
432 else:
433 smp = self.pathEntry.pythonPath._smartPath(fn)
434 if smp.exists():
435 yield smp
436 else:
437 yield self.parentPath
438
439
440class PathEntry(_ModuleIteratorHelper):

Callers

nothing calls this directly

Calls 5

isPackageMethod · 0.95
isLoadedMethod · 0.95
loadMethod · 0.95
_smartPathMethod · 0.80
existsMethod · 0.45

Tested by

no test coverage detected