Fix code block in docs.
This commit is contained in:
parent
108277fb5d
commit
12ddf241a5
@ -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,
|
||||||
|
Loading…
Reference in New Issue
Block a user