Lines Matching full:path
54 :ref:`sys-path-init`
55 The initialization of :data:`sys.path`.
130 .. function:: find_loader(name, path=None)
132 Find the loader for a module, optionally within the specified *path*. If the
141 argument to *path*.
163 Namespace packages created/installed in a different :data:`sys.path`
268 .. abstractmethod:: find_module(fullname, path=None)
272 for use in :data:`sys.meta_path` and in the path-based import subsystem.
285 An abstract base class representing a :term:`meta path finder`.
292 .. method:: find_spec(fullname, path, target=None)
295 the specified module. If this is a top-level import, *path* will
297 module and *path* will be the value of :attr:`__path__` from the
306 .. method:: find_module(fullname, path)
309 module. If this is a top-level import, *path* will be ``None``.
310 Otherwise, this is a search for a subpackage or module and *path*
337 An abstract base class representing a :term:`path entry finder`. Though
339 is meant for use only within the path-based import subsystem provided
351 within the :term:`path entry` to which it is assigned. If a spec
469 in the same way as :attr:`sys.path` but just for the package.
521 .. abstractmethod:: get_data(path)
523 An abstract method to return the bytes for the data located at *path*.
527 to the data stored. :exc:`OSError` is to be raised if the *path* cannot
528 be found. The *path* is expected to be constructed using a module's
577 .. staticmethod:: source_to_code(data, path='<string>')
582 supports (i.e. string or bytes). The *path* argument should be
583 the "path" to where the source code originated from, which can be an
617 the specified module. If no path is available, :exc:`ImportError` is
620 If source code is available, then the method should return the path to
628 .. class:: FileLoader(fullname, path)
635 to handle. The *path* argument is the path to the file for the module.
643 .. attribute:: path
645 Path to the file of the module.
656 Returns :attr:`path`.
658 .. abstractmethod:: get_data(path)
660 Reads *path* as a binary file and returns the bytes from it.
671 Should only return the path to the source file; sourceless
683 .. method:: path_stats(path)
686 metadata about the specified path. Supported dictionary keys are:
693 extensions. If the path cannot be handled, :exc:`OSError` is raised.
700 .. method:: path_mtime(path)
703 specified path.
708 purposes. Raise :exc:`OSError` if the path cannot be handled.
713 .. method:: set_data(path, data)
716 path. Any intermediate directories which do not exist are to be created
719 When writing to the path fails because the path is read-only
750 is determined to be a package if its file path (as provided by
757 :mod:`importlib.machinery` -- Importers and path hooks
761 :synopsis: Importers and path hooks
818 helper for code which simply needs to know if a filesystem path
871 A :term:`Finder <finder>` for :data:`sys.path` and package ``__path__`` attributes.
877 .. classmethod:: find_spec(fullname, path=None, target=None)
880 for the module specified by *fullname* on :data:`sys.path` or, if
881 defined, on *path*. For each path entry that is searched,
883 is found then it is used as the :term:`path entry finder` to look
886 searched for a finder for the path entry and, if found, is stored
898 .. classmethod:: find_module(fullname, path=None)
920 .. class:: FileFinder(path, *loader_details)
925 The *path* argument is the directory for which the finder is in charge of
931 the module's name and the path to the file found.
945 .. attribute:: path
947 The path the finder will search in.
951 Attempt to find the spec to handle *fullname* within :attr:`path`.
957 Attempt to find the loader to handle *fullname* within :attr:`path`.
970 path argument given to the closure directly and *loader_details*
977 .. class:: SourceFileLoader(fullname, path)
989 .. attribute:: path
991 The path to the source file.
995 Return ``True`` if :attr:`path` appears to be for a package.
997 .. method:: path_stats(path)
1001 .. method:: set_data(path, data)
1015 .. class:: SourcelessFileLoader(fullname, path)
1031 .. attribute:: path
1033 The path to the bytecode file.
1037 Determines if the module is a package based on :attr:`path`.
1041 Returns the code object for :attr:`name` created from :attr:`path`.
1058 .. class:: ExtensionFileLoader(fullname, path)
1064 support. The *path* argument is the path to the extension module's file.
1072 .. attribute:: path
1074 Path to the extension module.
1091 Returns ``True`` if the file path points to a package's ``__init__``
1104 Returns :attr:`path`.
1109 .. class:: NamespaceLoader(name, path, path_finder):
1226 .. function:: cache_from_source(path, debug_override=None, *, optimization=None)
1228 Return the :pep:`3147`/:pep:`488` path to the byte-compiled file associated
1229 with the source *path*. For example, if *path* is ``/foo/bar/baz.py`` the return
1238 bytecode path of ``/foo/bar/__pycache__/baz.cpython-32.pyc``. ``None`` causes
1241 ``2`` will lead to the bytecode path of
1258 Accepts a :term:`path-like object`.
1261 .. function:: source_from_cache(path)
1263 Given the *path* to a :pep:`3147` file name, return the associated source code
1264 file path. For example, if *path* is
1265 ``/foo/bar/__pycache__/baz.cpython-32.pyc`` the returned path would be
1266 ``/foo/bar/baz.py``. *path* need not exist, however if it does not conform
1274 Accepts a :term:`path-like object`.
1417 instance based on the path to a file. Missing information will be filled in
1424 Accepts a :term:`path-like object`.
1473 finder = importlib.machinery.FileFinder(path, (lazy_loader, suffixes))
1568 your needs: a :term:`meta path finder` or a :term:`path entry finder`. The
1570 you create using a :term:`path entry hook` on :attr:`sys.path_hooks` which works
1571 with :attr:`sys.path` entries to potentially create a finder. This example will
1585 # Setting up a meta path finder.
1590 # Setting up a path entry finder.
1591 # Make sure to put the path hook in the proper location in the list in terms
1616 path = None
1620 path = parent_module.__spec__.submodule_search_locations
1622 spec = finder.find_spec(absolute_name, path)
1631 if path is not None: