mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-25 00:58:06 -05:00
only check connections XML if file can be parsed
This commit is contained in:
parent
c33c097706
commit
e0acd90d0d
@ -81,6 +81,9 @@ 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)
|
||||
@ -88,10 +91,6 @@ def get_connections_from_file(parent, filename):
|
||||
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
|
||||
|
Loading…
x
Reference in New Issue
Block a user