Skip to content
Permalink
Browse files

Tidy installer_data.py and utils.py

- Fix unused and missing imports
- Only import configparser is needed for Python 3
- Unnecessary string u prefix for Python 3
- Comment typo
  • Loading branch information
cjmayo authored and nyalldawson committed Aug 31, 2018
1 parent b2275df commit 70a37bf9819db4e22e729a5bc40118e9fef44ce7
Showing with 6 additions and 17 deletions.
  1. +4 −12 python/pyplugin_installer/installer_data.py
  2. +2 −5 python/utils.py
@@ -28,22 +28,14 @@
QLocale, QByteArray)
from qgis.PyQt.QtXml import QDomDocument
from qgis.PyQt.QtNetwork import QNetworkRequest, QNetworkReply
from qgis.core import QgsSettings
from qgis.core import Qgis, QgsSettings
import sys
import os
import codecs
import re
try:
import configparser
except ImportError:
import configparser as configparser
try:
from importlib import reload
except ImportError:
from imp import reload
import configparser
import qgis.utils
from qgis.core import QgsNetworkAccessManager, QgsApplication
from qgis.gui import QgsMessageBar
from qgis.utils import iface, plugin_paths
from .version_compare import pyQgisVersion, compareVersions, normalizeVersion, isCompatible

@@ -565,7 +557,7 @@ def getInstalledPlugin(self, key, path, readOnly):
""" get the metadata of an installed plugin """
def metadataParser(fct):
""" plugin metadata parser reimplemented from qgis.utils
for better control on wchich module is examined
for better control of which module is examined
in case there is an installed plugin masking a core one """
global errorDetails
cp = configparser.ConfigParser()
@@ -625,7 +617,7 @@ def pluginMetadata(fct):
else:
error = "broken"
e = errorDetails
errorDetails = QCoreApplication.translate("QgsPluginInstaller", u"Error reading metadata")
errorDetails = QCoreApplication.translate("QgsPluginInstaller", "Error reading metadata")
if e:
errorDetails += ": " + e

@@ -30,18 +30,15 @@

from qgis.PyQt.QtCore import QCoreApplication, QLocale, QThread
from qgis.PyQt.QtWidgets import QPushButton, QApplication
from qgis.core import Qgis, QgsExpression, QgsMessageLog, qgsfunction, QgsMessageOutput, QgsWkbTypes
from qgis.core import Qgis, QgsMessageLog, qgsfunction, QgsMessageOutput
from qgis.gui import QgsMessageBar

import os
import sys
import traceback
import glob
import os.path
try:
import configparser
except ImportError:
import ConfigParser as configparser
import configparser
import warnings
import codecs
import time

0 comments on commit 70a37bf

Please sign in to comment.
You can’t perform that action at this time.