pyirk.irkloader

Module Contents

Functions

preserve_cwd

This is a decorator that ensures that the current working directory is unchanged during the function call.

delete_bytecode_files

load_mod_from_path

:param modpath: file system path for the module to be loaded :param prefix: prefix which can be used to replace the URI for convenience :param modname: :param allow_reload: flag; if False, an error is raised if the module was already loaded :param smart_relative: flag; if True, relative paths are interpreted w.r.t. the calling module (not w.r.t. current working path) :param reuse_loaded: flag; if True and the module was already loaded before, then just use this if False:: reload; if None use the default action from pyirk.ds :param delete_bytecode: flag; if true delete the matching content of pycache :return:

_load_mod_from_path

see docstring of load_mod_from_path

_cleanup

Clean up some data structures if something went wrong during module load. This helps to keep the tests independent.

Data

ModuleType

API

pyirk.irkloader.ModuleType

‘type(…)’

pyirk.irkloader.preserve_cwd(function)

This is a decorator that ensures that the current working directory is unchanged during the function call.

pyirk.irkloader.delete_bytecode_files(modpath)
pyirk.irkloader.load_mod_from_path(modpath: str, prefix: str, modname=None, allow_reload=True, smart_relative=None, reuse_loaded=None, delete_bytecode=None) pyirk.irkloader.ModuleType

:param modpath: file system path for the module to be loaded :param prefix: prefix which can be used to replace the URI for convenience :param modname: :param allow_reload: flag; if False, an error is raised if the module was already loaded :param smart_relative: flag; if True, relative paths are interpreted w.r.t. the calling module (not w.r.t. current working path) :param reuse_loaded: flag; if True and the module was already loaded before, then just use this if False:: reload; if None use the default action from pyirk.ds :param delete_bytecode: flag; if true delete the matching content of pycache :return:

pyirk.irkloader._load_mod_from_path(modpath: str, prefix: str, modname=None, allow_reload=True, smart_relative=None, reuse_loaded=False) pyirk.irkloader.ModuleType

see docstring of load_mod_from_path

pyirk.irkloader._cleanup(mod_uri, modname, original_loaded_mod_uris)

Clean up some data structures if something went wrong during module load. This helps to keep the tests independent.