[dia] Bug 649450 - Warning message instead of python backtrace



commit ef1e4dac749648ef6a3f1712ac6a9aa756c04c3a
Author: Hans Breuer <hans breuer org>
Date:   Sun Jun 5 20:54:07 2011 +0200

    Bug 649450 - Warning message instead of python backtrace
    
    The SVG importer is limited, e.g. when parsing path data.
    It stayed this way but now produces a more understandable
    error message.

 plug-ins/python/diasvg_import.py |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/plug-ins/python/diasvg_import.py b/plug-ins/python/diasvg_import.py
index 3fdccef..3aafa96 100644
--- a/plug-ins/python/diasvg_import.py
+++ b/plug-ins/python/diasvg_import.py
@@ -664,7 +664,11 @@ class Importer :
 	def Render(self,data) :
 		layer = data.active_layer
 		for o in self.objects :
-			od = o.Create()
+			try :
+				od = o.Create()
+			except TypeError, e :
+				od = None
+				dia.message(1, "SVG import limited, consider another importer.\n(Error: " + str(e) + ")")
 			if od :
 				if o.translation :
 					pos = od.properties["obj_pos"].value



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]