You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@gump.apache.org by le...@apache.org on 2005/06/16 20:52:04 UTC
svn commit: r190980 -
/gump/branches/Gump3/pygump/python/gump/engine/loader.py
Author: leosimons
Date: Thu Jun 16 11:52:03 2005
New Revision: 190980
URL: http://svn.apache.org/viewcvs?rev=190980&view=rev
Log:
Fix for GUMP-136.
* pygump/python/gump/engine/loader.py: while importing other xml documents, be a little more robust by logging errors during every stage of the import process (without exiting) instead of just during the download.
Modified:
gump/branches/Gump3/pygump/python/gump/engine/loader.py
Modified: gump/branches/Gump3/pygump/python/gump/engine/loader.py
URL: http://svn.apache.org/viewcvs/gump/branches/Gump3/pygump/python/gump/engine/loader.py?rev=190980&r1=190979&r2=190980&view=diff
==============================================================================
--- gump/branches/Gump3/pygump/python/gump/engine/loader.py (original)
+++ gump/branches/Gump3/pygump/python/gump/engine/loader.py Thu Jun 16 11:52:03 2005
@@ -83,26 +83,26 @@
try:
stream = download_func(href)
+
+ new_dom = minidom.parse(stream)
+ new_dom.normalize()
+ stream.close() # close file immediately, we're done!
+ new_root = new_dom.documentElement
+
+ # we succeeded loading the new document, get rid of the href, save it
+ # as "resolved"
+ node.removeAttribute('href')
+ node.setAttribute('resolved-from-href', href)
+
+ _import_node(node, new_root)
+
+ # we're done with the file now, allow GC
+ new_root.unlink()
except Exception, details:
# swallow this in interest of log readability
#_drop_module_or_project(node, dropped_nodes)
error_func(href, node, dropped_nodes)
- return # make sure to stop processing...
- new_dom = minidom.parse(stream)
- new_dom.normalize()
- stream.close() # close file immediately, we're done!
- new_root = new_dom.documentElement
-
- # we succeeded loading the new document, get rid of the href, save it
- # as "resolved"
- node.removeAttribute('href')
- node.setAttribute('resolved-from-href', href)
-
- _import_node(node, new_root)
-
- # we're done with the file now, allow GC
- new_root.unlink()
###
### Classes