spack.cmd.modules package

Submodules

spack.cmd.modules.lmod module

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

Set the default module file, when multiple are present

spack.cmd.modules.tcl module

spack.cmd.modules.tcl.add_command(parser, command_dict)

Module contents

Implementation details of the spack module command.

exception spack.cmd.modules.MultipleSpecsMatch

Bases: Exception

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

exception spack.cmd.modules.NoSpecMatches

Bases: Exception

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

spack.cmd.modules.add_loads_arguments(subparser)
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.find(module_type, specs, args)

Retrieve paths or use names of module files

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

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>})
spack.cmd.modules.one_spec_or_raise(specs)

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

spack.cmd.modules.refresh(module_type, specs, args)

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

spack.cmd.modules.rm(module_type, specs, args)

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

spack.cmd.modules.setup_parser(subparser)