Salome HOME
Copyright update 2021
[modules/smesh.git] / src / Tools / Verima / compareVersions.py
1 #!/usr/bin/env python3
2 # -*- coding: utf-8 -*-
3 # Copyright (C) 2013-2021  EDF R&D
4 #
5 # This library is free software; you can redistribute it and/or
6 # modify it under the terms of the GNU Lesser General Public
7 # License as published by the Free Software Foundation; either
8 # version 2.1 of the License, or (at your option) any later version.
9 #
10 # This library is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13 # Lesser General Public License for more details.
14 #
15 # You should have received a copy of the GNU Lesser General Public
16 # License along with this library; if not, write to the Free Software
17 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
18 #
19 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 #
21
22 import sys
23 import os
24 from Base.dataBase import Base
25 from Base.versions import  Chercheversion
26
27
28 if __name__ == "__main__":
29       from argparse import ArgumentParser
30       p=ArgumentParser()
31       p.add_argument('-s',dest='salomePath',help='chemin du lanceur salome de la version a comparer',default="Appli")
32       p.add_argument('-v',dest='version',help='id de la version a comparer',default=None)
33       p.add_argument('-r',dest='versionRef',help='liste des id des versions de reference',default=None)
34       p.add_argument('-d',dest='database',default="myMesh.db",help='nom de la database')
35       p.add_argument('-f',dest='fileHtml',default="/tmp/toto.htm",help='nom du fichier produit')
36       args = p.parse_args()
37
38       if args.version is None : 
39          args.version=Chercheversion(args.salomePath)
40       exit
41
42       maBase=Base(args.database)
43       maBase.initialise()
44       maBase.compare(args.version,args.versionRef,args.fileHtml)
45       maBase.close()
46