diff options
author | Todd Gamblin <tgamblin@llnl.gov> | 2016-03-07 02:39:14 -0800 |
---|---|---|
committer | Todd Gamblin <tgamblin@llnl.gov> | 2016-03-07 02:39:14 -0800 |
commit | 12ddf241a53f85d871c981307e5f682d2e979c75 (patch) | |
tree | 616f93dd985856d3b0307093308b7b0c0990f89e | |
parent | 108277fb5dc648c0e93fbd22e6ea6613329acc9d (diff) | |
download | spack-12ddf241a53f85d871c981307e5f682d2e979c75.tar.gz spack-12ddf241a53f85d871c981307e5f682d2e979c75.tar.bz2 spack-12ddf241a53f85d871c981307e5f682d2e979c75.tar.xz spack-12ddf241a53f85d871c981307e5f682d2e979c75.zip |
Fix code block in docs.
-rw-r--r-- | lib/spack/spack/multimethod.py | 36 |
1 files changed, 19 insertions, 17 deletions
diff --git a/lib/spack/spack/multimethod.py b/lib/spack/spack/multimethod.py index 51c6a8e89d..3cd17e796a 100644 --- a/lib/spack/spack/multimethod.py +++ b/lib/spack/spack/multimethod.py @@ -138,7 +138,7 @@ class when(object): methods like install() that depend on the package's spec. For example: - .. code-block:: + .. code-block:: python class SomePackage(Package): ... @@ -163,26 +163,28 @@ class when(object): if you only have part of the install that is platform specific, you could do this: - class SomePackage(Package): - ... - # virtual dependence on MPI. - # could resolve to mpich, mpich2, OpenMPI - depends_on('mpi') + .. code-block:: python - def setup(self): - # do nothing in the default case - pass + class SomePackage(Package): + ... + # virtual dependence on MPI. + # could resolve to mpich, mpich2, OpenMPI + depends_on('mpi') - @when('^openmpi') - def setup(self): - # do something special when this is built with OpenMPI for - # its MPI implementations. + def setup(self): + # do nothing in the default case + pass + @when('^openmpi') + def setup(self): + # do something special when this is built with OpenMPI for + # its MPI implementations. - def install(self, prefix): - # Do common install stuff - self.setup() - # Do more common install stuff + + def install(self, prefix): + # Do common install stuff + self.setup() + # Do more common install stuff There must be one (and only one) @when clause that matches the package's spec. If there is more than one, or if none match, |