Changeset 2818


Ignore:
Timestamp:
May 2, 2017 1:39:22 PM (6 years ago)
Author:
vondreele
Message:

add GetPhaseNames?(fl) to G2obj - uses opened gpx file
fix PhaseSelector? & remove ShowBusy? & DoneBusy? from G2IO - not used ever

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASII.py

    r2817 r2818  
    636636                if h.startswith('HKLF ') and h not in usedHKLFhists:
    637637                    usedHKLFhists.append(h)
     638                   
     639                   
    638640        rdlist = self.OnImportGeneric(reqrdr,self.ImportPhaseReaderlist,
    639641            'phase',usedRanIdList=phaseRIdList)
  • trunk/GSASIIIO.py

    r2817 r2818  
    3333GSASIIpath.SetVersionNumber("$Revision$")
    3434import GSASIIgrid as G2gd
    35 import GSASIIspc as G2spc
    3635import GSASIIobj as G2obj
    3736import GSASIIlattice as G2lat
     
    12021201    return result
    12031202
    1204 def PhaseSelector(self, ChoiceList, ParentFrame=None,
     1203def PhaseSelector(ChoiceList, ParentFrame=None,
    12051204    title='Select a phase', size=None,header='Phase Selector'):
    12061205    ''' Provide a wx dialog to select a phase if the file contains more
     
    12101209        size,header)
    12111210
    1212 def ShowBusy():
    1213     wx.BeginBusyCursor()
    1214 #        wx.Yield() # make it happen now!
    1215 
    1216 def DoneBusy():
    1217     wx.EndBusyCursor()
    1218     wx.Yield() # make it happen now!
    12191211######################################################################
    12201212def striphist(var,insChar=''):
  • trunk/GSASIIobj.py

    r2817 r2818  
    864864import sys
    865865import os.path as ospath
     866import cPickle
    866867import GSASIIpath
    867868import GSASIImath as G2mth
     
    980981'''
    981982P1SGData = G2spc.SpcGroup('P 1')[1] # data structure for default space group
     983
     984def GetPhaseNames(fl):
     985    ''' Returns a list of phase names found under 'Phases' in GSASII gpx file
     986    NB: there is another one of these in GSASIIstrIO.py that uses the gpx filename
     987
     988    :param file fl: opened .gpx file
     989    :return: list of phase names
     990    '''
     991    PhaseNames = []
     992    while True:
     993        try:
     994            data = cPickle.load(fl)
     995        except EOFError:
     996            break
     997        datum = data[0]
     998        if 'Phases' == datum[0]:
     999            for datus in data[1:]:
     1000                PhaseNames.append(datus[0])
     1001    fl.seek(0)          #reposition file
     1002    return PhaseNames
    9821003
    9831004def SetNewPhase(Name='New Phase',SGData=None,cell=None,Super=None):
  • trunk/docs/source/imports.rst

    r2817 r2818  
    154154``Reader()`` routines that may encounter more than one set of information
    155155in a file.
    156 Likewise, when an operation will take some time to complete,
    157 use :meth:`~GSASIIIO.ShowBusy` and
    158 :meth:`~GSASIIIO.DoneBusy` to show the user that something is happening.
    159156
    160157ContentsValidator()
Note: See TracChangeset for help on using the changeset viewer.