Ignore:
Timestamp:
Mar 24, 2014 5:22:41 PM (8 years ago)
Author:
toby
Message:

reorg exports to implement directory selection

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/exports/G2export_shelx.py

    r1123 r1261  
    4949        # create a dict with refined values and their uncertainties
    5050        self.loadParmDict()
    51         if self.ExportSelect(  # set export parameters
    52             AskFile=True): return
     51        if self.ExportSelect(): return  # set export parameters;
     52        filename = self.filename
    5353        for phasenam in self.phasenam:
    5454            phasedict = self.Phases[phasenam] # pointer to current phase info           
    5555            i = self.Phases[phasenam]['pId']
    5656            if len(self.phasenam) > 1: # if more than one filename is included, add a phase #
    57                 nam,ext = os.path.splitext(self.filename)
    58                 fil = nam+"_"+str(i)+ext
    59             else:
    60                 fil = self.filename
    61             fp = self.OpenFile(fil)
     57                self.filename = os.path.splitext(filename)[1] + "_" + str(i) + self.extension
     58            fp = self.OpenFile()
    6259            # title line
    6360            self.Write("TITL from "+str(self.G2frame.GSASprojectfile)+", phase "+str(phasenam))
     
    124121            self.Write('END')
    125122            self.CloseFile()
    126             print('Phase '+str(phasenam)+' written to file '+str(fil))
     123            print('Phase '+str(phasenam)+' written to file '+str(self.fullpath))
Note: See TracChangeset for help on using the changeset viewer.