[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [51418] trunk/blender/release/scripts/ startup/bl_operators/wm.py: [#32921] Fix: Python error triggered when installing an addon via 'install addon' button

Gaia Clary gaia.clary at machinimatrix.org
Fri Oct 19 10:51:32 CEST 2012


Revision: 51418
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=51418
Author:   gaiaclary
Date:     2012-10-19 08:51:31 +0000 (Fri, 19 Oct 2012)
Log Message:
-----------
[#32921] Fix: Python error triggered when installing an addon via 'install addon' button

Modified Paths:
--------------
    trunk/blender/release/scripts/startup/bl_operators/wm.py

Modified: trunk/blender/release/scripts/startup/bl_operators/wm.py
===================================================================
--- trunk/blender/release/scripts/startup/bl_operators/wm.py	2012-10-19 08:49:49 UTC (rev 51417)
+++ trunk/blender/release/scripts/startup/bl_operators/wm.py	2012-10-19 08:51:31 UTC (rev 51418)
@@ -1755,6 +1755,7 @@
 
         #check to see if the file is in compressed format (.zip)
         if zipfile.is_zipfile(pyfile):
+            is_archive = True
             try:
                 file_to_extract = zipfile.ZipFile(pyfile, 'r')
             except:
@@ -1784,6 +1785,7 @@
                 return {'CANCELLED'}
 
         else:
+            is_archive = False
             path_dest = os.path.join(path_addons, os.path.basename(pyfile))
 
             if self.overwrite:
@@ -1823,9 +1825,19 @@
         bpy.utils.refresh_script_paths()
 
         # print message
-        msg = "File %r installed into %r\n" % (pyfile, path_dest)
+        msg = "Modules Installed from %r:" % (pyfile)
+        print(msg)
         self.report({'INFO'}, msg)
-        print(msg)
+        for mod in addon_utils.modules(addon_utils.addons_fake_modules):
+            if mod.__name__ in addons_new:
+                info = addon_utils.module_bl_info(mod)
+                if is_archive:
+                    module_path = os.path.dirname(os.path.abspath(mod.__file__))
+                else:
+                    module_path = os.path.abspath(mod.__file__)
+                msg = "\"%s\" installed in %r" % (info["name"],module_path)
+                self.report({'INFO'}, msg)
+                print(msg)
 
         return {'FINISHED'}
 




More information about the Bf-blender-cvs mailing list