utils.imports

Utilities related to importing modules and symbols by name.

Module Contents

Classes

NotAPackage() Raised when importing a package, but it’s not a package.

Functions

qualname(obj) Return object name.
qualname(obj) Return object name.
instantiate(name,*args,**kwargs) Instantiate class by name.
cwd_in_path() Context adding the current working directory to sys.path.
find_module(module,path=None,imp=None) Version of imp.find_module() supporting dots.
import_from_cwd(module,imp=None,package=None) Import module, temporarily including modules in the current directory.
reload_from_cwd(module,reloader=None) Reload module (ensuring that CWD is in sys.path).
module_file(module) Return the correct original file name of a module.
gen_task_name(app,name,module_name) Generate task name from name/module pair.
load_extension_class_names(namespace)
load_extension_classes(namespace)
class NotAPackage

Raised when importing a package, but it’s not a package.

qualname(obj)

Return object name.

qualname(obj)

Return object name.

instantiate(name, *args, **kwargs)

Instantiate class by name.

See Also:
symbol_by_name().
cwd_in_path()

Context adding the current working directory to sys.path.

find_module(module, path=None, imp=None)

Version of imp.find_module() supporting dots.

import_from_cwd(module, imp=None, package=None)

Import module, temporarily including modules in the current directory.

Modules located in the current directory has precedence over modules located in sys.path.

reload_from_cwd(module, reloader=None)

Reload module (ensuring that CWD is in sys.path).

module_file(module)

Return the correct original file name of a module.

gen_task_name(app, name, module_name)

Generate task name from name/module pair.

load_extension_class_names(namespace)
load_extension_classes(namespace)