Fix code block in docs.

This commit is contained in:
Todd Gamblin 2016-03-07 02:39:14 -08:00
parent 108277fb5d
commit 12ddf241a5

View File

@ -138,7 +138,7 @@ class when(object):
methods like install() that depend on the package's spec. methods like install() that depend on the package's spec.
For example: For example:
.. code-block:: .. code-block:: python
class SomePackage(Package): class SomePackage(Package):
... ...
@ -163,26 +163,28 @@ def install(self, prefix):
if you only have part of the install that is platform specific, you if you only have part of the install that is platform specific, you
could do this: could do this:
class SomePackage(Package): .. code-block:: python
...
# virtual dependence on MPI.
# could resolve to mpich, mpich2, OpenMPI
depends_on('mpi')
def setup(self): class SomePackage(Package):
# do nothing in the default case ...
pass # virtual dependence on MPI.
# could resolve to mpich, mpich2, OpenMPI
depends_on('mpi')
@when('^openmpi') def setup(self):
def setup(self): # do nothing in the default case
# do something special when this is built with OpenMPI for pass
# its MPI implementations.
@when('^openmpi')
def setup(self):
# do something special when this is built with OpenMPI for
# its MPI implementations.
def install(self, prefix): def install(self, prefix):
# Do common install stuff # Do common install stuff
self.setup() self.setup()
# Do more common install stuff # Do more common install stuff
There must be one (and only one) @when clause that matches the 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, package's spec. If there is more than one, or if none match,