Revision: 27562 http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=27562 Author: campbellbarton Date: 2010-03-16 20:36:10 +0100 (Tue, 16 Mar 2010)
Log Message: ----------- simplify version checking by having addons use same version tuple as bpy.app.version Modified Paths: -------------- branches/render25/release/scripts/ui/space_userpref.py Modified: branches/render25/release/scripts/ui/space_userpref.py =================================================================== --- branches/render25/release/scripts/ui/space_userpref.py 2010-03-16 18:34:30 UTC (rev 27561) +++ branches/render25/release/scripts/ui/space_userpref.py 2010-03-16 19:36:10 UTC (rev 27562) @@ -1537,22 +1537,9 @@ # check if add-on is written for current blender version, or raise a warning info = addon_info_get(mod) - if info["blender"]: - version = info["blender"].split(".", 2) - for i in range(len(version)): - try: - version[i] = int(version[i]) - except: - break + if info.get("blender", (0, 0, 0)) > bpy.app.version: + self.report("WARNING','This script was written for a newer version of Blender and might not function (correctly).\nThe script is enabled though.") - if version[i] > bpy.app.version[i]: - self.report("WARNING','This script was written for a newer version of Blender \ -and might not function (correctly).\nThe script is enabled though.") - elif version[i] == bpy.app.version[i]: - continue - else: - break - return {'FINISHED'} @@ -1668,7 +1655,6 @@ info = addon_info_get(mod) info["expanded"] = not info["expanded"] - print(info["expanded"]) return {'FINISHED'} _______________________________________________ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs