diff pyink/tween.py @ 1227:983442b2698c

Fix the exception for object without opacity.
author wycc
date Fri, 07 Jan 2011 15:58:45 +0800
parents a05c8deb6523
children 447cd3359cf2
line wrap: on
line diff
--- a/pyink/tween.py	Thu Jan 06 22:06:42 2011 +0800
+++ b/pyink/tween.py	Fri Jan 07 15:58:45 2011 +0800
@@ -12,8 +12,12 @@
 	    return float(f[1])
     return 1
 
-def change_opacity(obj,opacity):
-    style = obj.getAttribute("style")
+def change_opacity(obj, opacity):
+    try:
+        style = obj.getAttribute("style")
+    except:
+        obj.setAttribute("style","opacity:%g" % opacity)
+	return
     arr = style.split(';')
     s=''
     for a in arr: