change python scripts so modules which register with blender have a register() functi...
[blender.git] / release / scripts / ui / space_text.py
index 64bcd67f59fbdff54fb3e5a0b857f367fa45a162..cbc7ce9244b688ad281b41146779aa2767f47c1c 100644 (file)
@@ -12,7 +12,7 @@
 #
 #  You should have received a copy of the GNU General Public License
 #  along with this program; if not, write to the Free Software Foundation,
-#  Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+#  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 #
 # ##### END GPL LICENSE BLOCK #####
 
@@ -273,14 +273,27 @@ class TEXT_MT_edit(bpy.types.Menu):
 
         layout.menu("TEXT_MT_edit_to3d")
 
-bpy.types.register(TEXT_HT_header)
-bpy.types.register(TEXT_PT_properties)
-bpy.types.register(TEXT_PT_find)
-bpy.types.register(TEXT_MT_text)
-bpy.types.register(TEXT_MT_templates)
-bpy.types.register(TEXT_MT_format)
-bpy.types.register(TEXT_MT_edit)
-bpy.types.register(TEXT_MT_edit_view)
-bpy.types.register(TEXT_MT_edit_select)
-bpy.types.register(TEXT_MT_edit_markers)
-bpy.types.register(TEXT_MT_edit_to3d)
+
+classes = [
+    TEXT_HT_header,
+    TEXT_PT_properties,
+    TEXT_PT_find,
+    TEXT_MT_text,
+    TEXT_MT_templates,
+    TEXT_MT_format,
+    TEXT_MT_edit,
+    TEXT_MT_edit_view,
+    TEXT_MT_edit_select,
+    TEXT_MT_edit_markers,
+    TEXT_MT_edit_to3d]
+
+
+def register():
+    register = bpy.types.register
+    for cls in classes:
+        register(cls)
+
+def unregister():
+    unregister = bpy.types.unregister
+    for cls in classes:
+        unregister(cls)