Skip to content

Commit

Permalink
Raise window after file load error (can disappear on windows)
Browse files Browse the repository at this point in the history
  • Loading branch information
Robert Pröpper committed Jun 23, 2013
1 parent dc1783c commit 3069860
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ build
dist
spykeviewer.egg-info
bin/freeze/build
bin/freeze/dist
bin/freeze/dist
.idea
4 changes: 4 additions & 0 deletions spykeviewer/ui/main_window.py
Original file line number Diff line number Diff line change
Expand Up @@ -511,6 +511,10 @@ def run_command(self, cmd, history=True, new_prompt=True):
# Duplicate stdout and stderr for console
# Not using previous stdout, only stderr. Using StreamDuplicator
# because spyder stream does not have flush() method...
ch = logging.StreamHandler()
ch.setLevel(logging.WARNING)
logger.addHandler(ch)

sys.stdout = StreamDuplicator([sys.stdout])
sys.stderr = StreamDuplicator([sys.stderr, sys.__stderr__])

Expand Down
3 changes: 2 additions & 1 deletion spykeviewer/ui/main_window_neo.py
Original file line number Diff line number Diff line change
Expand Up @@ -292,10 +292,11 @@ def load_file_callback(self):
# Load worker thread finished
blocks = self.load_worker.blocks
if blocks is None:
logger.error('Could not read file "%s"' %
logger.error('Could not read "%s"' %
self.load_worker.paths[0])
self.progress.done()
self.load_progress.reset()
self.raise_()
return

for block in blocks:
Expand Down

0 comments on commit 3069860

Please sign in to comment.