Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #144, missing #143 #286

Merged
merged 3 commits into from
Jun 30, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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