Changeset 5251ec6 in sasview for src/sas/sasgui/guiframe/data_panel.py
- Timestamp:
- Oct 11, 2018 12:20:56 PM (6 years ago)
- Branches:
- master, magnetic_scatt, release-4.2.2, ticket-1009, ticket-1249
- Children:
- 98b9f32
- Parents:
- 67ed543
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/sasgui/guiframe/data_panel.py
rb963b20 r5251ec6 13 13 from __future__ import print_function 14 14 15 import sys 16 15 17 import wx 16 from wx.build import build_options17 18 import sys19 18 from wx.lib.scrolledpanel import ScrolledPanel 20 19 import wx.lib.agw.customtreectrl as CT 20 #from wx.build import build_options 21 21 22 from sas.sasgui.guiframe.dataFitting import Data1D 22 23 from sas.sasgui.guiframe.dataFitting import Data2D … … 444 445 self.parent.get_data_manager().get_by_id(id_list=[id]) 445 446 if data_list: 446 data = data_list.values()[0]447 data = list(data_list.values())[0] 447 448 if data is None: 448 data = theory_list.values()[0][0]449 data = list(theory_list.values())[0][0] 449 450 return data 450 451 … … 667 668 """ 668 669 if list: 669 for state_id, dstate in list.ite ritems():670 for state_id, dstate in list.items(): 670 671 data = dstate.get_data() 671 672 theory_list = dstate.get_theory() … … 764 765 if not theory_list: 765 766 return 766 if state_id not in self.list_cb_data .keys():767 if state_id not in self.list_cb_data: 767 768 root = self.tree_ctrl_theory.root 768 769 tree = self.tree_ctrl_theory … … 783 784 Append theory helper 784 785 """ 785 if state_id in self.list_cb_theory .keys():786 if state_id in self.list_cb_theory: 786 787 # update current list of theory for this data 787 788 theory_list_ctrl = self.list_cb_theory[state_id] 788 789 789 for theory_id, item in theory_list.ite ritems():790 for theory_id, item in theory_list.items(): 790 791 theory_data, _ = item 791 792 if theory_data is None: … … 828 829 # data didn't have a theory associated it before 829 830 theory_list_ctrl = {} 830 for theory_id, item in theory_list.ite ritems():831 for theory_id, item in theory_list.items(): 831 832 theory_data, _ = item 832 833 if theory_data is not None: … … 868 869 869 870 for theory_dict in self.list_cb_theory.values(): 870 for _, value in theory_dict.ite ritems():871 for _, value in theory_dict.items(): 871 872 item, _, _ = value 872 873 if item.IsChecked(): … … 924 925 theory_key = [] 925 926 # remove data from treectrl 926 for d_key, item in self.list_cb_data.ite ritems():927 for d_key, item in self.list_cb_data.items(): 927 928 data_c, _, _, _, _, _, _, _ = item 928 929 if data_c.IsChecked(): 929 930 self.tree_ctrl.Delete(data_c) 930 931 data_key.append(d_key) 931 if d_key in self.list_cb_theory .keys():932 if d_key in self.list_cb_theory: 932 933 theory_list_ctrl = self.list_cb_theory[d_key] 933 theory_to_remove += theory_list_ctrl.keys()934 theory_to_remove += list(theory_list_ctrl.keys()) 934 935 # Remove theory from treectrl 935 for _, theory_dict in self.list_cb_theory.ite ritems():936 for key, value in theory_dict.ite ritems():936 for _, theory_dict in self.list_cb_theory.items(): 937 for key, value in theory_dict.items(): 937 938 item, _, _ = value 938 939 if item.IsChecked(): … … 950 951 # remove theory references independently of data 951 952 for key in theory_key: 952 for _, theory_dict in self.list_cb_theory.ite ritems():953 for _, theory_dict in self.list_cb_theory.items(): 953 954 if key in theory_dict: 954 for key, value in theory_dict.ite ritems():955 for key, value in theory_dict.items(): 955 956 item, _, _ = value 956 957 if item.IsChecked(): … … 1047 1048 if self.cb_plotpanel and self.cb_plotpanel.IsBeingDeleted(): 1048 1049 return 1049 for _, value in self.parent.plot_panels.ite ritems():1050 for _, value in self.parent.plot_panels.items(): 1050 1051 name_plot_panel = str(value.window_caption) 1051 1052 if name_plot_panel not in self.cb_plotpanel.GetItems(): … … 1129 1130 #import documentation window here to avoid circular imports 1130 1131 #if put at top of file with rest of imports. 1131 from documentation_window import DocumentationWindow1132 from .documentation_window import DocumentationWindow 1132 1133 1133 1134 _TreeLocation = "user/sasgui/guiframe/data_explorer_help.html" … … 1499 1500 window.Show(True) 1500 1501 window.load_data_list(list=temp_data_list) 1501 except :1502 except Exception as exc: 1502 1503 # raise 1503 print("error", sys.exc_value)1504 print("error", exc) 1504 1505 1505 1506 app.MainLoop()
Note: See TracChangeset
for help on using the changeset viewer.