craftr.ext

class craftr.ext.CraftrImporter(session)[source]

Meta-path import hook for importing Craftr modules from the craftr.ext parent namespace. Only functions inside a session context.

find_module(fullname, path=None)[source]

PEP 0302 – New Import Hooks

import_file(filename)[source]

Imports a Craftr module by filename. Raises ImportError if filename is not a Craftr module or if the file is not the same as would be imported when importing it by its module identifier.

update(force=False)[source]

Should be called if sys.path or Session.path has been changed to rebuild the module cache and delay-load virtual modules if a physical was found.

class craftr.ext.CraftrLoader(kind, filename, session)[source]

Loader class created by the :class:CraftrImporter.

load_module(fullname)[source]

PEP 0302 – New Import Hooks

craftr.ext.get_module_ident(filename)[source]

Extracts the module identifier from file at the specified filename and returns it, or None if the file does not contain a craftr_module(...) declaration in the first comment-block.