X-Git-Url: http://git.osdn.jp/view?a=blobdiff_plain;f=swig%2Fpython%2Fsetup.py;h=feeae643022c35d8627551faa21d2c07d571e350;hb=2a17cee6192f58b3fccef2a9bab6a1214037dcbb;hp=fa483f407a836e61bc1172a83f4857523aff7838;hpb=dd173c5251722ffc27908e75cfa5ec0839243247;p=meshio%2Fmeshio.git diff --git a/swig/python/setup.py b/swig/python/setup.py index fa483f4..feeae64 100644 --- a/swig/python/setup.py +++ b/swig/python/setup.py @@ -1,5 +1,5 @@ import os -import commands +import shutil from distutils.core import setup, Extension def exec_command(cmd): @@ -12,16 +12,26 @@ if os.name=='nt': extra_compile_args=["/EHsc", "/wd4996"] libraries=[] include_dirs=['../../src', BOOST_ROOT] + if os.path.exists("meshio/mqo.py"): + os.remove("meshio/mqo.py") + if os.path.exists("meshio/pmd.py"): + os.remove("meshio/pmd.py") exec_command("swig -c++ -python -o mqo_wrap.cpp -D_MSC_VER ../mqo.i") exec_command("swig -c++ -python -o pmd_wrap.cpp -D_MSC_VER ../pmd.i") - exec_command("mv mqo.py pmd.py meshio") + shutil.move("mqo.py", "meshio") + shutil.move("pmd.py", "meshio") else: extra_compile_args=['-std=c++0x'] libraries=["iconv"] include_dirs=['../../src'] + if os.path.exists("meshio/mqo.py"): + os.remove("meshio/mqo.py") + if os.path.exists("meshio/pmd.py"): + os.remove("meshio/pmd.py") exec_command("swig -c++ -python -o mqo_wrap.cpp ../mqo.i") exec_command("swig -c++ -python -o pmd_wrap.cpp ../pmd.i") - exec_command("mv mqo.py pmd.py meshio") + shutil.move("mqo.py", "meshio") + shutil.move("pmd.py", "meshio") setup( name='meshio',