[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [26903] trunk/blender/release/scripts/ui/ space_info.py: File > Open recent raised an error when there was no . Blog file.

Thomas Dinges dingto at gmx.de
Mon Feb 15 02:42:51 CET 2010


Revision: 26903
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=26903
Author:   dingto
Date:     2010-02-15 02:42:51 +0100 (Mon, 15 Feb 2010)

Log Message:
-----------
File > Open recent raised an error when there was no .Blog file. Now it prints an info. 

Modified Paths:
--------------
    trunk/blender/release/scripts/ui/space_info.py

Modified: trunk/blender/release/scripts/ui/space_info.py
===================================================================
--- trunk/blender/release/scripts/ui/space_info.py	2010-02-15 01:28:15 UTC (rev 26902)
+++ trunk/blender/release/scripts/ui/space_info.py	2010-02-15 01:42:51 UTC (rev 26903)
@@ -123,11 +123,14 @@
         import os
         layout = self.layout
         layout.operator_context = 'EXEC_AREA'
-        file = open(os.path.join(bpy.app.home, ".Blog"), "rU")
-        for line in file:
-            line = line.rstrip()
-            layout.operator("wm.open_mainfile", text=line, icon='FILE_BLEND').path = line
-        file.close()
+        try:
+            file = open(os.path.join(bpy.app.home, ".Blog"), "rU")
+            for line in file:
+                line = line.rstrip()
+                layout.operator("wm.open_mainfile", text=line, icon='FILE_BLEND').path = line
+            file.close()
+        except:
+            layout.label(text='No recent files')
 
 
 class INFO_MT_file_import(bpy.types.Menu):





More information about the Bf-blender-cvs mailing list