diff --git a/pyfa.py b/pyfa.py index 939393a99..691a9c177 100755 --- a/pyfa.py +++ b/pyfa.py @@ -24,6 +24,7 @@ import platform import re import sys import traceback +from imp import find_module from optparse import AmbiguousOptionError, BadOptionError, OptionParser from logbook import CRITICAL, DEBUG, ERROR, FingersCrossedHandler, INFO, Logger, NestedSetup, NullHandler, StreamHandler, TimedRotatingFileHandler, WARNING, \ @@ -122,7 +123,8 @@ def handleGUIException(exc_type, exc_value, exc_traceback): if wx and ErrorFrame: pyfa_gui = wx.App(False) if exc_type == PreCheckException: - ErrorFrame(exc_value, None, "Missing Prerequisite") + msgbox = wx.MessageBox(exc_value.message, 'Error', wx.ICON_ERROR | wx.STAY_ON_TOP) + msgbox.ShowModal() else: ErrorFrame(exc_value, tb) @@ -144,7 +146,8 @@ def handleGUIException(exc_type, exc_value, exc_traceback): if wx and ErrorFrame: pyfa_gui = wx.App(False) if exc_type == PreCheckException: - ErrorFrame(exc_value, None, "Missing Prerequisite") + msgbox = wx.MessageBox(exc_value.message, 'Error', wx.ICON_ERROR | wx.STAY_ON_TOP) + msgbox.ShowModal() else: ErrorFrame(exc_value, tb) @@ -352,6 +355,20 @@ if __name__ == "__main__": else: pyfalog.warning("Unknown sqlalchemy version string format, skipping check. Version: {0}", sqlalchemy.__version__) + requirements_path = os.path.join(config.pyfaPath, "requirements.txt") + if os.path.exists(requirements_path): + file = open(requirements_path, "r") + for requirement in file: + requirement = requirement.replace("\n", "") + requirement_parsed = requirement.split(' ') + if requirement_parsed: + try: + find_module(requirement_parsed[0]) + except ImportError as e: + pyfalog.warning("Possibly missing required module: {0}", requirement_parsed[0]) + if len(requirement_parsed) == 3: + pyfalog.warning("Recommended version {0} {1}", requirement_parsed[1], requirement_parsed[2]) + import eos.db # noinspection PyUnresolvedReferences import service.prefetch # noqa: F401 @@ -364,9 +381,11 @@ if __name__ == "__main__": from gui.mainFrame import MainFrame + + test = 1/0 + pyfa = wx.App(False) MainFrame(options.title) - test = 1/0 pyfa.MainLoop() # TODO: Add some thread cleanup code here. Right now we bail, and that can lead to orphaned threads or threads not properly exiting. diff --git a/requirements.txt b/requirements.txt index d3bc33dde..cac9199c4 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,7 +1,7 @@ -logbook>=1.0.0 +logbook >= 1.0.0 matplotlib -PyYAML +PyYAML >= 3.12 python-dateutil urllib3 -requests==2.11.1 -sqlalchemy>=1.0.5 +requests == 2.11.1 +sqlalchemy >= 1.0.5 diff --git a/requirements_build_linux.txt b/requirements_build_linux.txt index 3a4640baf..28f42aa34 100644 --- a/requirements_build_linux.txt +++ b/requirements_build_linux.txt @@ -2,7 +2,7 @@ PyInstaller >= 3.2.1 cycler >= 0.10.0 functools32 >= 3.2.3 future >= 0.16.0 -numpy >= 1.12. +numpy >= 1.12 pyparsing >= 2.1.10 pytz >= 2016.10 six diff --git a/requirements_build_OSx.txt b/requirements_build_osx.txt similarity index 90% rename from requirements_build_OSx.txt rename to requirements_build_osx.txt index 51f6135fd..67b64e480 100644 --- a/requirements_build_OSx.txt +++ b/requirements_build_osx.txt @@ -2,7 +2,7 @@ PyInstaller >= 3.2.1 cycler >= 0.10.0 functools32 >= 3.2.3 future >= 0.16.0 -numpy >= 1.12. +numpy >= 1.12 pyparsing >= 2.1.10 pypiwin32 >= 219 pytz >= 2016.10 diff --git a/requirements_build_windows.txt b/requirements_build_windows.txt index 173ce92d0..c25a341af 100644 --- a/requirements_build_windows.txt +++ b/requirements_build_windows.txt @@ -2,7 +2,7 @@ PyInstaller >= 3.2.1 cycler >= 0.10.0 functools32 >= 3.2.3 future >= 0.16.0 -numpy >= 1.12. +numpy >= 1.12 pyparsing >= 2.1.10 pypiwin32 >= 219 pytz >= 2016.10 diff --git a/requirements_test.txt b/requirements_test.txt index 33f8973cd..50191648d 100644 --- a/requirements_test.txt +++ b/requirements_test.txt @@ -1,8 +1,8 @@ -pytest==3.0.3 -pytest-mock==1.2 -pytest-cov==2.3.1 -pytest-capturelog==0.7 -coverage==4.2 -coveralls==1.1 +pytest == 3.0.3 +pytest-mock == 1.2 +pytest-cov == 2.3.1 +pytest-capturelog == 0.7 +coverage == 4.2 +coveralls == 1.1 codecov tox