from __future__ import (absolute_import, division, print_function)
from qtpy.QtWidgets import (QMessageBox)
from qtpy import PYQT_VERSION, PYQT4, PYQT5
# qtpy does not provide an abstraction for this
if PYQT5:
    from PyQt5.QtCore import QT_VERSION_STR
elif PYQT4:
    from PyQt4.QtCore import QT_VERSION_STR
else:
    raise RuntimeError('unknown qt version')
from numpy.version import version as numpy_version_str
from matplotlib import __version__ as matplotlib_version_str
import mantid
import sys
import addie._version as addie_version
try:
    import pyoncat
    # module doesn't have an obvious way to get version information
    pyoncat_version = 'enabled'
except ImportError:
    pyoncat_version = 'disabled'



class AboutDialog(object):

    def __init__(self, parent=None):
        self.parent = parent

    def display(self):
        addie_version = self.get_appli_version()
        python_version = self.get_python_version()
        numpy_version = numpy_version_str
        mantid_version = mantid.__version__
        matplotlib_version = matplotlib_version_str
        qt_version = QT_VERSION_STR
        pyqt_version = PYQT_VERSION

        message = ''' Addie

        version %s

        Library versions:
           - Python: %s
           - Numpy: %s
           - Mantid: %s
           - Matplotlib: %s
           - pyoncat: %s
           - Qt: %s
           - PyQt: %s
        ''' % (addie_version,
               python_version,
               numpy_version,
               mantid_version,
               matplotlib_version,
               pyoncat_version,
               qt_version,
               pyqt_version)

        QMessageBox.about(self.parent, "About Addie", message)

    def get_appli_version(self):
        _version = addie_version.get_versions()
        return str(_version['version'][0:5])

    def get_python_version(self):
        str_version = sys.version_info
        str_array = []
        for value in str_version:
            str_array.append(str(value))
        return ".".join(str_array[0:3])

@@ -145,16 +145,196 @@
 , PYQT5%0A
+from numpy.version import version as numpy_version_str%0Afrom matplotlib import __version__ as matplotlib_version_str%0Aimport sys%0Aimport mantid%0Aimport addie._version as addie_version%0A
 # qtpy d
@@ -426,16 +426,24 @@
 SION_STR
+  # noqa
 %0Aelif PY
@@ -490,16 +490,24 @@
 SION_STR
+  # noqa
 %0Aelse:%0A 
@@ -554,311 +554,75 @@
 n')%0A
-from numpy.version import version as numpy_version_str%0Afrom matplotlib import __version__ as matplotlib_version_str%0Aimport mantid%0Aimport sys%0Aimport addie._version as addie_version%0Atry:%0A    import pyoncat%0A    # module doesn't have an obvious way to get version information%0A    pyoncat_version = 'enabled'
+try:%0A    from pyoncat import __version__ as pyoncat_version  # noqa
 %0Aexc
@@ -673,17 +673,16 @@
 bled'%0A%0A%0A
-%0A
 class Ab

Fix flake8 warnings