Skip to content

Commit 03e6a9a

Browse files
authored
Merge pull request #2 from layus/clear-panel
Clear panels on restart
2 parents 9d34c32 + cc7fca6 commit 03e6a9a

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

socket_pipe.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,15 @@ def __init__(self):
3636
self.sock.settimeout(1)
3737
self.running = True
3838

39+
self.clear_panel('oz_compiler')
40+
self.clear_panel('oz_output')
41+
42+
43+
def clear_panel(self, panel_name):
44+
panel = self.window.find_output_panel(panel_name)
45+
if panel:
46+
self.window.destroy_output_panel(panel_name)
47+
3948
def write_compiler(self, s):
4049
self.write_panel(s, "oz_compiler")
4150

@@ -92,9 +101,6 @@ def run(self):
92101
self.sock.shutdown(socket.SHUT_RDWR)
93102
self.sock.close()
94103
self.process.wait()
95-
panel = self.window.find_output_panel("oz_panel")
96-
if panel is not None:
97-
self.window.destroy_output_panel("oz_panel")
98104

99105
def stop(self):
100106
exit_msg = "{Application.exit 0}\n\004\n\n"

0 commit comments

Comments
 (0)