Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Silence python warnings from 3rd party libraries on startup
- Loading branch information
|
@@ -29,6 +29,7 @@ |
|
|
|
|
|
import json |
|
|
import os.path |
|
|
import warnings |
|
|
from urllib.request import build_opener, install_opener, ProxyHandler |
|
|
|
|
|
from qgis.PyQt.QtCore import Qt |
|
@@ -43,7 +44,11 @@ |
|
|
from qgis.gui import QgsRubberBand |
|
|
from qgis.utils import OverrideCursor |
|
|
|
|
|
from owslib.csw import CatalogueServiceWeb # spellok |
|
|
with warnings.catch_warnings(): |
|
|
warnings.filterwarnings("ignore", category=ResourceWarning) |
|
|
warnings.filterwarnings("ignore", category=ImportWarning) |
|
|
from owslib.csw import CatalogueServiceWeb # spellok |
|
|
|
|
|
from owslib.fes import BBox, PropertyIsLike |
|
|
from owslib.ows import ExceptionReport |
|
|
|
|
|
|
@@ -27,6 +27,7 @@ |
|
|
# |
|
|
############################################################################### |
|
|
|
|
|
import warnings |
|
|
from qgis.core import QgsSettings |
|
|
from qgis.PyQt.QtWidgets import QDialog, QMessageBox |
|
|
|
|
|
|
@@ -27,6 +27,7 @@ |
|
|
# avoid PendingDeprecationWarning from PyQt4.uic |
|
|
import warnings |
|
|
warnings.filterwarnings("ignore", category=PendingDeprecationWarning) |
|
|
warnings.filterwarnings("ignore", category=DeprecationWarning) |
|
|
|
|
|
import configparser |
|
|
from gettext import gettext, ngettext |
|
|
|
@@ -29,15 +29,16 @@ |
|
|
import subprocess |
|
|
import platform |
|
|
import re |
|
|
import warnings |
|
|
|
|
|
import psycopg2 |
|
|
|
|
|
from osgeo import gdal |
|
|
from osgeo import ogr |
|
|
with warnings.catch_warnings(): |
|
|
warnings.filterwarnings("ignore", category=DeprecationWarning) |
|
|
from osgeo import ogr |
|
|
|
|
|
from qgis.core import (Qgis, |
|
|
QgsApplication, |
|
|
QgsCoordinateReferenceSystem, |
|
|
QgsVectorFileWriter, |
|
|
QgsProcessingFeedback, |
|
|
QgsProcessingUtils, |
|
@@ -49,7 +50,9 @@ |
|
|
from processing.tools.system import isWindows, isMac |
|
|
|
|
|
try: |
|
|
from osgeo import gdal # NOQA |
|
|
with warnings.catch_warnings(): |
|
|
warnings.filterwarnings("ignore", category=DeprecationWarning) |
|
|
from osgeo import gdal # NOQA |
|
|
|
|
|
gdalAvailable = True |
|
|
except: |
|
|
|
@@ -27,6 +27,7 @@ |
|
|
|
|
|
import os |
|
|
import re |
|
|
import warnings |
|
|
|
|
|
from qgis.PyQt import uic |
|
|
from qgis.PyQt.QtCore import Qt |
|
@@ -53,8 +54,10 @@ |
|
|
from processing.gui.ParameterGuiUtils import getFileFilter |
|
|
|
|
|
pluginPath = os.path.dirname(__file__) |
|
|
WIDGET, BASE = uic.loadUiType( |
|
|
os.path.join(pluginPath, 'DlgFieldsCalculator.ui')) |
|
|
with warnings.catch_warnings(): |
|
|
warnings.filterwarnings("ignore", category=DeprecationWarning) |
|
|
WIDGET, BASE = uic.loadUiType( |
|
|
os.path.join(pluginPath, 'DlgFieldsCalculator.ui')) |
|
|
|
|
|
|
|
|
class FieldCalculatorFeedback(QgsProcessingFeedback): |
|
|
|
@@ -26,13 +26,17 @@ |
|
|
__revision__ = '$Format:%H$' |
|
|
|
|
|
import os |
|
|
import warnings |
|
|
|
|
|
from qgis.PyQt import uic |
|
|
from qgis.PyQt.QtWidgets import QDialog |
|
|
|
|
|
pluginPath = os.path.split(os.path.dirname(__file__))[0] |
|
|
WIDGET, BASE = uic.loadUiType( |
|
|
os.path.join(pluginPath, 'ui', 'DlgAutofill.ui')) |
|
|
|
|
|
with warnings.catch_warnings(): |
|
|
warnings.filterwarnings("ignore", category=DeprecationWarning) |
|
|
WIDGET, BASE = uic.loadUiType( |
|
|
os.path.join(pluginPath, 'ui', 'DlgAutofill.ui')) |
|
|
|
|
|
|
|
|
class AutofillDialog(BASE, WIDGET): |
|
|
|
@@ -27,6 +27,7 @@ |
|
|
|
|
|
import os |
|
|
import json |
|
|
import warnings |
|
|
|
|
|
from qgis.PyQt import uic |
|
|
from qgis.PyQt.QtWidgets import QTableWidgetItem, QComboBox, QHeaderView, QFileDialog, QMessageBox |
|
@@ -43,8 +44,11 @@ |
|
|
from processing.tools import dataobjects |
|
|
|
|
|
pluginPath = os.path.split(os.path.dirname(__file__))[0] |
|
|
WIDGET, BASE = uic.loadUiType( |
|
|
os.path.join(pluginPath, 'ui', 'widgetBatchPanel.ui')) |
|
|
|
|
|
with warnings.catch_warnings(): |
|
|
warnings.filterwarnings("ignore", category=DeprecationWarning) |
|
|
WIDGET, BASE = uic.loadUiType( |
|
|
os.path.join(pluginPath, 'ui', 'widgetBatchPanel.ui')) |
|
|
|
|
|
|
|
|
class BatchPanel(BASE, WIDGET): |
|
|
|
@@ -26,6 +26,7 @@ |
|
|
__revision__ = '$Format:%H$' |
|
|
|
|
|
import os |
|
|
import warnings |
|
|
|
|
|
from qgis.PyQt import uic |
|
|
from qgis.PyQt.QtCore import Qt, QEvent |
|
@@ -61,8 +62,10 @@ |
|
|
|
|
|
|
|
|
pluginPath = os.path.split(os.path.dirname(__file__))[0] |
|
|
WIDGET, BASE = uic.loadUiType( |
|
|
os.path.join(pluginPath, 'ui', 'DlgConfig.ui')) |
|
|
with warnings.catch_warnings(): |
|
|
warnings.filterwarnings("ignore", category=DeprecationWarning) |
|
|
WIDGET, BASE = uic.loadUiType( |
|
|
os.path.join(pluginPath, 'ui', 'DlgConfig.ui')) |
|
|
|
|
|
|
|
|
class ConfigOptionsPage(QgsOptionsPageWidget): |
|
|
|
@@ -27,6 +27,7 @@ |
|
|
|
|
|
import re |
|
|
import os |
|
|
import warnings |
|
|
|
|
|
from qgis.PyQt import uic |
|
|
from qgis.PyQt.QtCore import QCoreApplication, QDir, pyqtSignal |
|
@@ -49,8 +50,11 @@ |
|
|
from processing.gui.ParameterGuiUtils import getFileFilter |
|
|
|
|
|
pluginPath = os.path.split(os.path.dirname(__file__))[0] |
|
|
WIDGET, BASE = uic.loadUiType( |
|
|
os.path.join(pluginPath, 'ui', 'widgetBaseSelector.ui')) |
|
|
|
|
|
with warnings.catch_warnings(): |
|
|
warnings.filterwarnings("ignore", category=DeprecationWarning) |
|
|
WIDGET, BASE = uic.loadUiType( |
|
|
os.path.join(pluginPath, 'ui', 'widgetBaseSelector.ui')) |
|
|
|
|
|
|
|
|
class DestinationSelectionPanel(BASE, WIDGET): |
|
|
|
@@ -26,15 +26,18 @@ |
|
|
__revision__ = '$Format:%H$' |
|
|
|
|
|
import os |
|
|
import warnings |
|
|
|
|
|
from qgis.PyQt import uic |
|
|
from qgis.core import QgsSettings |
|
|
from qgis.PyQt.QtWidgets import QDialog, QAbstractItemView, QPushButton, QDialogButtonBox, QFileDialog |
|
|
from qgis.PyQt.QtGui import QStandardItemModel, QStandardItem |
|
|
|
|
|
pluginPath = os.path.split(os.path.dirname(__file__))[0] |
|
|
WIDGET, BASE = uic.loadUiType( |
|
|
os.path.join(pluginPath, 'ui', 'DlgMultipleSelection.ui')) |
|
|
with warnings.catch_warnings(): |
|
|
warnings.filterwarnings("ignore", category=DeprecationWarning) |
|
|
WIDGET, BASE = uic.loadUiType( |
|
|
os.path.join(pluginPath, 'ui', 'DlgMultipleSelection.ui')) |
|
|
|
|
|
|
|
|
class DirectorySelectorDialog(BASE, WIDGET): |
|
|
|
@@ -26,6 +26,7 @@ |
|
|
__revision__ = '$Format:%H$' |
|
|
|
|
|
import os |
|
|
import warnings |
|
|
|
|
|
from qgis.PyQt import uic |
|
|
from qgis.PyQt.QtCore import Qt |
|
@@ -38,8 +39,11 @@ |
|
|
from processing.gui.RenderingStyleFilePanel import RenderingStyleFilePanel |
|
|
|
|
|
pluginPath = os.path.split(os.path.dirname(__file__))[0] |
|
|
WIDGET, BASE = uic.loadUiType( |
|
|
os.path.join(pluginPath, 'ui', 'DlgRenderingStyles.ui')) |
|
|
|
|
|
with warnings.catch_warnings(): |
|
|
warnings.filterwarnings("ignore", category=DeprecationWarning) |
|
|
WIDGET, BASE = uic.loadUiType( |
|
|
os.path.join(pluginPath, 'ui', 'DlgRenderingStyles.ui')) |
|
|
|
|
|
|
|
|
class EditRenderingStylesDialog(BASE, WIDGET): |
|
|
|
@@ -26,6 +26,7 @@ |
|
|
__revision__ = '$Format:%H$' |
|
|
|
|
|
import os |
|
|
import warnings |
|
|
|
|
|
from qgis.PyQt import uic |
|
|
from qgis.PyQt.QtWidgets import QMenu, QAction, QInputDialog |
|
@@ -45,8 +46,11 @@ |
|
|
from processing.tools.dataobjects import createContext |
|
|
|
|
|
pluginPath = os.path.split(os.path.dirname(__file__))[0] |
|
|
WIDGET, BASE = uic.loadUiType( |
|
|
os.path.join(pluginPath, 'ui', 'widgetBaseSelector.ui')) |
|
|
|
|
|
with warnings.catch_warnings(): |
|
|
warnings.filterwarnings("ignore", category=DeprecationWarning) |
|
|
WIDGET, BASE = uic.loadUiType( |
|
|
os.path.join(pluginPath, 'ui', 'widgetBaseSelector.ui')) |
|
|
|
|
|
|
|
|
class ExtentSelectionPanel(BASE, WIDGET): |
|
|
|
@@ -26,6 +26,7 @@ |
|
|
__revision__ = '$Format:%H$' |
|
|
|
|
|
import os |
|
|
import warnings |
|
|
|
|
|
from qgis.PyQt import uic |
|
|
from qgis.PyQt.QtWidgets import QFileDialog |
|
@@ -34,8 +35,11 @@ |
|
|
from processing.tools.system import isWindows |
|
|
|
|
|
pluginPath = os.path.split(os.path.dirname(__file__))[0] |
|
|
WIDGET, BASE = uic.loadUiType( |
|
|
os.path.join(pluginPath, 'ui', 'widgetBaseSelector.ui')) |
|
|
|
|
|
with warnings.catch_warnings(): |
|
|
warnings.filterwarnings("ignore", category=DeprecationWarning) |
|
|
WIDGET, BASE = uic.loadUiType( |
|
|
os.path.join(pluginPath, 'ui', 'widgetBaseSelector.ui')) |
|
|
|
|
|
|
|
|
class FileSelectionPanel(BASE, WIDGET): |
|
|
|
@@ -26,14 +26,18 @@ |
|
|
__revision__ = '$Format:%H$' |
|
|
|
|
|
import os |
|
|
import warnings |
|
|
|
|
|
from qgis.PyQt import uic |
|
|
from qgis.PyQt.QtWidgets import QDialog, QPushButton, QAbstractItemView, QDialogButtonBox |
|
|
from qgis.PyQt.QtGui import QStandardItemModel, QStandardItem |
|
|
|
|
|
pluginPath = os.path.split(os.path.dirname(__file__))[0] |
|
|
WIDGET, BASE = uic.loadUiType( |
|
|
os.path.join(pluginPath, 'ui', 'DlgFixedTable.ui')) |
|
|
|
|
|
with warnings.catch_warnings(): |
|
|
warnings.filterwarnings("ignore", category=DeprecationWarning) |
|
|
WIDGET, BASE = uic.loadUiType( |
|
|
os.path.join(pluginPath, 'ui', 'DlgFixedTable.ui')) |
|
|
|
|
|
|
|
|
class FixedTableDialog(BASE, WIDGET): |
|
|
|
@@ -26,14 +26,18 @@ |
|
|
__revision__ = '$Format:%H$' |
|
|
|
|
|
import os |
|
|
import warnings |
|
|
|
|
|
from qgis.PyQt import uic |
|
|
|
|
|
from processing.gui.FixedTableDialog import FixedTableDialog |
|
|
|
|
|
pluginPath = os.path.split(os.path.dirname(__file__))[0] |
|
|
WIDGET, BASE = uic.loadUiType( |
|
|
os.path.join(pluginPath, 'ui', 'widgetBaseSelector.ui')) |
|
|
|
|
|
with warnings.catch_warnings(): |
|
|
warnings.filterwarnings("ignore", category=DeprecationWarning) |
|
|
WIDGET, BASE = uic.loadUiType( |
|
|
os.path.join(pluginPath, 'ui', 'widgetBaseSelector.ui')) |
|
|
|
|
|
|
|
|
class FixedTablePanel(BASE, WIDGET): |
|
|
|
@@ -27,6 +27,7 @@ |
|
|
|
|
|
import os |
|
|
import json |
|
|
import warnings |
|
|
|
|
|
from qgis.PyQt import uic |
|
|
from qgis.PyQt.QtWidgets import QDialog, QTreeWidgetItem |
|
@@ -38,8 +39,11 @@ |
|
|
QgsProcessingModelAlgorithm) |
|
|
|
|
|
pluginPath = os.path.split(os.path.dirname(__file__))[0] |
|
|
WIDGET, BASE = uic.loadUiType( |
|
|
os.path.join(pluginPath, 'ui', 'DlgHelpEdition.ui')) |
|
|
|
|
|
with warnings.catch_warnings(): |
|
|
warnings.filterwarnings("ignore", category=DeprecationWarning) |
|
|
WIDGET, BASE = uic.loadUiType( |
|
|
os.path.join(pluginPath, 'ui', 'DlgHelpEdition.ui')) |
|
|
|
|
|
|
|
|
class HelpEditionDialog(BASE, WIDGET): |
|
|
|
@@ -26,6 +26,7 @@ |
|
|
__revision__ = '$Format:%H$' |
|
|
|
|
|
import os |
|
|
import warnings |
|
|
|
|
|
from qgis.PyQt import uic |
|
|
from qgis.PyQt.QtCore import Qt, QCoreApplication |
|
@@ -35,8 +36,11 @@ |
|
|
from processing.core.ProcessingLog import ProcessingLog |
|
|
|
|
|
pluginPath = os.path.split(os.path.dirname(__file__))[0] |
|
|
WIDGET, BASE = uic.loadUiType( |
|
|
os.path.join(pluginPath, 'ui', 'DlgHistory.ui')) |
|
|
|
|
|
with warnings.catch_warnings(): |
|
|
warnings.filterwarnings("ignore", category=DeprecationWarning) |
|
|
WIDGET, BASE = uic.loadUiType( |
|
|
os.path.join(pluginPath, 'ui', 'DlgHistory.ui')) |
|
|
|
|
|
|
|
|
class HistoryDialog(BASE, WIDGET): |
|
|
|
@@ -26,6 +26,7 @@ |
|
|
__revision__ = '$Format:%H$' |
|
|
|
|
|
import os |
|
|
import warnings |
|
|
|
|
|
from qgis.PyQt import uic |
|
|
from qgis.PyQt.QtGui import QDesktopServices |
|
@@ -34,8 +35,10 @@ |
|
|
from qgis.utils import iface |
|
|
|
|
|
pluginPath = os.path.split(os.path.dirname(__file__))[0] |
|
|
WIDGET, BASE = uic.loadUiType( |
|
|
os.path.join(pluginPath, 'ui', 'DlgMessage.ui')) |
|
|
with warnings.catch_warnings(): |
|
|
warnings.filterwarnings("ignore", category=DeprecationWarning) |
|
|
WIDGET, BASE = uic.loadUiType( |
|
|
os.path.join(pluginPath, 'ui', 'DlgMessage.ui')) |
|
|
|
|
|
|
|
|
class MessageDialog(BASE, WIDGET): |
|
|
|
@@ -28,6 +28,7 @@ |
|
|
__revision__ = '$Format:%H$' |
|
|
|
|
|
import os |
|
|
import warnings |
|
|
|
|
|
from qgis.core import QgsSettings |
|
|
from qgis.PyQt import uic |
|
@@ -36,8 +37,11 @@ |
|
|
from qgis.PyQt.QtGui import QStandardItemModel, QStandardItem |
|
|
|
|
|
pluginPath = os.path.split(os.path.dirname(__file__))[0] |
|
|
WIDGET, BASE = uic.loadUiType( |
|
|
os.path.join(pluginPath, 'ui', 'DlgMultipleSelection.ui')) |
|
|
|
|
|
with warnings.catch_warnings(): |
|
|
warnings.filterwarnings("ignore", category=DeprecationWarning) |
|
|
WIDGET, BASE = uic.loadUiType( |
|
|
os.path.join(pluginPath, 'ui', 'DlgMultipleSelection.ui')) |
|
|
|
|
|
|
|
|
class MultipleFileInputDialog(BASE, WIDGET): |
|
|
Oops, something went wrong.