Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[processing] Avoid more deprecation warnings from external libraries
  • Loading branch information
nyalldawson committed Mar 5, 2019
1 parent c1cc2b5 commit 2ff0d59
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions python/plugins/processing/algs/help/__init__.py
Expand Up @@ -25,7 +25,11 @@

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

Expand All @@ -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)
Expand Down

0 comments on commit 2ff0d59

Please sign in to comment.