mirror of
https://github.com/qgis/QGIS.git
synced 2025-10-08 00:05:09 -04:00
[MetaSearch]: fix default connections testing, write out connection XML to file instead
This commit is contained in:
parent
5ab9103acf
commit
fb138b59bb
@ -186,6 +186,7 @@ def test_default_csw_connections():
|
|||||||
try:
|
try:
|
||||||
csw = CatalogueServiceWeb(conn.attrib.get('url'))
|
csw = CatalogueServiceWeb(conn.attrib.get('url'))
|
||||||
info('Success: %s', csw.identification.title)
|
info('Success: %s', csw.identification.title)
|
||||||
|
csw.getrecords2()
|
||||||
except Exception, err:
|
except Exception, err:
|
||||||
raise ValueError('ERROR: %s', err)
|
raise ValueError('ERROR: %s', err)
|
||||||
|
|
||||||
@ -214,12 +215,11 @@ def generate_csw_connections_file():
|
|||||||
csw = CatalogueServiceWeb(url)
|
csw = CatalogueServiceWeb(url)
|
||||||
title = unicode(csw.identification.title)
|
title = unicode(csw.identification.title)
|
||||||
conn = etree.SubElement(conns, 'csw', name=title, url=url)
|
conn = etree.SubElement(conns, 'csw', name=title, url=url)
|
||||||
#conn.attrib['name'] = title
|
|
||||||
#conn.attrib['url'] = url
|
|
||||||
except Exception, err:
|
except Exception, err:
|
||||||
error('ERROR on CSW %s: %s', url, err)
|
error('ERROR on CSW %s: %s', url, err)
|
||||||
|
|
||||||
info(etree.tostring(conns, encoding='utf-8'))
|
with open('%s.xml' % filename, 'w') as connsxmlfh:
|
||||||
|
connsxmlfh.write(etree.tostring(conns, encoding='utf-8'))
|
||||||
|
|
||||||
|
|
||||||
def get_package_filename():
|
def get_package_filename():
|
||||||
|
Loading…
x
Reference in New Issue
Block a user