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 re
|
||||||
import sys
|
import sys
|
||||||
import traceback
|
import traceback
|
||||||
|
from imp import find_module
|
||||||
from optparse import AmbiguousOptionError, BadOptionError, OptionParser
|
from optparse import AmbiguousOptionError, BadOptionError, OptionParser
|
||||||
|
|
||||||
from logbook import CRITICAL, DEBUG, ERROR, FingersCrossedHandler, INFO, Logger, NestedSetup, NullHandler, StreamHandler, TimedRotatingFileHandler, WARNING, \
|
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:
|
if wx and ErrorFrame:
|
||||||
pyfa_gui = wx.App(False)
|
pyfa_gui = wx.App(False)
|
||||||
if exc_type == PreCheckException:
|
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:
|
else:
|
||||||
ErrorFrame(exc_value, tb)
|
ErrorFrame(exc_value, tb)
|
||||||
|
|
||||||
@@ -144,7 +146,8 @@ def handleGUIException(exc_type, exc_value, exc_traceback):
|
|||||||
if wx and ErrorFrame:
|
if wx and ErrorFrame:
|
||||||
pyfa_gui = wx.App(False)
|
pyfa_gui = wx.App(False)
|
||||||
if exc_type == PreCheckException:
|
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:
|
else:
|
||||||
ErrorFrame(exc_value, tb)
|
ErrorFrame(exc_value, tb)
|
||||||
|
|
||||||
@@ -352,6 +355,20 @@ if __name__ == "__main__":
|
|||||||
else:
|
else:
|
||||||
pyfalog.warning("Unknown sqlalchemy version string format, skipping check. Version: {0}", sqlalchemy.__version__)
|
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
|
import eos.db
|
||||||
# noinspection PyUnresolvedReferences
|
# noinspection PyUnresolvedReferences
|
||||||
import service.prefetch # noqa: F401
|
import service.prefetch # noqa: F401
|
||||||
@@ -364,9 +381,11 @@ if __name__ == "__main__":
|
|||||||
|
|
||||||
from gui.mainFrame import MainFrame
|
from gui.mainFrame import MainFrame
|
||||||
|
|
||||||
|
|
||||||
|
test = 1/0
|
||||||
|
|
||||||
pyfa = wx.App(False)
|
pyfa = wx.App(False)
|
||||||
MainFrame(options.title)
|
MainFrame(options.title)
|
||||||
test = 1/0
|
|
||||||
pyfa.MainLoop()
|
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.
|
# 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
|
matplotlib
|
||||||
PyYAML
|
PyYAML >= 3.12
|
||||||
python-dateutil
|
python-dateutil
|
||||||
urllib3
|
urllib3
|
||||||
requests==2.11.1
|
requests == 2.11.1
|
||||||
sqlalchemy>=1.0.5
|
sqlalchemy >= 1.0.5
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ PyInstaller >= 3.2.1
|
|||||||
cycler >= 0.10.0
|
cycler >= 0.10.0
|
||||||
functools32 >= 3.2.3
|
functools32 >= 3.2.3
|
||||||
future >= 0.16.0
|
future >= 0.16.0
|
||||||
numpy >= 1.12.
|
numpy >= 1.12
|
||||||
pyparsing >= 2.1.10
|
pyparsing >= 2.1.10
|
||||||
pytz >= 2016.10
|
pytz >= 2016.10
|
||||||
six
|
six
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ PyInstaller >= 3.2.1
|
|||||||
cycler >= 0.10.0
|
cycler >= 0.10.0
|
||||||
functools32 >= 3.2.3
|
functools32 >= 3.2.3
|
||||||
future >= 0.16.0
|
future >= 0.16.0
|
||||||
numpy >= 1.12.
|
numpy >= 1.12
|
||||||
pyparsing >= 2.1.10
|
pyparsing >= 2.1.10
|
||||||
pypiwin32 >= 219
|
pypiwin32 >= 219
|
||||||
pytz >= 2016.10
|
pytz >= 2016.10
|
||||||
@@ -2,7 +2,7 @@ PyInstaller >= 3.2.1
|
|||||||
cycler >= 0.10.0
|
cycler >= 0.10.0
|
||||||
functools32 >= 3.2.3
|
functools32 >= 3.2.3
|
||||||
future >= 0.16.0
|
future >= 0.16.0
|
||||||
numpy >= 1.12.
|
numpy >= 1.12
|
||||||
pyparsing >= 2.1.10
|
pyparsing >= 2.1.10
|
||||||
pypiwin32 >= 219
|
pypiwin32 >= 219
|
||||||
pytz >= 2016.10
|
pytz >= 2016.10
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
pytest==3.0.3
|
pytest == 3.0.3
|
||||||
pytest-mock==1.2
|
pytest-mock == 1.2
|
||||||
pytest-cov==2.3.1
|
pytest-cov == 2.3.1
|
||||||
pytest-capturelog==0.7
|
pytest-capturelog == 0.7
|
||||||
coverage==4.2
|
coverage == 4.2
|
||||||
coveralls==1.1
|
coveralls == 1.1
|
||||||
codecov
|
codecov
|
||||||
tox
|
tox
|
||||||
|
|||||||
Reference in New Issue
Block a user