Ignore:
Timestamp:
Jan 14, 2018 11:28:10 AM (4 years ago)
Author:
toby
Message:

fix histogram export file naming

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/exports/G2export_FIT2D.py

    r3180 r3223  
    6363        filenamelist = []
    6464        for hist in self.histnam:
    65             # multiple files: create a unique name from the histogram
    66             fileroot = G2obj.MakeUniqueLabel(self.MakePWDRfilename(hist),filenamelist)
    67             # create an instrument parameter file
     65            if len(self.histnam) == 1:
     66                name = self.filename
     67            else:    # multiple files: create a unique name from the histogram
     68                name = self.MakePWDRfilename(hist)
     69            fileroot = os.path.splitext(G2obj.MakeUniqueLabel(name,filenamelist))[0]
    6870            self.filename = os.path.join(self.dirname,fileroot + self.extension)
    6971            self.Writer(hist)
     
    112114        filenamelist = []
    113115        for hist in self.histnam:
    114             # multiple files: create a unique name from the histogram
    115             fileroot = G2obj.MakeUniqueLabel(self.MakePWDRfilename(hist),filenamelist)
    116             # create an instrument parameter file
     116            if len(self.histnam) == 1:
     117                name = self.filename
     118            else:    # multiple files: create a unique name from the histogram
     119                name = self.MakePWDRfilename(hist)
     120            fileroot = os.path.splitext(G2obj.MakeUniqueLabel(name,filenamelist))[0]
    117121            self.filename = os.path.join(self.dirname,fileroot + self.extension)
    118122            self.Writer(hist)
Note: See TracChangeset for help on using the changeset viewer.