mirror of
https://github.com/qgis/QGIS.git
synced 2025-10-16 00:05:45 -04: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
|
error = 0
|
||||||
try:
|
try:
|
||||||
doc = etree.parse(filename).getroot()
|
doc = etree.parse(filename).getroot()
|
||||||
|
if doc.tag != 'qgsCSWConnections':
|
||||||
|
error = 1
|
||||||
|
msg = parent.tr('Invalid CSW connections XML.')
|
||||||
except etree.ParseError, err:
|
except etree.ParseError, err:
|
||||||
error = 1
|
error = 1
|
||||||
msg = parent.tr('Cannot parse XML file: %s' % err)
|
msg = parent.tr('Cannot parse XML file: %s' % err)
|
||||||
@ -88,10 +91,6 @@ def get_connections_from_file(parent, filename):
|
|||||||
error = 1
|
error = 1
|
||||||
msg = parent.tr('Cannot open file: %s' % err)
|
msg = parent.tr('Cannot open file: %s' % err)
|
||||||
|
|
||||||
if doc.tag != 'qgsCSWConnections':
|
|
||||||
error = 1
|
|
||||||
msg = parent.tr('Invalid CSW connections XML.')
|
|
||||||
|
|
||||||
if error == 1:
|
if error == 1:
|
||||||
QMessageBox.information(parent, parent.tr('Loading Connections'), msg)
|
QMessageBox.information(parent, parent.tr('Loading Connections'), msg)
|
||||||
return
|
return
|
||||||
|
Loading…
x
Reference in New Issue
Block a user