From: caremoli Date: Wed, 9 Feb 2011 08:29:00 +0000 (+0000) Subject: CCAR: add example with component and doc only (pydoc1) X-Git-Tag: V6_3_0a1~7 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=a5dc0a1e27c10904d2b8504e3d38ef18c671eb53;p=tools%2Fyacsgen.git CCAR: add example with component and doc only (pydoc1) reference all files to $HOME in context.py and makefile.inc files --- 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 0000000..16a20c1 Binary files /dev/null and b/Examples/pydoc1/exec.png differ diff --git a/Examples/pydoc1/index.rst b/Examples/pydoc1/index.rst new file mode 100644 index 0000000..ff84846 --- /dev/null +++ b/Examples/pydoc1/index.rst @@ -0,0 +1,23 @@ +.. pycompos documentation master file, created by + sphinx-quickstart on Sun Sep 19 16:20:14 2010. + You can adapt this file completely to your liking, but it should at least + contain the root `toctree` directive. + +Welcome to pycompos's documentation! +======================================= + +Contents: + +.. toctree:: + :maxdepth: 2 + + using.rst + + +Indices and tables +================== + +* :ref:`genindex` +* :ref:`modindex` +* :ref:`search` + diff --git a/Examples/pydoc1/using.rst b/Examples/pydoc1/using.rst new file mode 100644 index 0000000..8321bf3 --- /dev/null +++ b/Examples/pydoc1/using.rst @@ -0,0 +1,20 @@ + +GUI components +=================== + +Object Browser +-------------- +The Object Browser is a reusable GUI component. + +The Object Browser is only used to publish the run of the schema as a whole. + + +.. centered:: **Object Browser tab** + +The Object Browser is in a tab, with tree_view + +Other +---------- +.. image:: exec.png + :align: center +