Changeset ec3bd65 in sasview


Ignore:
Timestamp:
Nov 30, 2014 9:14:29 AM (10 years ago)
Author:
Peter Parker
Branches:
master, ESS_GUI, ESS_GUI_Docs, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_iss959, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc, costrafo411, magnetic_scatt, release-4.1.1, release-4.1.2, release-4.2.2, release_4.0.1, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
Children:
9729a6d
Parents:
1447af3
Message:

Refs #202 - Allow for dynamic selection of wxPython version via an environment variable.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sansview/sansview.py

    r1790664 rec3bd65  
    1616                    filename=os.path.join(os.path.expanduser("~"), 
    1717                                          'sasview.log')) 
     18 
     19# Allow the dynamic selection of wxPython via an evironment variable, when devs 
     20# who have multiple versions of the module installed want to pick between them. 
     21# This variable does not have to be set of course, and through normal usage will 
     22# probably not be, but this can make things a little easier when upgrading to a 
     23# new version of wx. 
     24WX_ENV_VAR = "SASVIEW_WX_VERSION" 
     25if WX_ENV_VAR in os.environ: 
     26    logging.info("You have set the %s environment variable to %s." % (WX_ENV_VAR, os.environ[WX_ENV_VAR])) 
     27    import wxversion 
     28    if wxversion.checkInstalled(os.environ[WX_ENV_VAR]): 
     29        logging.info("Version %s of wxPython is installed, so using that version." % os.environ[WX_ENV_VAR]) 
     30        wxversion.select(os.environ[WX_ENV_VAR]) 
     31    else: 
     32        logging.error("Version %s of wxPython is not installed, so using default version." % os.environ[WX_ENV_VAR]) 
     33else: 
     34    logging.info("You have not set the %s environment variable, so using default version of wxPython." % os.environ[WX_ENV_VAR]) 
    1835 
    1936import wx 
Note: See TracChangeset for help on using the changeset viewer.