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_image.py

    r1191 r1261  
    4343        # load all of the tree into a set of dicts
    4444        self.loadTree()
    45         if self.ExportSelect(False): return
     45        if self.ExportSelect(): return # select one image; ask for a file name
    4646        # process the selected image(s) (at present only one image)
    4747        for i in sorted(self.histnam):
     48            filename = os.path.join(
     49                self.dirname,
     50                os.path.splitext(self.filename)[0] + self.extension
     51                )
    4852            imgFile = self.Histograms[i].get('Data',(None,None))
    4953            Comments,Data,Npix,Image = G2IO.GetImageData(self.G2frame,imgFile)
    50             scipy.misc.imsave(self.filename,Image)
    51             print('Image '+str(imgFile)+' written to file '+str(self.filename))                   
     54            scipy.misc.imsave(filename,Image)
     55            print('Image '+str(imgFile)+' written to file '+str(filename))
     56           
Note: See TracChangeset for help on using the changeset viewer.