• Home
  • Raw
  • Download

Lines Matching +full:module +full:- +full:importer

23 ModuleInfo.__doc__ = 'A namedtuple with minimal info about a module.'
27 """Return the finder-specific module spec."""
60 'prefix' is a string to output on the front of every module name
112 or, if path is None, all top-level modules on sys.path.
117 'prefix' is a string to output on the front of every module name
137 def iter_importer_modules(importer, prefix=''): argument
138 if not hasattr(importer, 'iter_modules'):
140 return importer.iter_modules(prefix)
144 def _iter_file_finder_modules(importer, prefix=''): argument
145 if importer.path is None or not os.path.isdir(importer.path):
151 filenames = os.listdir(importer.path)
155 filenames.sort() # handle packages before same-named modules
162 path = os.path.join(importer.path, fn)
199 the current sys.path, plus any modules that are frozen or built-in.
215 subname = fullname.split(".")[-1]
239 filenames.sort() # handle packages before same-named modules
291 # Note: we don't set __loader__ because we want the module to look
311 raise ImportError("Loader for module %s cannot handle "
312 "module %s" % (self.fullname, fullname))
347 if os.path.exists(self.filename[:-1]):
348 with open(self.filename[:-1], 'r') as f:
373 def iter_zipimport_modules(importer, prefix=''): argument
374 dirlist = sorted(zipimport._zip_directory_cache[importer.archive])
375 _prefix = importer.prefix
418 importer = sys.path_importer_cache[path_item]
422 importer = path_hook(path_item)
423 sys.path_importer_cache.setdefault(path_item, importer)
428 importer = None
429 return importer
433 """Yield finders for the given module name
439 If the named module is in a package, that package is imported as a side
442 If no module name is specified, all top level finders are produced.
445 msg = "Relative module name {!r} not supported".format(fullname)
464 Returns None if the module cannot be found or imported.
465 If the named module is not already imported, its containing package
473 module = module_or_name
474 loader = getattr(module, '__loader__', None)
477 if getattr(module, '__spec__', None) is None:
479 fullname = module.__name__
493 msg = "Relative module name {!r} not supported".format(fullname)
521 except that it doesn't special-case lines starting with 'import'.
533 are not (unicode or 8-bit) strings referring to existing
576 # case-insensitive filesystems
604 argument should be the name of a package, in standard module format
635 # signature - an os.path format "filename" starting with the dirname of
651 for a literal period in these pseudo-regexes:
667 it ends with the colon, then a module object is returned.
669 The function will return an object (which might be a module), or raise one
672 ValueError - if `name` isn't in a recognised format
673 ImportError - if an import failed when it shouldn't have
674 AttributeError - if a failure occurred when traversing the object hierarchy
691 # there is a colon - a one-step import is all that's needed
696 # no colon - have to iterate to find the package boundary
699 # first part *must* be a module/package.
710 # if we reach this point, mod is the module, already imported, and
712 # an empty list if just the module is wanted.