From a5dc0a1e27c10904d2b8504e3d38ef18c671eb53 Mon Sep 17 00:00:00 2001 From: caremoli Date: Wed, 9 Feb 2011 08:29:00 +0000 Subject: [PATCH] CCAR: add example with component and doc only (pydoc1) reference all files to $HOME in context.py and makefile.inc files --- Examples/context.py | 19 ++++++------ Examples/makefile.inc | 6 ++-- Examples/pydoc1/Makefile | 21 +++++++++++++ Examples/pydoc1/components.py | 55 ++++++++++++++++++++++++++++++++++ Examples/pydoc1/exec.png | Bin 0 -> 831 bytes Examples/pydoc1/index.rst | 23 ++++++++++++++ Examples/pydoc1/using.rst | 20 +++++++++++++ 7 files changed, 130 insertions(+), 14 deletions(-) create mode 100644 Examples/pydoc1/Makefile create mode 100644 Examples/pydoc1/components.py create mode 100644 Examples/pydoc1/exec.png create mode 100644 Examples/pydoc1/index.rst create mode 100644 Examples/pydoc1/using.rst diff --git a/Examples/context.py b/Examples/context.py index d1e63ad..3b85cbd 100644 --- a/Examples/context.py +++ b/Examples/context.py @@ -20,23 +20,22 @@ import os,sys sys.path.insert(0,"../..") -KERNEL_ROOT_DIR=os.getenv("KERNEL_ROOT_DIR","/local/cchris/Salome/Install/KERNEL_V6") -GUI_ROOT_DIR=os.getenv("GUI_ROOT_DIR","/local/cchris/Salome/Install/GUI_V6") -YACS_ROOT_DIR=os.getenv("YACS_ROOT_DIR","/local/cchris/Salome/Install/YACS_V6") -GEOM_ROOT_DIR=os.getenv("GEOM_ROOT_DIR","/local/cchris/Salome/Install/GEOM_V6") +SALOME_ROOT=os.path.expanduser("~/Salome/Install") +SALOME_PREREQ=os.path.expanduser("~/.packages.d/envSalome6main") + +KERNEL_ROOT_DIR=os.getenv("KERNEL_ROOT_DIR",os.path.join(SALOME_ROOT,"KERNEL_V6")) +GUI_ROOT_DIR=os.getenv("GUI_ROOT_DIR",os.path.join(SALOME_ROOT,"GUI_V6")) +YACS_ROOT_DIR=os.getenv("YACS_ROOT_DIR",os.path.join(SALOME_ROOT,"YACS_V6")) +GEOM_ROOT_DIR=os.getenv("GEOM_ROOT_DIR",os.path.join(SALOME_ROOT,"GEOM_V6")) context={'update':1, "makeflags":"", - "prerequisites":"/local/cchris/.packages.d/envSalome6main", + "prerequisites":SALOME_PREREQ, "kernel":KERNEL_ROOT_DIR, "gui":GUI_ROOT_DIR, "geom":GEOM_ROOT_DIR, } -aster_home="/local/cchris/Aster/V10.1/aster" +aster_home=os.path.expanduser("~/Aster/V10.1/aster") aster_version="STA10.1" -#aster_home="/local/cchris/Aster/V10/Install" -#aster_version="STA10.0" - - diff --git a/Examples/makefile.inc b/Examples/makefile.inc index e659cb2..d3e354b 100644 --- a/Examples/makefile.inc +++ b/Examples/makefile.inc @@ -17,11 +17,9 @@ # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # -KERNEL_ROOT_DIR=/local/cchris/Salome/Install/KERNEL_V6 +KERNEL_ROOT_DIR=$(HOME)/Salome/Install/KERNEL_V6 -ASTER_ROOT=/local/cchris/Aster/V10.1/aster +ASTER_ROOT=$(HOME)/Aster/V10.1/aster ASTER_VERSION=STA10.1 -#ASTER_ROOT=/local/cchris/Aster/V10/Install -#ASTER_VERSION=STA10.0 FC=gfortran diff --git a/Examples/pydoc1/Makefile b/Examples/pydoc1/Makefile new file mode 100644 index 0000000..fddce0a --- /dev/null +++ b/Examples/pydoc1/Makefile @@ -0,0 +1,21 @@ +# Copyright (C) 2009-2010 EDF R&D +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# + +clean: + rm -rf *.pyc pycompos_SRC pycompos_SRC.bak appli appli.bak install install.bak traceExec_proc diff --git a/Examples/pydoc1/components.py b/Examples/pydoc1/components.py new file mode 100644 index 0000000..a10f5bf --- /dev/null +++ b/Examples/pydoc1/components.py @@ -0,0 +1,55 @@ +# Copyright (C) 2009-2010 EDF R&D +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# + +import os + +#import context from .. +execfile("../context.py") + +from module_generator import * + +defs=""" +""" + +body=""" + c=a+b + d=a-b +""" + +c1=PYComponent("pycompos",services=[ + Service("s1",inport=[("a","double"),("b","double")], + outport=[("c","double"),("d","double")], + defs=defs,body=body, + ), + ], + ) + +modul=Module("pycompos",components=[c1],prefix="./install", + doc=["*.rst","*.png",], + ) + +g=Generator(modul,context) +g.generate() +g.bootstrap() +g.configure() +g.make() +g.install() +g.make_appli("appli", restrict=["KERNEL"], altmodules={"GUI":GUI_ROOT_DIR, "YACS":YACS_ROOT_DIR}) + + diff --git a/Examples/pydoc1/exec.png b/Examples/pydoc1/exec.png new file mode 100644 index 0000000000000000000000000000000000000000..16a20c116e8243a6b49ed862613d2cc49bdf4caa GIT binary patch literal 831 zcmV-F1Hk-=P)A+3!%gdoE?w?yY*XMamxaAW~()k6;QGVVf3ZPpQcy+38CrH3{Qk zoaxN-vWJ+OcH(Y#5qvHK|CitMf1CdUU;7AQ8zF4-#i736F~#EMso~pq*Ek7JMLa$}POH_T(b)M|f)>8t;^3f3 zKA)#ntMKyW+7Z-s>l6xWsZ53jrMAEC5{41RXe`Snj$`6DMr+Vop|xgsc$hE@Sz20V zb@eG)%b|Y+_m{*NND_%L1}POFH@MUObOdhQq^%&CMdWZvC2q+x@_Pg_JQ$DGG%bJbwIyVzG#2o#E=$@5yGf z#Bm5%IplY1BB@I((}Bdlpj1;;nAaqNZEDBWHP2)F0;K|LMcrchIBe@ z&Ye4p5H>e&{)pCc=qTd1Z_6|q4IIZIpUy{Fg7-dG2KQ=nb2l+s9