Ignore:
Timestamp:
Oct 11, 2018 2:20:56 PM (6 years ago)
Author:
Paul Kienzle <pkienzle@…>
Branches:
master, magnetic_scatt, release-4.2.2, ticket-1009, ticket-1249
Children:
98b9f32
Parents:
67ed543
Message:

improved support for py37 in sasgui

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/sas/sasgui/perspectives/calculator/gen_scatter_panel.py

    r20fa5fe r5251ec6  
    228228        sizer.Add(unit_title, (iy, ix), (1, 1), \ 
    229229                            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()): 
    233231            iy += 1 
    234232            ix = 0 
     
    341339        ix = 0 
    342340        iy = 0 
    343         #key_list.sort() 
    344341        name = wx.StaticText(self, -1, 'No. of Qx (Qy) bins: ') 
    345342        sizer.Add(name, (iy, ix), (1, 1), \ 
     
    509506        wildcard = '|'.join(wildcard) 
    510507        dlg = wx.FileDialog(self, "Choose a file", location, 
    511                             "", wildcard, wx.OPEN) 
     508                            "", wildcard, wx.FD_OPEN) 
    512509        if dlg.ShowModal() == wx.ID_OK: 
    513510            path = dlg.GetPath() 
     
    556553            self.reader.queue() 
    557554            #self.load_update() 
    558         except: 
     555        except Exception as exc: 
    559556            self.ext = None 
    560557            if self.parent.parent is None: 
    561558                return 
    562             msg = "Generic SAS Calculator: %s" % (sys.exc_value) 
     559            msg = "Generic SAS Calculator: %s" % exc 
    563560            wx.PostEvent(self.parent.parent, 
    564561                          StatusEvent(status=msg, type='stop')) 
     
    774771            if output.pix_type == 'atom': 
    775772                # 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] 
    778775                a_name = a_names[0] 
    779776                for name in a_names: 
     
    898895            cal_out.queue() 
    899896 
    900         except: 
    901             msg = "%s." % sys.exc_value 
     897        except Exception as exc: 
     898            msg = "%s." % exc 
    902899            status_type = 'stop' 
    903900            self._status_info(msg, status_type) 
     
    13441341            self.sld_data.is_data = False 
    13451342            self.sld_data.filename = "Default SLD Profile" 
    1346         except: 
    1347             msg = "OMF Panel: %s" % sys.exc_value 
     1343        except Exception as exc: 
     1344            msg = "OMF Panel: %s" % exc 
    13481345            infor = 'Error' 
    13491346            #logger.error(msg) 
     
    14411438            raise 
    14421439        sld_key_list = self._get_slds_key_list(omfdata) 
    1443         # Dic is not sorted 
    1444         key_list = [key for key in sld_key_list.keys()] 
    1445         # Sort here 
    1446         key_list.sort() 
    14471440        is_data = self.sld_data.is_data 
    14481441        sizer = wx.GridBagSizer(2, 3) 
    14491442        ix = 0 
    14501443        iy = -1 
    1451         for key in key_list: 
    1452             value = sld_key_list[key] 
     1444        for key, value in sorted(sld_key_list.items()): 
    14531445            iy += 1 
    14541446            ix = 0 
     
    14851477        ix = 0 
    14861478        iy = -1 
    1487         for key, value in key_list.iteritems(): 
     1479        for key, value in sorted(key_list.items()): 
    14881480            iy += 1 
    14891481            ix = 0 
     
    15201512        ix = 0 
    15211513        iy = -1 
    1522         #key_list.sort() 
    1523         for key, value in key_list.iteritems(): 
     1514        for key, value in sorted(key_list.items()): 
    15241515            iy += 1 
    15251516            ix = 0 
Note: See TracChangeset for help on using the changeset viewer.