Salome HOME
updated copyright message
[modules/gui.git] / tools / CurvePlot / src / python / views / CurveTabsView.py
index 3454837c6bd96147d3ccb54d2fe3723c1d953abd..001bafe145130af75baf1f7614d6d0bddaeec368 100644 (file)
@@ -1,6 +1,25 @@
-from View import View
-from XYView import XYView
-from utils import Logger
+# 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 .View import View
+from .XYView import XYView
+from .utils import Logger
 
 class CurveTabsView(View):
   def __init__(self, controller):
@@ -32,7 +51,7 @@ class CurveTabsView(View):
   def mapModId2ViewId(self):
     """ Gives a map from model ID (the model behind the XYView) to view ID
     """
-    lst = [(v._model.getID(), view_id) for view_id, v in self._XYViews.items()]
+    lst = [(v._model.getID(), view_id) for view_id, v in list(self._XYViews.items())]
     return dict(lst)
   
   def update(self):
@@ -44,7 +63,7 @@ class CurveTabsView(View):
     
     # Check list of tabs:
     set_mod = set(self._model._plotSets.keys())
-    set_view = set([ v._model.getID() for v in self._XYViews.values() ])
+    set_view = { v._model.getID() for v in list(self._XYViews.values()) }
     mp = self.mapModId2ViewId()
     
     # Deleted/Added curves:
@@ -62,7 +81,7 @@ class CurveTabsView(View):
       newViews.append(self.createXYView(self._model._plotSets[a]))
     
     # Now update all tabs individually (this will trigger creation of new ones if not already there):
-    for v in self._XYViews.values() + newViews:
+    for v in list(self._XYViews.values()) + newViews:
       # The update on newViews will trigger the SALOME view creation:
       v.update()