Changeset 10474


Ignore:
Timestamp:
2019-01-08T18:52:03+01:00 (2 years ago)
Author:
mathiot
Message:

Add python module check before compiling the documentation (pygments module is needed by some latex package)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • NEMO/trunk/doc/PDF_creation.sh

    r10405 r10474  
    11#!/bin/sh 
    2  
    32 
    43export opts='-shell-escape -pdf' 
    54model='NEMO' 
     5 
     6check_python_module() { 
     7    python -c " 
     8import sys 
     9try: 
     10    import $1 
     11    print('\nModule $1 is installed') 
     12except ImportError: 
     13    print('\nModule $1 is NOT installed') 
     14    print('') 
     15    sys.exit(42)" 
     16} 
    617 
    718clean() { 
     
    2536} 
    2637 
     38check_python_module pygments 
     39if [ $? -ne 0 ]; then echo 'Required python module pygments to correctly build the documentation is missing; exit 42'; echo ''; exit 42; fi 
     40 
    2741clean 
     42 
    2843build $model 
    2944 
Note: See TracChangeset for help on using the changeset viewer.