mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-15 00:04:00 -04:00
allow utf8 in metadata.txt
This commit is contained in:
parent
95dcd96045
commit
8609a41deb
@ -28,6 +28,7 @@ from PyQt4.QtXml import QDomDocument
|
||||
from PyQt4.QtNetwork import *
|
||||
import sys
|
||||
import os
|
||||
import codecs
|
||||
import ConfigParser
|
||||
import qgis.utils
|
||||
from qgis.core import *
|
||||
@ -556,12 +557,10 @@ class Plugins(QObject):
|
||||
if not os.path.exists(metadataFile):
|
||||
return "" # plugin has no metadata.txt file
|
||||
cp = ConfigParser.ConfigParser()
|
||||
res = cp.read(metadataFile)
|
||||
if not len(res):
|
||||
return "" # failed reading metadata.txt file
|
||||
try:
|
||||
cp.readfp(codecs.open(metadataFile, "r", "utf8"))
|
||||
return cp.get('general', fct)
|
||||
except Exception:
|
||||
except:
|
||||
return ""
|
||||
|
||||
if readOnly:
|
||||
|
@ -38,6 +38,7 @@ import os.path
|
||||
import re
|
||||
import ConfigParser
|
||||
import warnings
|
||||
import codecs
|
||||
|
||||
#######################
|
||||
# ERROR HANDLING
|
||||
@ -129,8 +130,10 @@ def findPlugins(path):
|
||||
continue
|
||||
|
||||
cp = ConfigParser.ConfigParser()
|
||||
res = cp.read(metadataFile)
|
||||
if len(res) == 0:
|
||||
|
||||
try:
|
||||
cp.readfp(codecs.open(metadataFile, "r", "utf8"))
|
||||
except:
|
||||
return None # reading of metadata file failed
|
||||
|
||||
pluginName = os.path.basename(plugin)
|
||||
|
Loading…
x
Reference in New Issue
Block a user