Changeset 5251ec6 in sasview for src/sas/sasgui/perspectives/calculator/gen_scatter_panel.py
- Timestamp:
- Oct 11, 2018 2: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/perspectives/calculator/gen_scatter_panel.py
r20fa5fe r5251ec6 228 228 sizer.Add(unit_title, (iy, ix), (1, 1), \ 229 229 wx.EXPAND | wx.ADJUST_MINSIZE, 0) 230 key_list = params.keys() 231 key_list.sort() 232 for param in key_list: 230 for param in sorted(params.keys()): 233 231 iy += 1 234 232 ix = 0 … … 341 339 ix = 0 342 340 iy = 0 343 #key_list.sort()344 341 name = wx.StaticText(self, -1, 'No. of Qx (Qy) bins: ') 345 342 sizer.Add(name, (iy, ix), (1, 1), \ … … 509 506 wildcard = '|'.join(wildcard) 510 507 dlg = wx.FileDialog(self, "Choose a file", location, 511 "", wildcard, wx. OPEN)508 "", wildcard, wx.FD_OPEN) 512 509 if dlg.ShowModal() == wx.ID_OK: 513 510 path = dlg.GetPath() … … 556 553 self.reader.queue() 557 554 #self.load_update() 558 except :555 except Exception as exc: 559 556 self.ext = None 560 557 if self.parent.parent is None: 561 558 return 562 msg = "Generic SAS Calculator: %s" % (sys.exc_value)559 msg = "Generic SAS Calculator: %s" % exc 563 560 wx.PostEvent(self.parent.parent, 564 561 StatusEvent(status=msg, type='stop')) … … 774 771 if output.pix_type == 'atom': 775 772 # Get atom names not in the list 776 a_names = [symb for symb in pix_symbol \777 if symb not in color_dic .keys()]773 a_names = [symb for symb in pix_symbol 774 if symb not in color_dic] 778 775 a_name = a_names[0] 779 776 for name in a_names: … … 898 895 cal_out.queue() 899 896 900 except :901 msg = "%s." % sys.exc_value897 except Exception as exc: 898 msg = "%s." % exc 902 899 status_type = 'stop' 903 900 self._status_info(msg, status_type) … … 1344 1341 self.sld_data.is_data = False 1345 1342 self.sld_data.filename = "Default SLD Profile" 1346 except :1347 msg = "OMF Panel: %s" % sys.exc_value1343 except Exception as exc: 1344 msg = "OMF Panel: %s" % exc 1348 1345 infor = 'Error' 1349 1346 #logger.error(msg) … … 1441 1438 raise 1442 1439 sld_key_list = self._get_slds_key_list(omfdata) 1443 # Dic is not sorted1444 key_list = [key for key in sld_key_list.keys()]1445 # Sort here1446 key_list.sort()1447 1440 is_data = self.sld_data.is_data 1448 1441 sizer = wx.GridBagSizer(2, 3) 1449 1442 ix = 0 1450 1443 iy = -1 1451 for key in key_list: 1452 value = sld_key_list[key] 1444 for key, value in sorted(sld_key_list.items()): 1453 1445 iy += 1 1454 1446 ix = 0 … … 1485 1477 ix = 0 1486 1478 iy = -1 1487 for key, value in key_list.iteritems():1479 for key, value in sorted(key_list.items()): 1488 1480 iy += 1 1489 1481 ix = 0 … … 1520 1512 ix = 0 1521 1513 iy = -1 1522 #key_list.sort() 1523 for key, value in key_list.iteritems(): 1514 for key, value in sorted(key_list.items()): 1524 1515 iy += 1 1525 1516 ix = 0
Note: See TracChangeset
for help on using the changeset viewer.