Skip to content
Snippets Groups Projects
utils.py 2.08 KiB
Newer Older
  • Learn to ignore specific revisions
  • # -*- coding: utf-8 -*-
    """
    /***************************************************************************
    
                                  -------------------
            begin                : 2015-08-20
            git sha              : $Format:%H$
            copyright            : (C) 2017 by HU-Berlin
            email                : benjamin.jakimow@geo.hu-berlin.de
     ***************************************************************************/
    
    /***************************************************************************
     *                                                                         *
     *   This program is free software; you can redistribute it and/or modify  *
     *   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.                                   *
     *                                                                         *
     ***************************************************************************/
    """
    # noinspection PyPep8Naming
    
    Benjamin Jakimow's avatar
    Benjamin Jakimow committed
    import os, sys, math, re, io, fnmatch, uuid
    
    Benjamin Jakimow's avatar
    Benjamin Jakimow committed
    from qgis.core import *
    
    Benjamin Jakimow's avatar
    Benjamin Jakimow committed
    from qgis.gui import *
    
    Benjamin Jakimow's avatar
    Benjamin Jakimow committed
    import qgis.utils
    
    from PyQt5.QtCore import *
    
    from PyQt5.QtWidgets import *
    
    from PyQt5.QtGui import *
    from PyQt5.QtXml import QDomDocument
    from PyQt5 import uic
    
    from eotimeseriesviewer.externals.qps.utils import *
    
    from eotimeseriesviewer import DIR_UI
    
    Benjamin Jakimow's avatar
    Benjamin Jakimow committed
    UI_DIRECTORIES.append(DIR_UI)
    
    
    MAP_LAYER_STORES = [QgsProject.instance()]
    
    Benjamin Jakimow's avatar
    Benjamin Jakimow committed
    def qgisInstance():
        """
        If existent, returns the QGIS Instance.
        :return: QgisInterface | None
        """
    
    
        from eotimeseriesviewer.main import TimeSeriesViewer
    
    Benjamin Jakimow's avatar
    Benjamin Jakimow committed
        if isinstance(qgis.utils.iface, QgisInterface) and \
            not isinstance(qgis.utils.iface, TimeSeriesViewer):
            return qgis.utils.iface
        else:
            return None
    
    
    def settings():
    
        return QSettings('HU-Berlin', 'EO Time Series Viewer')