commit-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Commit-gnuradio] [gnuradio] 28/43: grc: don't try to open missing files


From: git
Subject: [Commit-gnuradio] [gnuradio] 28/43: grc: don't try to open missing files
Date: Thu, 2 Apr 2015 19:15:51 +0000 (UTC)

This is an automated email from the git hooks/post-receive script.

jcorgan pushed a commit to branch master
in repository gnuradio.

commit ffb28308cefc7cf588da745508670122319c690f
Author: Sebastian Koslowski <address@hidden>
Date:   Thu Apr 2 09:42:17 2015 +0200

    grc: don't try to open missing files
---
 grc/gui/ActionHandler.py |  2 +-
 grc/gui/Preferences.py   | 10 ++++++----
 2 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/grc/gui/ActionHandler.py b/grc/gui/ActionHandler.py
index 6c56a94..55be5d0 100644
--- a/grc/gui/ActionHandler.py
+++ b/grc/gui/ActionHandler.py
@@ -129,7 +129,7 @@ class ActionHandler:
                 Actions.XML_PARSER_ERRORS_DISPLAY.set_sensitive(True)
 
             if not self.init_file_paths:
-                self.init_file_paths = Preferences.files_open()
+                self.init_file_paths = filter(os.path.exists, 
Preferences.files_open())
             if not self.init_file_paths: self.init_file_paths = ['']
             for file_path in self.init_file_paths:
                 if file_path: self.main_window.new_page(file_path) #load pages 
from file paths
diff --git a/grc/gui/Preferences.py b/grc/gui/Preferences.py
index 1d6675d..e7b0551 100644
--- a/grc/gui/Preferences.py
+++ b/grc/gui/Preferences.py
@@ -68,9 +68,11 @@ def files_open(files=None):
         files = list()
         i = 0
         while True:
-            try: files.append(_config_parser.get('files_open', 
'file_open_%d'%i))
-            except: return files
-            i = i + 1
+            try:
+                files.append(_config_parser.get('files_open', 
'file_open_%d'%i))
+            except:
+                return files
+            i += 1
 
 def reports_window_position(pos=None):
     if pos is not None: _config_parser.set('main', 'reports_window_position', 
pos)
@@ -91,4 +93,4 @@ def bool_entry(key, active=None, default=True):
         try:
             return _config_parser.getboolean('main', key)
         except:
-            return default
\ No newline at end of file
+            return default



reply via email to

[Prev in Thread] Current Thread [Next in Thread]