Changeset 985ad94 in sasview


Ignore:
Timestamp:
Aug 4, 2017 7:17:06 AM (7 years ago)
Author:
Piotr Rozyczko <rozyczko@…>
Branches:
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
Children:
ee18d33
Parents:
7adc2a8
Message:

Fixed pyinstaller build

Files:
5 edited

Legend:

Unmodified
Added
Removed
  • sasview/sasview.py

    r2a8bd705 r985ad94  
    1313################################################################################ 
    1414import sys 
     15import os 
    1516 
    1617from sas.sasview.logger_config import SetupLogger 
     
    1819logger = SetupLogger(__name__).config_production() 
    1920 
    20  
    2121# Log the start of the session 
    2222logger.info(" --- SasView session started ---") 
    2323# Log the python version 
    2424logger.info("Python: %s" % sys.version) 
    25  
    2625 
    2726reload(sys) 
     
    3736    from multiprocessing import freeze_support 
    3837    freeze_support() 
     38    os.environ['QT_API'] = "pyqt" 
    3939    from sas.qtgui.MainWindow.MainWindow import run 
    4040    run() 
  • sasview/sasview.spec

    r2a8bd705 r985ad94  
    5151datas.append(('welcome_panel.py','.')) 
    5252 
     53# pyinstaller gets mightily confused by upper/lower case, 
     54# so some modules need to be copied explicitly to avoid 
     55# messages like 
     56# WARNING: Attempted to add Python module twice with different upper/lowercases 
    5357datas.append((os.path.join(PYTHON_LOC,'Lib','SocketServer.py'),'.')) 
     58datas.append((os.path.join(PYTHON_LOC,'Lib','Queue.py'),'.')) 
    5459 
    5560# TODO 
  • setup.py

    • Property mode changed from 100755 to 100644
    rb854587 r985ad94  
    193193packages.append("sas.sasgui") 
    194194 
     195# qt module 
     196package_dir["sas.qtgui"] = os.path.join("src", "sas", "qtgui") 
     197packages.append("sas.qtgui") 
     198 
    195199# sas module 
    196200package_dir["sas.sascalc"] = os.path.join("src", "sas", "sascalc") 
     
    264268packages.extend(["sas.sascalc.file_converter", 
    265269                 "sas.sascalc.file_converter.core"]) 
     270 
    266271ext_modules.append(Extension("sas.sascalc.file_converter.core.bsl_loader", 
    267272                             sources=[os.path.join(mydir, "bsl_loader.c")], 
    268273                             include_dirs=[np.get_include()], 
    269274                             )) 
    270  
    271275# sas.sascalc.corfunc 
    272276package_dir["sas.sascalc.corfunc"] = os.path.join( 
    273277    "src", "sas", "sascalc", "corfunc") 
    274  
    275278packages.extend(["sas.sascalc.corfunc"]) 
    276279 
     
    325328    "src", "sas", "sasgui", "plottools") 
    326329packages.append("sas.sasgui.plottools") 
     330 
     331# QTGUI 
     332## UI 
     333package_dir["sas.qtgui.UI"] = os.path.join( 
     334    "src", "sas", "qtgui", "UI") 
     335packages.append("sas.qtgui.UI") 
     336 
     337## Utilities 
     338package_dir["sas.qtgui.Utilities"] = os.path.join( 
     339    "src", "sas", "qtgui", "Utilities") 
     340packages.append("sas.qtgui.Utilities") 
     341 
     342package_dir["sas.qtgui.Calculators"] = os.path.join( 
     343    "src", "sas", "qtgui", "Calculators") 
     344package_dir["sas.qtgui.Calculators.UI"] = os.path.join( 
     345    "src", "sas", "qtgui", "Calculators", "UI") 
     346packages.extend(["sas.qtgui.Calculators", "sas.qtgui.Calculators.UI"]) 
     347 
     348package_dir["sas.qtgui.MainWindow"] = os.path.join( 
     349    "src", "sas", "qtgui", "MainWindow") 
     350package_dir["sas.qtgui.MainWindow.UI"] = os.path.join( 
     351    "src", "sas", "qtgui", "MainWindow", "UI") 
     352packages.extend(["sas.qtgui.MainWindow", "sas.qtgui.MainWindow.UI"]) 
     353 
     354## Perspectives 
     355package_dir["sas.qtgui.Perspectives"] = os.path.join( 
     356    "src", "sas", "qtgui", "Perspectives") 
     357packages.append("sas.qtgui.Perspectives") 
     358 
     359package_dir["sas.qtgui.Perspectives.Invariant"] = os.path.join( 
     360    "src", "sas", "qtgui", "Perspectives", "Invariant") 
     361package_dir["sas.qtgui.Perspectives.Invariant.UI"] = os.path.join( 
     362    "src", "sas", "qtgui", "Perspectives", "Invariant", "UI") 
     363packages.extend(["sas.qtgui.Perspectives.Invariant", "sas.qtgui.Perspectives.Invariant.UI"]) 
     364 
     365package_dir["sas.qtgui.Perspectives.Fitting"] = os.path.join( 
     366    "src", "sas", "qtgui", "Perspectives", "Fitting") 
     367package_dir["sas.qtgui.Perspectives.Fitting.UI"] = os.path.join( 
     368    "src", "sas", "qtgui", "Perspectives", "Fitting", "UI") 
     369packages.extend(["sas.qtgui.Perspectives.Fitting", "sas.qtgui.Perspectives.Fitting.UI"]) 
     370 
     371## Plotting 
     372package_dir["sas.qtgui.Plotting"] = os.path.join( 
     373    "src", "sas", "qtgui", "Plotting") 
     374package_dir["sas.qtgui.Plotting.UI"] = os.path.join( 
     375    "src", "sas", "qtgui", "Plotting", "UI") 
     376package_dir["sas.qtgui.Plotting.Slicers"] = os.path.join( 
     377    "src", "sas", "qtgui", "Plotting", "Slicers") 
     378packages.extend(["sas.qtgui.Plotting", "sas.qtgui.Plotting.UI", "sas.qtgui.Plotting.Slicers"]) 
     379 
     380 
    327381 
    328382# # Last of the sas.models 
     
    421475    entry_points={ 
    422476        'console_scripts': [ 
    423             "sasview = sas.sasview.sasview:run", 
     477            "sasview = sas.run", 
    424478        ] 
    425479    }, 
  • src/sas/qtgui/Utilities/GuiUtils.py

    r6ff2eb3 r985ad94  
    9696 
    9797## TODO: CHANGE FOR SHIPPED PATH IN RELEASE 
    98 HELP_DIRECTORY_LOCATION = "docs/sphinx-docs/build/html" 
     98if os.path.splitext(sys.argv[0])[1].lower() != ".py": 
     99     HELP_DIRECTORY_LOCATION = "doc" 
     100else: 
     101     HELP_DIRECTORY_LOCATION = "docs/sphinx-docs/build/html" 
    99102IMAGES_DIRECTORY_LOCATION = HELP_DIRECTORY_LOCATION + "/_images" 
    100103 
  • src/sas/qtgui/Utilities/IPythonWidget.py

    • Property mode changed from 100755 to 100644
    r83eb5208 r985ad94  
     1def new_load_qt(api_options): 
     2    from PyQt4 import QtCore, QtGui, QtSvg 
     3    return QtCore, QtGui, QtSvg, 'pyqt' 
     4 
     5def qtconsole_new_load_qt(api_options): 
     6    from PyQt4 import QtCore, QtGui, QtSvg 
     7 
     8    # Alias PyQt-specific functions for PySide compatibility. 
     9    QtCore.Signal = QtCore.pyqtSignal 
     10    QtCore.Slot = QtCore.pyqtSlot 
     11    return QtCore, QtGui, QtSvg, 'pyqt' 
     12 
     13# Do some monkey patching to satisfy pyinstaller complaining 
     14# about pyside/pyqt confusion 
     15from IPython.external import  qt_loaders 
     16qt_loaders.load_qt = new_load_qt 
     17 
     18from qtconsole import qt_loaders as qtconsole_qt_loaders 
     19qtconsole_qt_loaders.load_qt = qtconsole_new_load_qt 
     20 
     21 
    122from qtconsole.rich_jupyter_widget import RichJupyterWidget 
    223from qtconsole.inprocess import QtInProcessKernelManager 
Note: See TracChangeset for help on using the changeset viewer.