Return-Path: Delivered-To: apmail-gump-commits-archive@www.apache.org Received: (qmail 59053 invoked from network); 16 Jun 2005 18:52:20 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 16 Jun 2005 18:52:20 -0000 Received: (qmail 5329 invoked by uid 500); 16 Jun 2005 18:52:19 -0000 Mailing-List: contact commits-help@gump.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: general@gump.apache.org Delivered-To: mailing list commits@gump.apache.org Received: (qmail 5313 invoked by uid 99); 16 Jun 2005 18:52:19 -0000 X-ASF-Spam-Status: No, hits=0.2 required=10.0 tests=NO_REAL_NAME X-Spam-Check-By: apache.org Received: from minotaur.apache.org (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.28) with SMTP; Thu, 16 Jun 2005 11:52:16 -0700 Received: (qmail 58938 invoked by uid 65534); 16 Jun 2005 18:52:05 -0000 Message-ID: <20050616185205.58936.qmail@minotaur.apache.org> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Subject: svn commit: r190980 - /gump/branches/Gump3/pygump/python/gump/engine/loader.py Date: Thu, 16 Jun 2005 18:52:04 -0000 To: commits@gump.apache.org From: leosimons@apache.org X-Mailer: svnmailer-1.0.0-dev X-Virus-Checked: Checked X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Author: leosimons Date: Thu Jun 16 11:52:03 2005 New Revision: 190980 URL: http://svn.apache.org/viewcvs?rev=3D190980&view=3Drev 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/e= ngine/loader.py?rev=3D190980&r1=3D190979&r2=3D190980&view=3Ddiff =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- gump/branches/Gump3/pygump/python/gump/engine/loader.py (original) +++ gump/branches/Gump3/pygump/python/gump/engine/loader.py Thu Jun 16 11:5= 2:03 2005 @@ -83,26 +83,26 @@ =20 try: stream =3D download_func(href) + + new_dom =3D minidom.parse(stream) + new_dom.normalize() + stream.close() # close file immediately, we're done! + new_root =3D new_dom.documentElement + =20 + # we succeeded loading the new document, get rid of the href, save= it + # as "resolved" + node.removeAttribute('href') + node.setAttribute('resolved-from-href', href) + =20 + _import_node(node, new_root) + =20 + # 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... =20 - new_dom =3D minidom.parse(stream) - new_dom.normalize() - stream.close() # close file immediately, we're done! - new_root =3D new_dom.documentElement - =20 - # we succeeded loading the new document, get rid of the href, save it - # as "resolved" - node.removeAttribute('href') - node.setAttribute('resolved-from-href', href) - =20 - _import_node(node, new_root) - =20 - # we're done with the file now, allow GC - new_root.unlink() =20 ### ### Classes