# Path: ogrtools/pyogr/ogrinfo.py
# def ogr_version_num():
#     try:
#         return int(gdal.VersionInfo('VERSION_NUM'))
#     except:
#         return 1000


from PyQt4.QtCore import QSettings, QCoreApplication, QTranslator, qVersion
from PyQt4.QtGui import QAction, QIcon, QDockWidget
from ogrtools.pyogr.ogrinfo import ogr_version_num
from processing.core.Processing import Processing
from algorithms.interlis_provider import InterlisProvider
from interlisdialog import InterlisDialog
import resources_rc
import os.path
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 ***************************************************************************/
"""
# Import the PyQt and QGIS libraries
#from qgis.core import *
# Initialize Qt resources from file resources.py


class Interlis:

    def __init__(self, iface):
        # Save reference to the QGIS interface
        self.iface = iface
        # initialize plugin directory
        self.plugin_dir = os.path.dirname(__file__)
        # initialize locale
        locale = QSettings().value("locale/userLocale")[0:2]
        localePath = os.path.join(
            self.plugin_dir, 'i18n', 'interlis_{}.qm'.format(locale))

        if os.path.exists(localePath):
            self.translator = QTranslator()
            self.translator.load(localePath)

            if qVersion() > '4.3.3':
                QCoreApplication.installTranslator(self.translator)


# Path: ogrtools/pyogr/ogrinfo.py
# def ogr_version_num():
#     try:
#         return int(gdal.VersionInfo('VERSION_NUM'))
#     except:
#         return 1000


# Path: qgis/interlis/interlis.py
from PyQt4.QtCore import QSettings, QCoreApplication, QTranslator, qVersion
from PyQt4.QtGui import QAction, QIcon, QDockWidget
from ogrtools.pyogr.ogrinfo import ogr_version_num
from processing.core.Processing import Processing
from algorithms.interlis_provider import InterlisProvider
from interlisdialog import InterlisDialog
import resources_rc
import os.path

 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 ***************************************************************************/
"""
# Import the PyQt and QGIS libraries
#from qgis.core import *
# Initialize Qt resources from file resources.py


class Interlis:

    def __init__(self, iface):
        # Save reference to the QGIS interface
        self.iface = iface
        # initialize plugin directory
        self.plugin_dir = os.path.dirname(__file__)
        # initialize locale
        locale = QSettings().value("locale/userLocale")[0:2]
        localePath = os.path.join(
            self.plugin_dir, 'i18n', 'interlis_{}.qm'.format(locale))

        if os.path.exists(localePath):
            self.translator = QTranslator()
            self.translator.load(localePath)

            if qVersion() > '4.3.3':
                QCoreApplication.installTranslator(self.translator)


        if ogr_version_num() < 2000200: