Changeset 3260


Ignore:
Timestamp:
Feb 4, 2018 9:38:11 AM (4 years ago)
Author:
toby
Message:

misc Py3 fixes

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIIO.py

    r3254 r3260  
    18581858            if key[2].startswith('dA'):
    18591859                self.parmDict[i] = 0.0
    1860         for i,(val,sig) in data_name.get('depParmDict',{}).iteritems():
     1860        for i,(val,sig) in data_name.get('depParmDict',{}).items():
    18611861            self.parmDict[i] = val
    18621862            self.sigDict[i] = sig
     
    19131913        Dlookup = {}
    19141914        varied = [striphist(i) for i in data_name['varyList']]
    1915         for item,val in data_name['newCellDict'].iteritems():
     1915        for item,val in data_name['newCellDict'].items():
    19161916            if item in varied:
    19171917                ESDlookup[val[0]] = item
  • trunk/GSASIIpwdGUI.py

    r3248 r3260  
    761761            dlg.Destroy()
    762762        for r in rows:
    763             for lbl,c in refOpts.iteritems():
     763            for lbl,c in refOpts.items():
    764764                data['peaks'][r][c] = lbl in sels
    765765        UpdatePeakGrid(G2frame,data)
  • trunk/exports/G2export_CIF.py

    r3253 r3260  
    5353except ImportError:
    5454    pass
     55import GSASIIobj as G2obj
    5556import GSASIImath as G2mth
    5657import GSASIIspc as G2spc
     
    324325    WriteCIFitem(fp, '\nloop_  _atom_type_symbol _atom_type_number_in_cell')
    325326    formula = ''
    326     for elem in HillSortElements(compDict.keys()):
     327    for elem in HillSortElements(list(compDict.keys())):
    327328        WriteCIFitem(fp, '  ' + PutInCol(elem,4) +
    328329                     G2mth.ValEsd(compDict[elem],-0.009,True))
     
    441442            CIFobj = G2dict.get("CIF_template")
    442443            if defaultname:
    443                 defaultname = defaultname.encode('ascii','replace').strip().replace(' ','_')
     444                defaultname = G2obj.StripUnicode(defaultname)
    444445                defaultname = re.sub(r'[^a-zA-Z0-9_-]','',defaultname)
    445446                defaultname = tmplate + "_" + defaultname + ".cif"
     
    29452946        self.CIF = G2dict.get("CIF_template")
    29462947        if defaultname:
    2947             self.defaultname = defaultname.encode('ascii','replace').strip().replace(' ','_')
     2948            self.defaultname = G2obj.StripUnicode(defaultname)
    29482949            self.defaultname = re.sub(r'[^a-zA-Z0-9_-]','',self.defaultname)
    29492950            self.defaultname = tmplate + "_" + self.defaultname + ".cif"
Note: See TracChangeset for help on using the changeset viewer.