Changeset 5047898 in sasview


Ignore:
Timestamp:
Oct 1, 2018 3:10:54 AM (3 weeks ago)
Author:
wojciech
Branches:
ESS_GUI, ESS_GUI_project_save
Children:
4cbd87f
Parents:
085ee014 (diff), 16417bb (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
git-author:
wpotrzebowski <Wojciech.Potrzebowski@…> (10/01/18 03:10:40)
git-committer:
wpotrzebowski <Wojciech.Potrzebowski@…> (10/01/18 03:10:54)
Message:

Removing tmp file handling from report logic to make it work on OSX

Files:
4 edited

Legend:

Unmodified
Added
Removed
  • build_tools/conda_qt5_min_centos.yml

    rb38871e r16417bb  
    1515 - pytest 
    1616 - mako 
    17  - pyinstaller  
     17 - pyinstaller 
     18 - testpath=0.3.1 
    1819# GPU not set for Centos build system 
    1920# - pyopencl 
  • build_tools/conda_qt5_min_osx.yml

    r65e76ed r16417bb  
    77 - hdf5 
    88 - h5py 
    9  - ipython 
     9 - ipython=6 
    1010 - jupyter 
    1111 - twisted 
     
    1717 - pyinstaller  
    1818 - pyopencl 
     19 - testpath=0.3.1 
    1920 - pip: 
    2021   - pytools  
  • build_tools/conda_qt5_win.yml

    rb38871e r16417bb  
    88 - hdf5 
    99 - h5py 
    10  - ipython 
     10 - ipython=6 
     11 - ipykernel=5 
    1112 - jupyter 
    1213 - twisted 
     
    1819 - pyinstaller  
    1920 - pyopencl 
     21 - testpath=0.3.1 
    2022 - pip: 
    2123   - pytools  
  • src/sas/qtgui/Perspectives/Fitting/ReportPageLogic.py

    r5330be2 r085ee014  
    9999            canvas = FigureCanvas(fig) 
    100100            png_output = BytesIO() 
    101  
    102             # Create a "safe" location - system tmp 
    103             tmp_file = tempfile.TemporaryFile(suffix=".png") 
    104101            try: 
    105                 fig.savefig(tmp_file.name, dpi=75) 
    106                 fig.savefig(png_output, dpi=75) 
    107             except PermissionError: 
    108                 # sometimes one gets "permission denied" for temp files 
    109                 # mainly on Windows 7 *gasp*. Let's try local directory 
    110                 tmp_file = open("_tmp.png", "w+") 
    111                 try: 
    112                     fig.savefig(tmp_file.name, dpi=75) 
    113                     fig.savefig(png_output, dpi=75) 
    114                 except Exception as ex: 
    115                     logging.error("Creating of the report failed: %s"%str(ex)) 
    116                     return 
    117  
    118             data_to_print = png_output.getvalue() == open(tmp_file.name, 'rb').read() 
    119             tmp_file.close() 
     102                fig.savefig(png_output, format="png", dpi=75) 
     103            except PermissionError as ex: 
     104                logging.error("Creating of the report failed: %s"%str(ex)) 
     105                return 
    120106            data64 = base64.b64encode(png_output.getvalue()) 
    121107            data_to_print = urllib.parse.quote(data64) 
    122  
    123108            feet = FEET_2 
    124109            if sys.platform == "darwin":  # Mac 
     
    126111            html += feet.format(data_to_print) 
    127112            html += ELINE 
     113            png_output.close() 
    128114            del canvas 
    129115        return html 
Note: See TracChangeset for help on using the changeset viewer.