xml_tree_widget.py 文件源码

python
阅读 18 收藏 0 点赞 0 评论 0

项目:gml_application_schema_toolbox 作者: BRGM 项目源码 文件源码
def onResolveEmbedded(self):
        item = self.currentItem()
        QApplication.setOverrideCursor(Qt.WaitCursor)
        uri = item.data(1, Qt.UserRole)
        try:
            f = remote_open_from_qgis(uri)
            try:
                doc, ns_map = xml_parse(f)
            except ET.ParseError:
                # probably not an XML
                QApplication.restoreOverrideCursor()
                QMessageBox.warning(self, "XML parsing error", "The external resource is not a well formed XML")
                return

            ns_imap = {}
            for k, v in ns_map.items():
                ns_imap[v] = k
            fill_tree_with_element(self, item.parent(), doc.getroot(), ns_imap, get_custom_viewers(), ns_map)
        except RuntimeError as e:
            QApplication.restoreOverrideCursor()
            QMessageBox.warning(self, "Network error", e.args[0])
            return
        finally:
            QApplication.restoreOverrideCursor()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号