Changeset 86d6abd in sasview for src/sas


Ignore:
Timestamp:
May 2, 2018 3:43:43 AM (7 years ago)
Author:
wojciech
Branches:
master, magnetic_scatt, release-4.2.2, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, unittest-saveload
Children:
b80d945
Parents:
f387050
Message:

message dialog added

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/sas/sasview/sasview.py

    rf387050 r86d6abd  
    205205    logger = logging.getLogger(__name__) 
    206206    try: 
    207         # need shell=True on windows to keep console box from popping up 
    208         shell = (os.name == 'nt') 
    209         subprocess.check_output("cc", shell=shell, stderr=subprocess.STDOUT) 
    210     except OSError: 
    211         print("No compiler installed. Please follow installation instructions\n") 
    212         logger.error("No compiler installed. Please follow installation instructions\n") 
     207        subprocess.check_output(["cc","--version"], stderr=subprocess.STDOUT) 
     208    except subprocess.CalledProcessError as exc: 
     209        #At this stage wx should be working as it is imported earlier 
     210        import wx 
     211        app = wx.App() 
     212        dlg = wx.MessageBox('No compiler installed. Please follow instruction for ' 
     213                      'Xcode command line installation and restart SasView' 
     214                      'SasView is terminating now', 
     215                      'Info', wx.OK | wx.ICON_INFORMATION) 
     216        dlg.Destroy() 
     217        logger.error("No compiler installed. %s\n"%(exc)) 
    213218        logger.error(traceback.format_exc()) 
    214     except subprocess.CalledProcessError: 
    215         pass 
     219 
     220        raise RuntimeError("Terminating sasview") 
    216221 
    217222def setup_sasmodels(): 
Note: See TracChangeset for help on using the changeset viewer.