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