From 4029e9799ba40d4a0b356e4fcebb9639838225b8 Mon Sep 17 00:00:00 2001 From: spo Date: Tue, 29 Dec 2015 11:37:59 +0300 Subject: [PATCH] Issue #803: Put all the python modules in the same python package newgeom --- CMakeCommon/UnitTest.cmake | 2 +- CMakeLists.txt | 4 + env_linux.sh | 8 +- src/Config/plugins.xml.in | 4 +- src/ConnectorPlugin/CMakeLists.txt | 3 +- src/PythonAPI/CMakeLists.txt | 10 ++- src/PythonAPI/Test/TestFeatures.py | 2 +- src/PythonAPI/Test/TestFeaturesExtrusion.py | 2 +- src/PythonAPI/Test/TestFeaturesRevolution.py | 20 ++--- src/PythonAPI/Test/TestMakeBrick1.py | 6 +- src/PythonAPI/Test/TestMakeBrick2.py | 6 +- src/PythonAPI/Test/TestMakeBrick3.py | 6 +- src/PythonAPI/Test/TestModel.py | 2 +- src/PythonAPI/Test/TestPlatine.py | 6 +- src/PythonAPI/Test/TestPythonAPI.py | 4 +- src/PythonAPI/Test/TestSketcher.py | 2 +- src/PythonAPI/Test/TestSketcherAddArc.py | 9 +- src/PythonAPI/Test/TestSketcherAddCircle.py | 2 +- src/PythonAPI/Test/TestSketcherAddLine.py | 2 +- src/PythonAPI/Test/TestSketcherAddMirror.py | 2 +- src/PythonAPI/Test/TestSketcherAddPoint.py | 2 +- src/PythonAPI/Test/TestSketcherSetAngle.py | 2 +- .../Test/TestSketcherSetCoincident.py | 2 +- src/PythonAPI/Test/TestSketcherSetEqual.py | 2 +- src/PythonAPI/Test/TestSketcherSetFillet.py | 2 +- .../Test/TestSketcherSetHorizontal.py | 2 +- src/PythonAPI/Test/TestSketcherSetLength.py | 2 +- src/PythonAPI/Test/TestSketcherSetParallel.py | 2 +- .../Test/TestSketcherSetPerpendicular.py | 2 +- src/PythonAPI/Test/TestSketcherSetRadius.py | 2 +- src/PythonAPI/Test/TestSketcherSetRigid.py | 2 +- src/PythonAPI/Test/TestSketcherSetTangent.py | 2 +- src/PythonAPI/Test/TestSketcherSetVertical.py | 2 +- src/PythonAPI/Test/config.py.in | 2 + src/PythonAPI/{shaper.py => __init__.py} | 4 +- src/PythonAPI/examples/MakeBrick1.py | 87 ++++++++++--------- src/PythonAPI/examples/MakeBrick2.py | 79 +++++++++-------- src/PythonAPI/examples/MakeBrick3.py | 24 ++--- src/PythonAPI/examples/Platine.py | 59 +++++++------ src/PythonAPI/examples/__init__.py | 4 + src/PythonAPI/extension/box.py | 4 +- src/PythonAPI/model/connection/connection.py | 2 +- src/PythonAPI/model/construction/axis.py | 2 +- src/PythonAPI/model/construction/plane.py | 2 +- src/PythonAPI/model/construction/point.py | 2 +- src/PythonAPI/model/exchange/exchange.py | 2 +- src/PythonAPI/model/features/boolean.py | 20 ++--- src/PythonAPI/model/features/extrusion.py | 8 +- src/PythonAPI/model/features/group.py | 2 +- src/PythonAPI/model/features/partition.py | 2 +- src/PythonAPI/model/features/placement.py | 2 +- src/PythonAPI/model/features/revolution.py | 2 +- src/PythonAPI/model/features/roots.py | 2 +- src/PythonAPI/model/features/rotation.py | 2 +- src/PythonAPI/model/features/translation.py | 2 +- src/PythonAPI/model/parameter/parameter.py | 2 +- src/PythonAPI/model/partset/part.py | 2 +- src/PythonAPI/model/roots.py | 2 +- src/PythonAPI/model/services.py | 2 +- src/PythonAPI/model/sketcher/arc.py | 4 +- src/PythonAPI/model/sketcher/circle.py | 18 ++-- src/PythonAPI/model/sketcher/entity.py | 2 +- src/PythonAPI/model/sketcher/line.py | 4 +- src/PythonAPI/model/sketcher/mirror.py | 6 +- src/PythonAPI/model/sketcher/point.py | 6 +- src/PythonAPI/model/sketcher/sketch.py | 16 ++-- src/PythonAPI/plugins/__init__.py | 0 src/PythonAddons/CMakeLists.txt | 12 ++- src/PythonAddons/addons_Features.py | 2 +- src/PythonAddons/addons_Features.xml | 3 - src/PythonAddons/addons_Features.xml.in | 3 + src/PythonAddons/macros/box/feature.py | 4 +- 72 files changed, 293 insertions(+), 238 deletions(-) create mode 100644 src/PythonAPI/Test/config.py.in rename src/PythonAPI/{shaper.py => __init__.py} (66%) create mode 100644 src/PythonAPI/plugins/__init__.py delete mode 100644 src/PythonAddons/addons_Features.xml create mode 100644 src/PythonAddons/addons_Features.xml.in diff --git a/CMakeCommon/UnitTest.cmake b/CMakeCommon/UnitTest.cmake index 57dc29246..1f08bf620 100644 --- a/CMakeCommon/UnitTest.cmake +++ b/CMakeCommon/UnitTest.cmake @@ -35,7 +35,7 @@ MACRO(ADD_UNIT_TESTS) STRING(REPLACE ";" "\\;" _PYTHONPATH "${_PYTHONPATH}") else() SET(_LD_LIBRARY_PATH "${CMAKE_INSTALL_PREFIX}/bin:${CMAKE_INSTALL_PREFIX}/swig:${CMAKE_INSTALL_PREFIX}/plugins:${SUIT_LIB_DIR}:$ENV{LD_LIBRARY_PATH}") - SET(_PYTHONPATH "${CMAKE_INSTALL_PREFIX}/swig:${CMAKE_INSTALL_PREFIX}/plugins:${CMAKE_INSTALL_PREFIX}/addons:${CMAKE_INSTALL_PREFIX}/pythonAPI:$ENV{PYTHONPATH}") + SET(_PYTHONPATH "${CMAKE_BINARY_DIR}:${CMAKE_INSTALL_PREFIX}/swig:${CMAKE_INSTALL_PREFIX}/pythonAPI:$ENV{PYTHONPATH}") endif() SET(_CONFIG_FILE "${CMAKE_INSTALL_PREFIX}/plugins") diff --git a/CMakeLists.txt b/CMakeLists.txt index 53d9986e9..c13ebd35a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -38,6 +38,10 @@ IF(UNIX) ENDIF(CMAKE_COMPILER_IS_GNUCC) ENDIF(UNIX) +SET (PYTHON_PACKAGE_NAME shaper) +#SET (PYTHON_PACKAGE_NAME openparts) +SET (PYTHONAPI_DIR PythonAPI/${PYTHON_PACKAGE_NAME}) + #IF(CMAKE_BUILD_TYPE MATCHES Release) ADD_SUBDIRECTORY (doc) #ENDIF(CMAKE_BUILD_TYPE MATCHES Release) diff --git a/env_linux.sh b/env_linux.sh index 2aaa7dbbd..84f66d49c 100644 --- a/env_linux.sh +++ b/env_linux.sh @@ -53,7 +53,13 @@ export PATH=${CASROOT}:${PATH} #------ NewGEOM ------ export PATH=${NEWGEOM_ROOT_DIR}/bin:${NEWGEOM_ROOT_DIR}/plugins:${PATH} -export PYTHONPATH=${NEWGEOM_ROOT_DIR}/swig:${NEWGEOM_ROOT_DIR}/plugins:${NEWGEOM_ROOT_DIR}/addons:${NEWGEOM_ROOT_DIR}/PythonAPI:${PYTHONPATH} + +export PYTHONPATH=${NEWGEOM_ROOT_DIR}/swig:${PYTHONPATH} +#export PYTHONPATH=${NEWGEOM_ROOT_DIR}/plugins:${PYTHONPATH} +#export PYTHONPATH=${NEWGEOM_ROOT_DIR}/addons:${PYTHONPATH} +export PYTHONPATH=${NEWGEOM_ROOT_DIR}/PythonAPI:${PYTHONPATH} + export LD_LIBRARY_PATH=${NEWGEOM_ROOT_DIR}/bin:${NEWGEOM_ROOT_DIR}/swig:${NEWGEOM_ROOT_DIR}/plugins:${LD_LIBRARY_PATH} export NEW_GEOM_CONFIG_FILE=${NEWGEOM_ROOT_DIR}/plugins export NewGeomResources=${NEWGEOM_ROOT_DIR}/resources + diff --git a/src/Config/plugins.xml.in b/src/Config/plugins.xml.in index af91d8fb2..2251b6106 100644 --- a/src/Config/plugins.xml.in +++ b/src/Config/plugins.xml.in @@ -8,8 +8,8 @@ - - + + @DEFAULT_SOLVER@