[pywin32-checkins] pywin32/Pythonwin win32uimodule.cpp,1.42,1.43
OLD project page for the Python extensions for Windows
Brought to you by:
mhammond
From: Mark H. <mha...@us...> - 2008-12-06 00:38:36
|
Update of /cvsroot/pywin32/pywin32/Pythonwin In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv21349/Pythonwin Modified Files: win32uimodule.cpp Log Message: New win32ui.DisplayTraceback function to dislpay a traceback in a dialog. Useful for errors that happen before pythonwin has set things up such that 'print' will work (its worse on py3k - sys.stdout is None, so attempts to print *always* fail, and not with an IOError like 2.x) Index: win32uimodule.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/win32uimodule.cpp,v retrieving revision 1.42 retrieving revision 1.43 diff -C2 -d -r1.42 -r1.43 *** win32uimodule.cpp 3 Dec 2008 22:34:20 -0000 1.42 --- win32uimodule.cpp 6 Dec 2008 00:38:29 -0000 1.43 *************** *** 805,808 **** --- 805,824 ---- } + // @pymethod |win32ui|DisplayTraceback|Displays a traceback in a dialog box. + static PyObject * + ui_python_display_traceback( PyObject *self, PyObject *args ) + { + PyObject *obTitle = Py_None; + PyObject *t, *v, *tb; + if (!PyArg_ParseTuple(args, "(OOO)|O:DisplayTraceback", &t, &v, &tb, &obTitle)) + return NULL; + TCHAR *title; + if (!PyWinObject_AsTCHAR(obTitle, &title, TRUE)) + return NULL; + DisplayPythonTraceback(t, v, tb, title); + PyWinObject_FreeTCHAR(title); + RETURN_NONE; + } + // @pymethod |win32ui|OutputDebugString|Sends a string to the Windows debugging device. static PyObject * *************** *** 1915,1918 **** --- 1931,1935 ---- {"DestroyDebuggerThread", ui_destroy_debugger_thread, 1}, // @pymeth DestroyDebuggerThread|Cleans up the debugger thread. {"DoWaitCursor", ui_do_wait_cursor, 1}, // @pymeth DoWaitCursor|Changes the cursor to/from a wait cursor. + {"DisplayTraceback", ui_python_display_traceback, 1}, // @pymeth DisplayTraceback|Displays a traceback in a dialog box. {"Enable3dControls", ui_enable_3d_controls, 1 }, // @pymeth Enable3dControls|Enables 3d controls for the application. {"FindWindow", PyCWnd::FindWindow, 1}, // @pymeth FindWindow|Searches for the specified top-level window |