Import Hooks (xonsh.imphooks
)¶
Import hooks for importing xonsh source files.
This module registers the hooks it defines when it is imported.
-
class
xonsh.imphooks.
XonshImportEventHook
(*args, **kwargs)[source]¶ Implements the import hook for firing xonsh events on import.
-
class
xonsh.imphooks.
XonshImportEventLoader
(loader)[source]¶ A class that dispatches loader calls to another loader and fires relevant xonsh events.
-
class
xonsh.imphooks.
XonshImportHook
(*args, **kwargs)[source]¶ Implements the import hook for xonsh source files.
-
execer
¶
-
-
xonsh.imphooks.
find_source_encoding
(src)[source]¶ Finds the source encoding given bytes representing a file. If no encoding is found, UTF-8 will be returned as per the docs https://docs.python.org/3/howto/unicode.html#unicode-literals-in-python-source-code
-
xonsh.imphooks.
install_hook
()¶ Install Xonsh import hooks in
sys.meta_path
in order for.xsh
files to be importable and import events to be fired.Can safely be called many times, will be no-op if xonsh import hooks are already present.