From 1c4b6e170cea330075d78d73ef90f3dc9cb26c81 Mon Sep 17 00:00:00 2001 From: Jean-Philippe ARGAUD Date: Tue, 11 Feb 2014 15:19:59 +0100 Subject: [PATCH] Using a centralized definition of the module version --- bin/AdaoCatalogGenerator.py | 11 +++++++---- bin/Makefile.am | 4 ++-- bin/module_version.py | 25 +++++++++++++++++++++++++ bin/qtEficas_adao_study.py.in | 2 +- doc/en/conf.py | 8 ++++++-- doc/fr/conf.py | 8 ++++++-- resources/SalomeApp.xml | 2 +- 7 files changed, 48 insertions(+), 12 deletions(-) create mode 100644 bin/module_version.py diff --git a/bin/AdaoCatalogGenerator.py b/bin/AdaoCatalogGenerator.py index a619ec0..37a34c6 100644 --- a/bin/AdaoCatalogGenerator.py +++ b/bin/AdaoCatalogGenerator.py @@ -24,6 +24,8 @@ import sys import string import StringIO +import module_version + logging.basicConfig(level=logging.WARNING) #----------- Templates Part ---------------# @@ -36,11 +38,12 @@ begin_catalog_file = """# -*- coding: utf-8 -*- import Accas from Accas import * -JdC = JDC_CATA (code = 'ADAO', +JdC = JDC_CATA (code = '%s', execmodul = None, regles = ( AU_MOINS_UN ('ASSIMILATION_STUDY','CHECKING_STUDY'), AU_PLUS_UN ('ASSIMILATION_STUDY','CHECKING_STUDY')), ) -""" +VERSION_CATALOGUE='%s' +"""%(module_version.name,module_version.version) data_method = """ def F_${data_name}(statut) : return FACT(statut = statut, @@ -181,7 +184,7 @@ ASSIMILATION_STUDY = PROC(nom="ASSIMILATION_STUDY", repetable = "n", Study_name = SIMP(statut="o", typ = "TXM", defaut="ADAO Calculation Case"), Study_repertory = SIMP(statut="f", typ = "Repertoire", min=1, max=1), - Debug = SIMP(statut="o", typ = "I", into=(0, 1), defaut=0), + Debug = SIMP(statut="f", typ = "I", into=(0, 1), defaut=0), Algorithm = SIMP(statut="o", typ = "TXM", into=(${algos_names})), Background = F_Background("o"), BackgroundError = F_BackgroundError("o"), @@ -204,7 +207,7 @@ CHECKING_STUDY = PROC(nom="CHECKING_STUDY", repetable = "n", Study_name = SIMP(statut="o", typ = "TXM", defaut="ADAO Checking Case"), Study_repertory = SIMP(statut="f", typ = "Repertoire", min=1, max=1), - Debug = SIMP(statut="o", typ = "I", into=(0, 1), defaut=0), + Debug = SIMP(statut="f", typ = "I", into=(0, 1), defaut=0), Algorithm = SIMP(statut="o", typ = "TXM", into=(${check_names})), CheckingPoint = F_CheckingPoint("o"), ObservationOperator = F_ObservationOperator("o"), diff --git a/bin/Makefile.am b/bin/Makefile.am index 9ca1bba..ccf1ca8 100644 --- a/bin/Makefile.am +++ b/bin/Makefile.am @@ -20,9 +20,9 @@ include $(top_srcdir)/adm_local/make_common_starter.am -bin_SCRIPTS = AdaoYacsSchemaCreator.py qtEficas_adao_study.py AdaoCatalogGenerator.py +bin_SCRIPTS = AdaoYacsSchemaCreator.py qtEficas_adao_study.py # AdaoCatalogGenerator.py module_version.py -EXTRA_DIST = AdaoYacsSchemaCreator.py qtEficas_adao_study.py.in AdaoCatalogGenerator.py +EXTRA_DIST = AdaoYacsSchemaCreator.py qtEficas_adao_study.py.in # AdaoCatalogGenerator.py module_version.py install-data-hook: @export PYTHONPATH=$(DESTDIR)${salomepythondir}:${PYTHONPATH} && python $(top_srcdir)/bin/AdaoCatalogGenerator.py $(DESTDIR)${salomepythondir}/daEficas ADAO_Cata_V0.py diff --git a/bin/module_version.py b/bin/module_version.py new file mode 100644 index 0000000..0070be6 --- /dev/null +++ b/bin/module_version.py @@ -0,0 +1,25 @@ +#-*-coding:iso-8859-1-*- +# +# Copyright (C) 2008-2014 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 +# +# Author: Jean-Philippe Argaud, jean-philippe.argaud@edf.fr, EDF R&D + +name = "ADAO" +version = "V7_main" +date = "" diff --git a/bin/qtEficas_adao_study.py.in b/bin/qtEficas_adao_study.py.in index fc17c9f..0376363 100644 --- a/bin/qtEficas_adao_study.py.in +++ b/bin/qtEficas_adao_study.py.in @@ -21,7 +21,7 @@ # Author: André Ribes, andre.ribes@edf.fr, EDF R&D """ - Ce module sert à lancer EFICAS pour Adao + Ce module sert a lancer EFICAS pour Adao """ import sys diff --git a/doc/en/conf.py b/doc/en/conf.py index 0d8f111..847b12d 100644 --- a/doc/en/conf.py +++ b/doc/en/conf.py @@ -37,6 +37,8 @@ import sys, os # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. #sys.path.append(os.path.abspath('.')) +sys.path.append(os.path.abspath("../../bin")) +import module_version # -- General configuration ----------------------------------------------------- @@ -57,7 +59,7 @@ source_suffix = '.rst' master_doc = 'index' # General information about the project. -project = u'ADAO' +project = u'%s'%module_version.name copyright = u'2008-2014, Jean-Philippe ARGAUD' # The version info for the project you're documenting, acts as replacement for @@ -67,9 +69,11 @@ copyright = u'2008-2014, Jean-Philippe ARGAUD' # The short X.Y version. version = '7.4.0' version = '7\_main' +version = '%s'%module_version.version.replace('_','\_') # The full version, including alpha/beta/rc tags. release = '7.4.0' release = '7\_main' +release = '%s'%module_version.version.replace('_','\_') # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. @@ -194,7 +198,7 @@ latex_font_size = '10pt' # Grouping the document tree into LaTeX files. List of tuples # (source start file, target name, title, author, documentclass [howto/manual]). latex_documents = [ - ('index', 'ADAO.tex', u'ADAO Documentation', + ('index', 'ADAO.tex', u'ADAO documentation', u'Jean-Philippe ARGAUD', 'manual'), ] diff --git a/doc/fr/conf.py b/doc/fr/conf.py index f268da5..3741bee 100644 --- a/doc/fr/conf.py +++ b/doc/fr/conf.py @@ -37,6 +37,8 @@ import sys, os # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. #sys.path.append(os.path.abspath('.')) +sys.path.append(os.path.abspath("../../bin")) +import module_version # -- General configuration ----------------------------------------------------- @@ -57,7 +59,7 @@ source_suffix = '.rst' master_doc = 'index' # General information about the project. -project = u'ADAO' +project = u'%s'%module_version.name copyright = u'2008-2014, Jean-Philippe ARGAUD' # The version info for the project you're documenting, acts as replacement for @@ -67,9 +69,11 @@ copyright = u'2008-2014, Jean-Philippe ARGAUD' # The short X.Y version. version = '7.4.0' version = '7\_main' +version = '%s'%module_version.version.replace('_','\_') # The full version, including alpha/beta/rc tags. release = '7.4.0' release = '7\_main' +release = '%s'%module_version.version.replace('_','\_') # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. @@ -125,7 +129,7 @@ html_theme = 'default' # The name for this set of Sphinx documents. If None, it defaults to # " v documentation". -html_title = "Documentation ADAO v7_main" +html_title = "Documentation %s %s"%(module_version.name,module_version.version) # A shorter title for the navigation bar. Default is the same as html_title. #html_short_title = None diff --git a/resources/SalomeApp.xml b/resources/SalomeApp.xml index edf827a..4b62768 100644 --- a/resources/SalomeApp.xml +++ b/resources/SalomeApp.xml @@ -26,7 +26,7 @@ - +
-- 2.39.2