Changeset 4343 for trunk/GSASIIIO.py


Ignore:
Timestamp:
Mar 5, 2020 10:48:06 AM (20 months ago)
Author:
toby
Message:

deal with exporters sharing extension in autointegration

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIIO.py

    r4324 r4343  
    19621962def ExportPowderList(G2frame):
    19631963    '''Returns a list of extensions supported by :func:`GSASIIIO:ExportPowder`
    1964     This is used in :meth:`GSASIIimgGUI.AutoIntFrame` only.
     1964    along with their descriptions (note that a extension may be repeated
     1965    but descriptions are unique).
     1966    This is used in :meth:`GSASIIimgGUI.AutoIntFrame` only.
    19651967   
    19661968    :param wx.Frame G2frame: the GSAS-II main data tree window
    19671969    '''
    19681970    extList = []
     1971    extLabel = []
    19691972    for obj in G2frame.exporterlist:
    19701973        if 'powder' in obj.exporttype:
     
    19721975                obj.Writer
    19731976                extList.append(obj.extension)
     1977                extLabel.append(obj.formatName)
    19741978            except AttributeError:
    19751979                pass
    1976     return extList
    1977 
    1978 def ExportPowder(G2frame,TreeName,fileroot,extension):
     1980    return extList,extLabel
     1981
     1982def ExportPowder(G2frame,TreeName,fileroot,extension,hint=''):
    19791983    '''Writes a single powder histogram using the Export routines.
    19801984    This is used in :meth:`GSASIIimgGUI.AutoIntFrame` only.
     
    19851989    :param str extension: extension for file to be written (start with '.'). Must
    19861990      match a powder export routine that has a Writer object.
     1991    :param str hint: a string that must match the export's format
    19871992    '''
    19881993    filename = os.path.abspath(os.path.splitext(fileroot)[0]+extension)
    19891994    for obj in G2frame.exporterlist:
    19901995        if obj.extension == extension and 'powder' in obj.exporttype:
     1996            if hint and hint not in obj.formatName: continue
    19911997            obj.currentExportType = 'powder'
    19921998            obj.InitExport(None)
Note: See TracChangeset for help on using the changeset viewer.