mirror of
https://github.com/qgis/QGIS.git
synced 2025-10-15 00:02:52 -04:00
[processing] Avoid more deprecation warnings from external libraries
This commit is contained in:
parent
c1cc2b53d9
commit
2ff0d5919c
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user