Salome HOME
commentaire
[tools/eficas.git] / Accas / A_VALIDATOR.py
index 7268f03dac31a83ebb6448cf4d9691771a66f584..2f410cc70165d2e9ff3fb4de7ca70978bbd60179 100644 (file)
@@ -1,44 +1,21 @@
-import types
-from Noyau import N_VALIDATOR
-from Ihm import I_VALIDATOR
-
-class FunctionVal(I_VALIDATOR.FunctionVal,N_VALIDATOR.FunctionVal):pass
-class OrVal(I_VALIDATOR.OrVal,N_VALIDATOR.OrVal):pass
-class AndVal(I_VALIDATOR.AndVal,N_VALIDATOR.AndVal):pass
-class NoRepeat(I_VALIDATOR.NoRepeat,N_VALIDATOR.NoRepeat):pass
-class LongStr(I_VALIDATOR.LongStr,N_VALIDATOR.LongStr):pass
-class OrdList(I_VALIDATOR.OrdList,N_VALIDATOR.OrdList):pass
-class RangeVal(I_VALIDATOR.RangeVal,N_VALIDATOR.RangeVal):pass
-class EnumVal(I_VALIDATOR.EnumVal,N_VALIDATOR.EnumVal):pass
-class TypeVal(I_VALIDATOR.TypeVal,N_VALIDATOR.TypeVal):pass
-class PairVal(I_VALIDATOR.PairVal,N_VALIDATOR.PairVal):pass
-class CardVal(I_VALIDATOR.CardVal,N_VALIDATOR.CardVal):pass
-class InstanceVal(I_VALIDATOR.InstanceVal,N_VALIDATOR.InstanceVal):pass
-
-def do_liste(validators):
-    """
-       Convertit une arborescence de validateurs en OrVal ou AndVal
-       validators est une liste de validateurs ou de listes ou de tuples
-    """
-    valids=[]
-    for validator in validators:
-        if type(validator) == types.FunctionType:
-           valids.append(FunctionVal(validator))
-        elif type(validator) == types.TupleType:
-           valids.append(OrVal(do_liste(validator)))
-        elif type(validator) == types.ListType:
-           valids.append(AndVal(do_liste(validator)))
-        else:
-           valids.append(validator)
-    return valids
-
-def validatorFactory(validator):
-    if type(validator) == types.FunctionType:
-       return FunctionVal(validator)
-    elif type(validator) == types.TupleType:
-       return OrVal(do_liste(validator))
-    elif type(validator) == types.ListType:
-       return AndVal(do_liste(validator))
-    else:
-       return validator
-
+# -*- coding: utf-8 -*-
+# Copyright (C) 2007-2015   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
+#
+from __future__ import absolute_import
+from Ihm.I_VALIDATOR import *