Skip to content

Commit

Permalink
Merge pull request #286 from hildogjr/master
Browse files Browse the repository at this point in the history
Fix #144, missing #143
  • Loading branch information
hildogjr committed Jun 30, 2018
2 parents 4a06233 + c7dcaf1 commit a10c92d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 13 deletions.
1 change: 1 addition & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ ______________________

* Fixed some Python 2 incompatibility of the GUI and Altium module.
* Fixed the tqdm print channel. Now the process bar is kept at the end.
* Fixed the output messages when used the GUI.
* Fixed GUI problem caused by distributors re-factore and other UI improvements.
* More improvements on scrape classes.
* Now TME ajax post scrape method repect the `fake_browser`.
Expand Down
19 changes: 6 additions & 13 deletions kicost/kicost_gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -1052,27 +1052,20 @@ def __init__(self, aWxTextCtrl):
#super(self.__class__, self).__init__()
self.area = aWxTextCtrl
def write(self, msg):
try:
self.area.AppendText(msg)
sys.__stdout__.flush()
except:
# In case of freeze GUI, print on terminal to allow debug.
sys.__stdout__.write(msg)
#finally:
# self.flush()
#def flush(self):
# sys.__stdout__.flush
#self.area.AppendText(msg)
# Necessary the call bellow and not above
# because of the KiCost threads.
wx.CallAfter(self.area.AppendText, msg)

# Redirect the logger to the GUI area.
#sys.stdout = GUILoggerHandler(frame.m_textCtrl_messages)
sys.stdout = GUILoggerHandler(frame.m_textCtrl_messages)
#sys.stderr = GUILoggerHandler(frame.m_textCtrl_messages)
#TODO when the above works, change all print and `m_textCtrl_messages.Append` on GUI to logging.

frame.Show()
app.MainLoop()

# Restore the channel print output to terminal.
# Necessary if KiCost was called by other software? Normal execution ends here.
# Necessary if KiCost was called by other software?
sys.stdout = sys.__stdout__
sys.stdout = sys.__stderr__

Expand Down

0 comments on commit a10c92d

Please sign in to comment.