Files
opm-common/opm/parser/eclipse/python/cmake/cmake_pyc
Joakim Hove 3a426cb4c9 Added simple python wrapper for Parser and Deck.
- Create a new shared library libcopmparser with small files cxxxx
   which wrap general Cxx classes with C linkage.

 - Added Python packages & modules, based on Python ctypes and the
   ert.cwrap package.
2016-01-15 16:35:09 +01:00

28 lines
604 B
Plaintext

import py_compile
import os
import os.path
import sys
import shutil
src_file = sys.argv[1]
target_file = sys.argv[2]
(target_path , tail) = os.path.split( target_file )
if not os.path.exists( target_path ):
try:
os.makedirs( target_path )
except:
# When running with make -j 4 there might be a race to create this directory.
pass
shutil.copyfile( src_file , target_file )
shutil.copystat( src_file , target_file )
try:
py_compile.compile( target_file , doraise = True)
except Exception,error:
sys.exit("py_compile(%s) failed:%s" % (target_file , error))
sys.exit(0)