Ignore:
Timestamp:
Sep 6, 2018 2:11:25 PM (6 years ago)
Author:
krzywon
Branches:
master, magnetic_scatt, release-4.2.2, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, unittest-saveload
Children:
44e8f48
Parents:
fa412df
Message:

Remove image references when report is closed and point to correct file locations when saving reports to PDF.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/sas/sasgui/perspectives/fitting/report_dialog.py

    r69a6897 rd0ce666f  
    7474        # save figures 
    7575        pictures = [] 
    76         for num in range(self.nimages): 
    77             pic_name = basename + '_img%s.png' % num 
     76        i = 0 
     77        for url in self.fig_urls: 
     78            append_me = url.split(':')[1] 
     79            pic_name = basename + '_{}'.format(append_me) 
    7880            # save the image for use with pdf writer 
    79             self.report_list[2][num].savefig(pic_name) 
     81            self.report_list[2][i].savefig(pic_name) 
    8082            pictures.append(pic_name) 
     83            i += 1 
    8184 
    8285        # translate png references int html from in-memory name to on-disk name 
    83         html = self.report_html.replace("memory:img_fit", basename+'_img') 
     86        html = self.report_html.replace("memory:", basename+'_') 
    8487 
    8588        #set file extensions 
Note: See TracChangeset for help on using the changeset viewer.