[processing] Avoid more deprecation warnings from external libraries

This commit is contained in:
Nyall Dawson 2019-03-04 21:31:08 +10:00
parent c1cc2b53d9
commit 2ff0d5919c

View File

@ -25,7 +25,11 @@ __revision__ = '$Format:%H$'
import os
import codecs
import yaml
import warnings
with warnings.catch_warnings():
warnings.filterwarnings("ignore", category=DeprecationWarning)
import yaml
from qgis.core import QgsSettings, Qgis
from qgis.PyQt.QtCore import QLocale, QCoreApplication
@ -37,10 +41,12 @@ def loadShortHelp():
if f.endswith("yaml"):
filename = os.path.join(path, f)
with codecs.open(filename, encoding='utf-8') as stream:
for k, v in yaml.load(stream).items():
if v is None:
continue
h[k] = QCoreApplication.translate("{}Algorithm".format(f[:-5].upper()), v)
with warnings.catch_warnings():
warnings.filterwarnings("ignore", category=DeprecationWarning)
for k, v in yaml.load(stream).items():
if v is None:
continue
h[k] = QCoreApplication.translate("{}Algorithm".format(f[:-5].upper()), v)
version = ".".join(Qgis.QGIS_VERSION.split(".")[0:2])
overrideLocale = QgsSettings().value('locale/overrideFlag', False, bool)