spack.cmd.modules package

Implementation details of the spack module command.

exception spack.cmd.modules.MultipleSpecsMatch[source]

Bases: Exception

Raised when multiple specs match a constraint, in a context where this is not allowed.

exception spack.cmd.modules.NoSpecMatches[source]

Bases: Exception

Raised when no spec matches a constraint, in a context where this is not allowed.

spack.cmd.modules.add_loads_arguments(subparser)[source]
spack.cmd.modules.callbacks = {'find': <function find>, 'loads': <function loads>, 'refresh': <function refresh>, 'rm': <function rm>}

Dictionary populated with the list of sub-commands. Each sub-command must be callable and accept 3 arguments:

  • module_type: the type of module it refers to

  • specs : the list of specs to be processed

  • args : namespace containing the parsed command line arguments

spack.cmd.modules.check_module_set_name(name)[source]
spack.cmd.modules.find(module_type, specs, args)[source]

Retrieve paths or use names of module files

spack.cmd.modules.loads(module_type, specs, args, out=None)[source]

Prompt the list of modules associated with a list of specs

spack.cmd.modules.modules_cmd(parser, args, module_type, callbacks={'find': <function find>, 'loads': <function loads>, 'refresh': <function refresh>, 'rm': <function rm>})[source]
spack.cmd.modules.one_spec_or_raise(specs)[source]

Ensures exactly one spec has been selected, or raises the appropriate exception.

spack.cmd.modules.refresh(module_type, specs, args)[source]

Regenerates the module files for every spec in specs and every module type in module types.

spack.cmd.modules.rm(module_type, specs, args)[source]

Deletes the module files associated with every spec in specs, for every module type in module types.

spack.cmd.modules.setup_parser(subparser)[source]

Submodules

spack.cmd.modules.lmod module

spack.cmd.modules.lmod.add_command(parser, command_dict)[source]
spack.cmd.modules.lmod.setdefault(module_type, specs, args)[source]

set the default module file, when multiple are present

spack.cmd.modules.tcl module

spack.cmd.modules.tcl.add_command(parser, command_dict)[source]
spack.cmd.modules.tcl.setdefault(module_type, specs, args)[source]

set the default module file, when multiple are present