Salome HOME
updated copyright message
[modules/gui.git] / tools / CurvePlot / src / python / model / XYPlotSetModel.py
index 18bb60e2f9b56c707f43884fdb328f2acb1fb82e..068cc4ecf30cce90695f6cc1c05c88c47485641c 100644 (file)
@@ -1,5 +1,24 @@
-from Model import Model
-from utils import toUnicodeWithWarning
+# Copyright (C) 2016-2023  CEA, EDF
+#
+# 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, or (at your option) any later version.
+#
+# 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 .Model import Model
+from .utils import toUnicodeWithWarning
 
 class XYPlotSetModel(Model):
   
@@ -26,7 +45,7 @@ class XYPlotSetModel(Model):
     return self._title
       
   def setCurrentCurve(self, curveID, silent=False):
-    if not self._curves.has_key(curveID) and curveID != -1:
+    if curveID not in self._curves and curveID != -1:
       raise ValueError("Invalid curve ID (%d)!" % curveID)
     self._currentCurve = self._curves.get(curveID, None)
     if not silent:
@@ -41,7 +60,7 @@ class XYPlotSetModel(Model):
       self.notifyChange("AddCurve")
   
   def removeCurve(self, curveID, silent=False):
-    if not self._curves.has_key(curveID):
+    if curveID not in self._curves:
       raise ValueError("Curve ID (%d) not found for deletion!" % curveID)
     c = self._curves.pop(curveID)
     if self._currentCurve is c: