Clean up requirements file. Add detection and warning for possibly missing requirement. Change back to using the modal.
This commit is contained in:
25
pyfa.py
25
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.
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user