Skip to content

Commit

Permalink
Merge pull request #1568 from SasView/ticket_1560_dll_path
Browse files Browse the repository at this point in the history
Set SAS_DLL_PATH on sasview startup
  • Loading branch information
Wojciech Potrzebowski authored Jun 1, 2020
2 parents dae24eb + 1d61d89 commit 3a842c8
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/sas/qtgui/MainWindow/MainWindow.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
# UNLESS EXEPTIONALLY REQUIRED TRY TO AVOID IMPORTING ANY MODULES HERE
# ESPECIALLY ANYTHING IN SAS, SASMODELS NAMESPACE
import os
import sys

from PyQt5.QtWidgets import QMainWindow
from PyQt5.QtWidgets import QMdiArea
from PyQt5.QtWidgets import QSplashScreen
from PyQt5.QtWidgets import QApplication
from PyQt5.QtGui import QPixmap
from PyQt5.QtCore import Qt
import os
import sys

# Local UI
from sas.qtgui.UI import main_resources_rc
from .UI.MainWindowUI import Ui_SasView
Expand Down Expand Up @@ -61,8 +63,11 @@ def run_sasview():
from sas.logger_config import SetupLogger
SetupLogger(__name__).config_development()

# initialize OpenCL setting
from sas import get_custom_config
# initialize sasmodels settings
from sas import get_custom_config, get_user_dir
if "SAS_DLL_PATH" not in os.environ:
os.environ["SAS_DLL_PATH"] = os.path.join(
get_user_dir(), "compiled_models")
SAS_OPENCL = get_custom_config().SAS_OPENCL
if SAS_OPENCL and "SAS_OPENCL" not in os.environ:
os.environ["SAS_OPENCL"] = SAS_OPENCL
Expand All @@ -79,7 +84,6 @@ def run_sasview():
#app.setStyle('Fusion')

# fix for pyinstaller packages app to avoid ReactorAlreadyInstalledError
import sys
if 'twisted.internet.reactor' in sys.modules:
del sys.modules['twisted.internet.reactor']

Expand Down

0 comments on commit 3a842c8

Please sign in to comment.