Lines Matching +full:module +full:- +full:importer
29 """Make a trivial single-dispatch generic function"""
75 'prefix' is a string to output on the front of every module name
102 for importer, name, ispkg in iter_modules(path, prefix):
103 yield importer, name, ispkg
128 or, if path is None, all top-level modules on sys.path.
133 'prefix' is a string to output on the front of every module name
151 def iter_importer_modules(importer, prefix=''): argument
152 if not hasattr(importer, 'iter_modules'):
154 return importer.iter_modules(prefix)
160 """PEP 302 Importer that wraps Python's "classic" import algorithm
162 ImpImporter(dirname) produces a PEP 302 importer that searches that
163 directory. ImpImporter(None) produces a PEP 302 importer that searches
164 the current sys.path, plus any modules that are frozen or built-in.
175 subname = fullname.split(".")[-1]
199 filenames.sort() # handle packages before same-named modules
247 # Note: we don't set __loader__ because we want the module to look
267 raise ImportError("Loader for module %s cannot handle "
268 "module %s" % (self.fullname, fullname))
303 if os.path.exists(self.filename[:-1]):
304 f = open(self.filename[:-1], 'rU')
329 def iter_zipimport_modules(importer, prefix=''): argument
330 dirlist = zipimport._zip_directory_cache[importer.archive].keys()
332 _prefix = importer.prefix
365 """Retrieve a PEP 302 importer for the given path item
367 The returned importer is cached in sys.path_importer_cache
370 If there is no importer, a wrapper around the basic import
372 the importer cache (None is inserted instead).
378 importer = sys.path_importer_cache[path_item]
382 importer = path_hook(path_item)
387 importer = None
388 sys.path_importer_cache.setdefault(path_item, importer)
390 if importer is None:
392 importer = ImpImporter(path_item)
394 importer = None
395 return importer
399 """Yield PEP 302 importers for the given module name
404 the named module is in a package, that package is imported as a side
414 be a module or package name that is accessible via both sys.path
423 raise ImportError("Relative module names not supported")
426 pkg = '.'.join(fullname.split('.')[:-1])
431 for importer in sys.meta_path:
432 yield importer
442 If the module or package is accessible via the normal import
444 is returned. Returns None if the module cannot be found or imported.
445 If the named module is not already imported, its containing package
449 limitations regarding platform-specific special import locations such
455 module = module_or_name
456 loader = getattr(module, '__loader__', None)
459 fullname = module.__name__
468 Returns None if the module cannot be found or imported. This function uses
470 platform-specific special import locations such as the Windows registry.
472 for importer in iter_importers(fullname):
473 loader = importer.find_module(fullname)
495 except that it doesn't special-case lines starting with 'import'.
507 are not (unicode or 8-bit) strings referring to existing
531 # case-insensitive filesystems
558 argument should be the name of a package, in standard module format
584 # signature - an os.path format "filename" starting with the dirname of