Changeset 3260 for trunk/exports


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

misc Py3 fixes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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.