Merged wxPython 2.4.x to the 2.5 branch (Finally!!!)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@19793 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -27,9 +27,9 @@ class TestPanel(wxPanel):
|
||||
self.inp = wxTextCtrl(self, -1, '', style=wxTE_PROCESS_ENTER)
|
||||
self.sndBtn = wxButton(self, -1, 'Send')
|
||||
self.termBtn = wxButton(self, -1, 'Close Stream')
|
||||
self.inp.Enable(false)
|
||||
self.sndBtn.Enable(false)
|
||||
self.termBtn.Enable(false)
|
||||
self.inp.Enable(False)
|
||||
self.sndBtn.Enable(False)
|
||||
self.termBtn.Enable(False)
|
||||
|
||||
# Hook up the events
|
||||
EVT_BUTTON(self, self.exBtn.GetId(), self.OnExecuteBtn)
|
||||
@@ -55,7 +55,7 @@ class TestPanel(wxPanel):
|
||||
sizer.Add(box2, 0, wxEXPAND|wxALL, 10)
|
||||
|
||||
self.SetSizer(sizer)
|
||||
self.SetAutoLayout(true)
|
||||
self.SetAutoLayout(True)
|
||||
|
||||
|
||||
def __del__(self):
|
||||
@@ -70,14 +70,14 @@ class TestPanel(wxPanel):
|
||||
|
||||
self.process = wxProcess(self)
|
||||
self.process.Redirect();
|
||||
pid = wxExecute(cmd, false, self.process)
|
||||
pid = wxExecute(cmd, wxEXEC_ASYNC, self.process)
|
||||
self.log.write('OnExecuteBtn: "%s" pid: %s\n' % (cmd, pid))
|
||||
|
||||
self.inp.Enable(true)
|
||||
self.sndBtn.Enable(true)
|
||||
self.termBtn.Enable(true)
|
||||
self.cmd.Enable(false)
|
||||
self.exBtn.Enable(false)
|
||||
self.inp.Enable(True)
|
||||
self.sndBtn.Enable(True)
|
||||
self.termBtn.Enable(True)
|
||||
self.cmd.Enable(False)
|
||||
self.exBtn.Enable(False)
|
||||
self.inp.SetFocus()
|
||||
|
||||
|
||||
@@ -99,11 +99,7 @@ class TestPanel(wxPanel):
|
||||
if self.process is not None:
|
||||
stream = self.process.GetInputStream()
|
||||
|
||||
# Yes, this is weird. For this particular stream, EOF
|
||||
# simply means that there is no data available to be read,
|
||||
# not truly the end of file. Also, read() just reads all
|
||||
# the currently available data, not until the real EOF...
|
||||
if not stream.eof():
|
||||
if stream.CanRead():
|
||||
text = stream.read()
|
||||
self.out.AppendText(text)
|
||||
|
||||
@@ -113,17 +109,17 @@ class TestPanel(wxPanel):
|
||||
(evt.GetPid(), evt.GetExitCode()))
|
||||
|
||||
stream = self.process.GetInputStream()
|
||||
if not stream.eof():
|
||||
if stream.CanRead():
|
||||
text = stream.read()
|
||||
self.out.AppendText(text)
|
||||
|
||||
self.process.Destroy()
|
||||
self.process = None
|
||||
self.inp.Enable(false)
|
||||
self.sndBtn.Enable(false)
|
||||
self.termBtn.Enable(false)
|
||||
self.cmd.Enable(true)
|
||||
self.exBtn.Enable(true)
|
||||
self.inp.Enable(False)
|
||||
self.sndBtn.Enable(False)
|
||||
self.termBtn.Enable(False)
|
||||
self.cmd.Enable(True)
|
||||
self.exBtn.Enable(True)
|
||||
|
||||
|
||||
#----------------------------------------------------------------------
|
||||
|
Reference in New Issue
Block a user