Skip to content
Permalink
Browse files

only check connections XML if file can be parsed

  • Loading branch information
tomkralidis committed Feb 27, 2015
1 parent c33c097 commit e0acd90d0d973e2ddfce5b190605e08ac0f66244
Showing with 3 additions and 4 deletions.
  1. +3 −4 python/plugins/MetaSearch/util.py
@@ -81,17 +81,16 @@ def get_connections_from_file(parent, filename):
error = 0
try:
doc = etree.parse(filename).getroot()
if doc.tag != 'qgsCSWConnections':
error = 1
msg = parent.tr('Invalid CSW connections XML.')
except etree.ParseError, err:
error = 1
msg = parent.tr('Cannot parse XML file: %s' % err)
except IOError, err:
error = 1
msg = parent.tr('Cannot open file: %s' % err)

if doc.tag != 'qgsCSWConnections':
error = 1
msg = parent.tr('Invalid CSW connections XML.')

if error == 1:
QMessageBox.information(parent, parent.tr('Loading Connections'), msg)
return

0 comments on commit e0acd90

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