X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/9c7e3e86fb82829dcdda499e3ec1a5acffebdee9..2a783b2daaae6f06928e7095ebbc4fc039583907:/wxPython/src/_process.i diff --git a/wxPython/src/_process.i b/wxPython/src/_process.i index 5474130544..198b288e5c 100644 --- a/wxPython/src/_process.i +++ b/wxPython/src/_process.i @@ -78,7 +78,8 @@ IMP_PYCALLBACK_VOID_INTINT( wxPyProcess, wxProcess, OnTerminate); %} -%name(Process)class wxPyProcess : public wxEvtHandler { +%rename(Process) wxPyProcess; +class wxPyProcess : public wxEvtHandler { public: // kill the process with the given PID static wxKillError Kill(int pid, @@ -100,11 +101,20 @@ public: %pythonAppend wxPyProcess "self._setCallbackInfo(self, Process)" wxPyProcess(wxEvtHandler *parent = NULL, int id = -1); + ~wxPyProcess(); + + + DocDeclStr( + long , GetPid() const, + "get the process ID of the process executed by Open()", ""); + - void _setCallbackInfo(PyObject* self, PyObject* _class); - void base_OnTerminate(int pid, int status); + void _setCallbackInfo(PyObject* self, PyObject* _class); + void OnTerminate(int pid, int status); + %MAKE_BASE_FUNC(Process, OnTerminate); + // call Redirect before passing the object to wxExecute() to redirect the // launched process stdin/stdout, then use GetInputStream() and // GetOutputStream() to get access to them @@ -128,6 +138,14 @@ public: // return True if any input is available on the child process stdout/err bool IsInputAvailable() const; bool IsErrorAvailable() const; + + %property(ErrorStream, GetErrorStream, doc="See `GetErrorStream`"); + %property(InputStream, GetInputStream, doc="See `GetInputStream`"); + %property(OutputStream, GetOutputStream, doc="See `GetOutputStream`"); + + %property(InputOpened, IsInputOpened); + %property(InputAvailable, IsInputAvailable); + %property(ErrorAvailable, IsErrorAvailable); }; //--------------------------------------------------------------------------- @@ -139,6 +157,9 @@ public: int GetPid(); int GetExitCode(); int m_pid, m_exitcode; + + %property(ExitCode, GetExitCode, doc="See `GetExitCode`"); + %property(Pid, GetPid, doc="See `GetPid`"); }; @@ -186,7 +207,11 @@ long wxExecute(const wxString& command, { PyObject* o; o = PyInt_FromLong((long) (*$1)); +#if SWIG_VERSION < 0x010328 $result = t_output_helper($result, o); +#else + $result = SWIG_Python_AppendOutput($result, o); +#endif } int wxKill(long pid, wxSignal sig = wxSIGTERM, wxKillError* rc, int flags = wxKILL_NOCHILDREN);