Skip to content
Permalink
Browse files

allow utf8 in metadata.txt

  • Loading branch information
jef-n committed Jun 9, 2013
1 parent 95dcd96 commit 8609a41debed824d33076b61a74d3bbad8c55e0f
Showing with 8 additions and 6 deletions.
  1. +3 −4 python/pyplugin_installer/installer_data.py
  2. +5 −2 python/utils.py
@@ -28,6 +28,7 @@
from PyQt4.QtNetwork import *
import sys
import os
import codecs
import ConfigParser
import qgis.utils
from qgis.core import *
@@ -556,12 +557,10 @@ def pluginMetadata(fct):
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 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)

0 comments on commit 8609a41

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