pywin32-checkins Mailing List for Python for Windows Extensions (Page 122)
OLD project page for the Python extensions for Windows
Brought to you by:
mhammond
You can subscribe to this list here.
2003 |
Jan
|
Feb
|
Mar
|
Apr
(2) |
May
(1) |
Jun
(6) |
Jul
(50) |
Aug
(11) |
Sep
(24) |
Oct
(184) |
Nov
(118) |
Dec
(22) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
(31) |
Feb
(25) |
Mar
(34) |
Apr
(105) |
May
(49) |
Jun
(38) |
Jul
(39) |
Aug
(7) |
Sep
(98) |
Oct
(79) |
Nov
(20) |
Dec
(17) |
2005 |
Jan
(66) |
Feb
(32) |
Mar
(43) |
Apr
(30) |
May
(58) |
Jun
(30) |
Jul
(16) |
Aug
(4) |
Sep
(21) |
Oct
(42) |
Nov
(11) |
Dec
(14) |
2006 |
Jan
(42) |
Feb
(30) |
Mar
(22) |
Apr
(1) |
May
(9) |
Jun
(15) |
Jul
(20) |
Aug
(9) |
Sep
(8) |
Oct
(1) |
Nov
(9) |
Dec
(43) |
2007 |
Jan
(52) |
Feb
(45) |
Mar
(20) |
Apr
(12) |
May
(59) |
Jun
(39) |
Jul
(35) |
Aug
(31) |
Sep
(17) |
Oct
(20) |
Nov
(4) |
Dec
(4) |
2008 |
Jan
(28) |
Feb
(111) |
Mar
(4) |
Apr
(27) |
May
(40) |
Jun
(27) |
Jul
(32) |
Aug
(94) |
Sep
(87) |
Oct
(153) |
Nov
(336) |
Dec
(331) |
2009 |
Jan
(298) |
Feb
(127) |
Mar
(20) |
Apr
(8) |
May
|
Jun
(10) |
Jul
(6) |
Aug
|
Sep
(2) |
Oct
(2) |
Nov
|
Dec
(1) |
2010 |
Jan
(7) |
Feb
(1) |
Mar
|
Apr
|
May
(15) |
Jun
(4) |
Jul
(3) |
Aug
(28) |
Sep
(1) |
Oct
(19) |
Nov
(16) |
Dec
(6) |
2011 |
Jan
(2) |
Feb
(18) |
Mar
(17) |
Apr
(12) |
May
(5) |
Jun
(11) |
Jul
(7) |
Aug
(2) |
Sep
(2) |
Oct
(4) |
Nov
(4) |
Dec
|
2012 |
Jan
(6) |
Feb
(2) |
Mar
|
Apr
(8) |
May
(4) |
Jun
(3) |
Jul
(13) |
Aug
(27) |
Sep
(8) |
Oct
(9) |
Nov
(3) |
Dec
(2) |
2013 |
Jan
|
Feb
(1) |
Mar
(5) |
Apr
(10) |
May
|
Jun
(2) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
(9) |
2014 |
Jan
(2) |
Feb
(4) |
Mar
(4) |
Apr
(1) |
May
(4) |
Jun
(2) |
Jul
|
Aug
|
Sep
|
Oct
(2) |
Nov
|
Dec
(1) |
2015 |
Jan
(1) |
Feb
|
Mar
|
Apr
(6) |
May
(2) |
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
2016 |
Jan
(3) |
Feb
(2) |
Mar
|
Apr
(3) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2017 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
|
From: Lars I. <lar...@us...> - 2004-11-30 20:57:38
|
Update of /cvsroot/pywin32/pywin32/com/win32comext/directsound In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32722/directsound Log Message: Directory /cvsroot/pywin32/pywin32/com/win32comext/directsound added to the repository |
From: Mark H. <mha...@us...> - 2004-11-08 02:59:21
|
Update of /cvsroot/pywin32/pywin32/AutoDuck In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4318 Modified Files: pywin32.mak Log Message: Add _winxptheme Index: pywin32.mak =================================================================== RCS file: /cvsroot/pywin32/pywin32/AutoDuck/pywin32.mak,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** pywin32.mak 6 Oct 2004 06:09:12 -0000 1.8 --- pywin32.mak 8 Nov 2004 02:59:06 -0000 1.9 *************** *** 43,47 **** $(GENDIR)/win32service.d $(GENDIR)/win32pipe.d $(GENDIR)/win32security.d \ $(GENDIR)/win32process.d $(GENDIR)/wincerapi.d $(GENDIR)/win32gui.d \ ! $(GENDIR)/win32inet.d \ winxpgui.d --- 43,47 ---- $(GENDIR)/win32service.d $(GENDIR)/win32pipe.d $(GENDIR)/win32security.d \ $(GENDIR)/win32process.d $(GENDIR)/wincerapi.d $(GENDIR)/win32gui.d \ ! $(GENDIR)/win32inet.d $(GENDIR)/_winxptheme.d \ winxpgui.d *************** *** 149,152 **** --- 149,155 ---- $(PYTHON) makedfromi.py -o$*.d $(WIN32_SOURCE_DIR)/$(*B).i + $(GENDIR)/_winxptheme.d: $(WIN32_SOURCE_DIR)/$(*B).i + $(PYTHON) makedfromi.py -o$*.d $(WIN32_SOURCE_DIR)/$(*B).i + ## ## win32com generated |
From: Mark H. <mha...@us...> - 2004-11-08 02:58:44
|
Update of /cvsroot/pywin32/pywin32/AutoDuck In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4186 Modified Files: makedfromi.py Log Message: Handle leading whitespace in the .i comments better. Index: makedfromi.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/AutoDuck/makedfromi.py,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** makedfromi.py 7 Sep 2004 03:02:56 -0000 1.5 --- makedfromi.py 8 Nov 2004 02:58:35 -0000 1.6 *************** *** 51,73 **** modDoc, lineNo = GetComments(line, lineNo, lines) lineNo += 1 - elif line[:10]=="// @pyswig": - doc, lineNo = GetComments(line, lineNo, lines) - curMethod = doc[8:], [] - methods.append(curMethod) - elif line[:11]=="// @pymeth ": - doc, lineNo = GetComments(line, lineNo, lines) - nativeMethods.append(line+doc) elif line[:7]=="#define" and not bInRawBlock: cname = string.split(line)[1] doc, lineNo = GetComments(line, lineNo, lines) constants.append((cname, doc)) ! else: ! pos = string.find(line, '// @') ! if pos>=0: doc, lineNo = GetComments(line, lineNo, lines) ! if curMethod: ! curMethod[1].append("// " + doc + '\n') ! else: ! extra_tags.append("// " + doc + '\n') except: print "Line %d is badly formed - %s" % (lineNo, str(sys.exc_value)) --- 51,74 ---- modDoc, lineNo = GetComments(line, lineNo, lines) lineNo += 1 elif line[:7]=="#define" and not bInRawBlock: cname = string.split(line)[1] doc, lineNo = GetComments(line, lineNo, lines) constants.append((cname, doc)) ! elif line[:2]=="//": ! rest = line[2:].strip() ! if rest.startswith("@pyswig"): doc, lineNo = GetComments(line, lineNo, lines) ! curMethod = doc[8:], [] ! methods.append(curMethod) ! elif rest.startswith("@pymeth "): ! doc, lineNo = GetComments(line, lineNo, lines) ! nativeMethods.append(line+doc) ! else: ! if rest.startswith("@"): ! doc, lineNo = GetComments(line, lineNo, lines) ! if curMethod: ! curMethod[1].append("// " + doc + '\n') ! else: ! extra_tags.append("// " + doc + '\n') except: print "Line %d is badly formed - %s" % (lineNo, str(sys.exc_value)) |
From: Mark H. <mha...@us...> - 2004-11-08 02:58:19
|
Update of /cvsroot/pywin32/pywin32 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3946 Modified Files: setup.py Log Message: A module wrapping the Windows XP 'theme' APIs. Index: setup.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/setup.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** setup.py 18 Oct 2004 06:02:35 -0000 1.2 --- setup.py 8 Nov 2004 02:57:36 -0000 1.3 *************** *** 2,6 **** # Putting buildno at the top prevents automatic __doc__ assignment, and # I *want* the build number at the top :) ! __doc__="""This is a distutils setup-script for the pywin32 extnesions To build the pywin32 extensions, simply execute: --- 2,6 ---- # Putting buildno at the top prevents automatic __doc__ assignment, and # I *want* the build number at the top :) ! __doc__="""This is a distutils setup-script for the pywin32 extensions To build the pywin32 extensions, simply execute: *************** *** 76,79 **** --- 76,80 ---- this_file = sys.argv[0] + this_file = os.path.abspath(this_file) # We get upset if the cwd is not our source dir, but it is a PITA to # insist people manually CD there first! *************** *** 157,160 **** --- 158,163 ---- def get_source_files(self, dsp): result = [] + if dsp is None: + return result dsp_path = os.path.dirname(dsp) for line in open(dsp, "r"): *************** *** 861,864 **** --- 864,875 ---- extra_swig_commands=["-DWINXPGUI"], ), + # winxptheme + WinExt_win32("_winxptheme", + sources = ["win32/src/_winxptheme.i", "win32/src/_winxpthememodule.cpp"], + dsp_file = None, + libraries="gdi32 user32 comdlg32 comctl32 shell32 Uxtheme", + windows_h_version=0x0500, + extra_compile_args = ['-DUNICODE', '-D_UNICODE', '-DWINNT'], + ), WinExt_win32('servicemanager', extra_compile_args = ['-DUNICODE', '-D_UNICODE', *************** *** 1203,1210 **** and not dist.command_obj.has_key('bdist_wininst'): # What executable to use? This one I guess. ! filename = os.path.join( ! os.path.dirname(sys.argv[0]), "pywin32_postinstall.py") if not os.path.isfile(filename): ! raise RuntimeError, "Can't find pywin32_postinstall.py" print "Executing post install script..." os.spawnl(os.P_NOWAIT, sys.executable, --- 1214,1220 ---- and not dist.command_obj.has_key('bdist_wininst'): # What executable to use? This one I guess. ! filename = os.path.join(os.path.dirname(this_file), "pywin32_postinstall.py") if not os.path.isfile(filename): ! raise RuntimeError, "Can't find '%s'" % (filename,) print "Executing post install script..." os.spawnl(os.P_NOWAIT, sys.executable, |
From: Mark H. <mha...@us...> - 2004-11-08 02:57:54
|
Update of /cvsroot/pywin32/pywin32/win32/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3946/win32/src Added Files: _winxptheme.i Log Message: A module wrapping the Windows XP 'theme' APIs. --- NEW FILE: _winxptheme.i --- /* File : winxptheme.i */ // @doc %module _winxptheme // A module which provides an interface to the Windows XP // 'theme' API. // <nl>Note that this module will fail to load on // non-Windows XP versions. Generally you should use the // 'winxptheme' module which will load on all Windows // versions, and provide implementations of // IsThemeActive() or IsAppThemed() which return False when // XP is not used, and provides all objects from this module // when XP is used. See winxptheme.py for more details. %include "typemaps.i" %include "pywintypes.i" %{ #define _WIN32_IE 0x0501 // to enable balloon notifications in Shell_NotifyIcon #define _WIN32_WINNT 0x0501 //#define ISOLATION_AWARE_ENABLED 1 #undef PyHANDLE #include "pywinobjects.h" #include "windows.h" #include "Uxtheme.h" #include "commctrl.h" %} // @object PyHTHEME|A <o PyHANDLE> object wrapping a HTHEME. // <om _winxptheme.CloseThemeData> will be called when the object dies or // <om PyHANDLE.Close> is called. %{ #undef PyHANDLE // Support for HTHEME objects. Like a PyHANDLE, but calls CloseThemeData class PyHTHEME: public PyHANDLE { public: PyHTHEME(HTHEME hInit) : PyHANDLE(hInit) {} virtual BOOL Close(void) { HRESULT err = m_handle ? CloseThemeData((HTHEME)m_handle) : S_OK; m_handle = 0; if (err!= S_OK) PyWin_SetAPIError("CloseThemeData", err); return err==S_OK; } virtual const char *GetTypeName() { return "PyHTHEME"; } }; %} %typemap(python,except) HTHEME { Py_BEGIN_ALLOW_THREADS $function Py_END_ALLOW_THREADS } %typemap(python,out) HTHEME { if ($source==(HTHEME)0) { $target = Py_None; Py_INCREF(Py_None); } else $target = new PyHTHEME($source); } %typemap(python,ignore) HTHEME *(HTHEME temp) { if (temp==(HTHEME)0) { $target = Py_None; Py_INCREF(Py_None); } else $target = new PyHTHEME(temp); } %typemap(python,in) HTHEME *(HTHEME temp) { $target = &temp; if (!PyWinObject_AsHANDLE($source, $target, TRUE)) return NULL; } %apply long {HTHEME}; typedef long HTHEME; %apply HWND {long}; typedef long HWND %apply HDC {long}; typedef long HDC %typemap(python,ignore) RECT *OUTPUT(RECT temp) { $target = &temp; } %typemap(python,in) RECT *INPUT { RECT r; if (PyTuple_Check($source)) { if (PyArg_ParseTuple($source, "llll", &r.left, &r.top, &r.right, &r.bottom) == 0) { return PyErr_Format(PyExc_TypeError, "%s: This param must be a tuple of four integers", "$name"); } $target = &r; } else { return PyErr_Format(PyExc_TypeError, "%s: This param must be a tuple of four integers", "$name"); } } %typemap(python,in) RECT *INPUT_NULLOK { RECT r; if (PyTuple_Check($source)) { if (PyArg_ParseTuple($source, "llll", &r.left, &r.top, &r.right, &r.bottom) == 0) { return PyErr_Format(PyExc_TypeError, "%s: This param must be a tuple of four integers or None", "$name"); } $target = &r; } else { if ($source == Py_None) { $target = NULL; } else { PyErr_SetString(PyExc_TypeError, "This param must be a tuple of four integers or None"); return NULL; } } } // This uses a 'hresult' API typedef long HRESULT; // This will raise COM Exception. %typedef long HRESULT_KEEP; // This will keep HRESULT, and return typedef long FLAGS; %typemap(python,out) HRESULT { $target = Py_None; Py_INCREF(Py_None); } %typemap(python,except) HRESULT { Py_BEGIN_ALLOW_THREADS $function Py_END_ALLOW_THREADS if (FAILED($source)) { $cleanup return PyWin_SetAPIError("$name", $source); } } // @pyswig <o PyHTHEME>|OpenThemeData|Open the theme data for the specified HWND and // semi-colon separated list of class names. // <nl>OpenThemeData() will try each class name, one at // a time, and use the first matching theme info // found. If a match is found, a theme handle // to the data is returned. If no match is found, // a "NULL" handle is returned. // <nl>When the window is destroyed or a WM_THEMECHANGED // msg is received, <om _winxptheme.CloseThemeData> should be // called to close the theme handle. // @pyparm int|hwnd||Window handle of the control/window to be themed // // @pyparm string|pszClassList||Class name (or list of names) to match to theme data // section. if the list contains more than one name, // the names are tested one at a time for a match. // If a match is found, OpenThemeData() returns a // theme handle associated with the matching class. // This param is a list (instead of just a single // class name) to provide the class an opportunity // to get the "best" match between the class and // the current theme. For example, a button might // pass L"OkButton, Button" if its ID=ID_OK. If // the current theme has an entry for OkButton, // that will be used. Otherwise, we fall back on // the normal Button entry. HTHEME OpenThemeData(HWND hwnd, WCHAR *pszClassList); // @pyswig |CloseThemeData|Closes the theme data handle. This should be done // when the window being themed is destroyed or // whenever a WM_THEMECHANGED msg is received // (followed by an attempt to create a new Theme data // handle). // // @pyparm <o PyHTHEME>|hTheme||Open theme data handle (returned from prior call // to OpenThemeData() API). %{ static PyObject *MyCloseThemeData(PyObject *self, PyObject *args) { PyObject *obHandle; if (!PyArg_ParseTuple(args, "O:CloseThemeData", &obHandle)) return NULL; if (!PyHANDLE_Check(obHandle)) return PyErr_Format(PyExc_TypeError, "CloseThemeData requires a PyHTHEME object - got %s", obHandle->ob_type->tp_name); PyHANDLE *p = (PyHANDLE *)obHandle; if (!p->Close()) return NULL; Py_INCREF(Py_None); return Py_None; } %} %native (CloseThemeData) MyCloseThemeData; // @pyswig |DrawThemeBackground|Draws the theme-specified border and fill for // the "iPartId" and "iStateId". This could be // based on a bitmap file, a border and fill, or // other image description. // // @pyparm <o PyHTHEME>|hTheme||theme data handle // @pyparm int|hdc||HDC to draw into // @pyparm int|iPartId||part number to draw // @pyparm int|iStateId||state number (of the part) to draw // @pyparm rect|pRect||defines the size/location of the part // @pyparm rect|pClipRect||optional clipping rect (don't draw outside it) HRESULT DrawThemeBackground(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, RECT *INPUT, RECT *INPUT_NULLOK); // @pyswig |DrawThemeText|Draws the text using the theme-specified // color and font for the "iPartId" and "iStateId". // @pyparm <o PyHTHEME>|hTheme||theme data handle // @pyparm int|hdc||HDC to draw into // @pyparm int|iPartId||part number to draw // @pyparm int|iStateId||state number (of the part) to draw // @pyparm string|pszText||actual text to draw // @pyparm int|dwCharCount||number of chars to draw (-1 for all) // @pyparm int|dwTextFlags||same as DrawText() "uFormat" param // @pyparm int|dwTextFlags2||additional drawing options // @pyparm rect|pRect||defines the size/location of the part HRESULT DrawThemeText(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, WCHAR *pszText, int iCharCount, DWORD dwTextFlags, DWORD dwTextFlags2, RECT *INPUT); // @pyswig rect|GetThemeBackgroundContentRect|Gets the size of the content for the theme-defined // background. This is usually the area inside the borders or Margins. // @pyparm <o PyHTHEME>|hTheme||theme data handle // @pyparm int|hdc||(optional) device content to be used for drawing // @pyparm int|iPartId||part number to draw // @pyparm int|iStateId||state number (of the part) to draw // @pyparm rect|pBoundingRect||the outer RECT of the part being drawn // @rdesc The result is a rect with the content area HRESULT GetThemeBackgroundContentRect(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, RECT *INPUT, RECT *OUTPUT); // @pyswig rect|GetThemeBackgroundExtent|Calculates the size/location of the theme- // specified background based on the "pContentRect". // @pyparm <o PyHTHEME>|hTheme||theme data handle // @pyparm int|hdc||(optional) device content to be used for drawing // @pyparm int|iPartId||part number to draw // @pyparm int|iStateId||state number (of the part) to draw // @pyparm rect|pContentRect||RECT that defines the content area // @rdesc Result is a rect with the overall size/location of part HRESULT GetThemeBackgroundExtent(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, RECT *INPUT, RECT *OUTPUT); // @pyswig bool|IsThemeActive|Can be used to test if a system theme is active // for the current user session. // <nl>use the API <om _winxptheme.IsAppThemed> to test if a theme is // active for the calling process. BOOL IsThemeActive(); // @pyswig bool|IsAppThemed|Returns True if a theme is active and available to // the current process BOOL IsAppThemed(); // @pyswig <o PyHTHEME>|GetWindowTheme|If window is themed, returns its most recent // HTHEME from OpenThemeData() - otherwise, returns NULL. // @pyparm int|hwnd||The window to get the HTHEME of HTHEME GetWindowTheme(HWND hwnd); // @pyswig |EnableThemeDialogTexture|Enables/disables dialog background theme. // This method can be used to // tailor dialog compatibility with child windows and controls that // may or may not coordinate the rendering of their client area backgrounds // with that of their parent dialog in a manner that supports seamless // background texturing. // @pyparm int|hdlg||The window handle of the target dialog // @pyparm int|dwFlags||ETDT_ENABLE to enable the theme-defined dialog background texturing, // <nl>ETDT_DISABLE to disable background texturing, // <nl>ETDT_ENABLETAB to enable the theme-defined background // texturing using the Tab texture #define ETDT_DISABLE ETDT_DISABLE #define ETDT_ENABLE ETDT_ENABLE #define ETDT_USETABTEXTURE ETDT_USETABTEXTURE #define ETDT_ENABLETAB ETDT_ENABLETAB HRESULT EnableThemeDialogTexture(HWND hwnd, DWORD dwFlags); // @pyswig bool|IsThemeDialogTextureEnabled|Reports whether the dialog supports background texturing. // @pyparm int|hdlg||The window handle of the target dialog BOOL IsThemeDialogTextureEnabled(HWND hwnd); // @pyswig int|GetThemeAppProperties|Returns the app property flags that control theming long GetThemeAppProperties(); // @pyswig |EnableTheming|Enables or disables themeing for the current user // in the current and future sessions. // @pyparm bool|fEnable||if False, disable theming & turn themes off. // <nl>if True, enable themeing and, if user previously // had a theme active, make it active now. HRESULT EnableTheming(BOOL fEnable); // @pyswig |SetWindowTheme|Rredirects an existing Window to use a different // section of the current theme information than its class normally asks for. // @pyparm int|hwnd||The handle of the window (cannot be 0) // @pyparm string/None|pszSubAppName||App (group) name to use in place of the calling // app's name. If NULL, the actual calling app name will be used. // @pyparm string/None|pszSubIdList||A semicolon separated list of class Id names to // use in place of actual list passed by the window's class. if NULL, the id // list from the calling class is used. HRESULT SetWindowTheme(HWND hwnd, WCHAR *INPUT_NULLOK, WCHAR *INPUT_NULLOK); // @pyswig (string, string, string)|GetCurrentThemeName| // Get the name of the current theme in-use, the // canonical color scheme name (not the display name) and the // canonical size name (not the display name). %{ static PyObject *MyGetCurrentThemeName(PyObject *self, PyObject *args) { if (!PyArg_ParseTuple(args, ":GetCurrentThemeName")) return NULL; WCHAR nameBuf[256] = {'\0'}; WCHAR colorBuf[256] = {'\0'}; WCHAR sizeBuf[256] = {'\0'}; HRESULT hr = GetCurrentThemeName(nameBuf, sizeof(nameBuf)/sizeof(TCHAR), colorBuf, sizeof(colorBuf)/sizeof(TCHAR), sizeBuf, sizeof(sizeBuf)/sizeof(TCHAR)); if (FAILED(hr)) return PyWin_SetAPIError("GetCurrentThemeName", hr); return Py_BuildValue("NNN", PyWinObject_FromWCHAR(nameBuf), PyWinObject_FromWCHAR(colorBuf), PyWinObject_FromWCHAR(sizeBuf)); } %} %native (GetCurrentThemeName) MyGetCurrentThemeName; %init %{ PyDict_SetItemString(d, "error", PyWinExc_ApiError); %} |
From: Mark H. <mha...@us...> - 2004-11-08 02:57:53
|
Update of /cvsroot/pywin32/pywin32/win32/Lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3946/win32/lib Added Files: winxptheme.py Log Message: A module wrapping the Windows XP 'theme' APIs. --- NEW FILE: winxptheme.py --- """A useful wrapper around the "_winxptheme" module. Unlike _winxptheme, this module will load on any version of Windows. If _winxptheme is not available, then this module will have only 2 functions - IsAppThemed() and IsThemeActive, which will both always return False. If _winxptheme is available, this module will have all methods in that module, including real implementations of IsAppThemed() and IsThemeActive(). """ import win32api try: win32api.FreeLibrary(win32api.LoadLibrary("Uxtheme.dll")) # Life is good, everything is available. from _winxptheme import * except win32api.error: # Probably not running XP. def IsAppThemed(): return False def IsThemeActive(): return False del win32api |
From: Mark H. <mha...@us...> - 2004-11-03 20:36:39
|
Update of /cvsroot/pywin32/pywin32/Pythonwin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2944 Modified Files: win32util.cpp Log Message: Allow font quality to be specified in the LOGFONT - from Stefan Eischet Index: win32util.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/win32util.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** win32util.cpp 20 Jan 2004 22:26:41 -0000 1.6 --- win32util.cpp 3 Nov 2004 20:36:28 -0000 1.7 *************** *** 232,235 **** --- 232,236 ---- // // + static const char *szFontQuality = "quality"; static const char *szFontName = "name"; static const char *szFontWeight = "weight"; *************** *** 244,247 **** --- 245,249 ---- { PyObject *ret = PyDict_New(); + PyMapping_SetItemString( ret, (char *)szFontQuality, PyInt_FromLong(lf.lfQuality)); PyMapping_SetItemString( ret, (char *)szFontName, PyString_FromString((char *)lf.lfFaceName) ); PyMapping_SetItemString( ret, (char *)szFontHeight, PyInt_FromLong(-lf.lfHeight)); *************** *** 261,267 **** // font default values pLF->lfCharSet = DEFAULT_CHARSET; // dont use ANSI_CHARSET to support Japanese charset. ! pLF->lfQuality = PROOF_QUALITY; // don't scale raster fonts PyObject *v; v = PyDict_GetItemString (font_props, (char *)szFontName); --- 263,275 ---- // font default values pLF->lfCharSet = DEFAULT_CHARSET; // dont use ANSI_CHARSET to support Japanese charset. ! pLF->lfQuality = PROOF_QUALITY; // don't scale raster fonts and force anti aliasing PyObject *v; + v = PyDict_GetItemString (font_props, (char *)szFontQuality); + if (v != NULL) + if (PyInt_Check (v)) + pLF->lfQuality = (BYTE)PyInt_AsLong(v); + else + RETURN_ERR ("Expected integer value for font quality property"); v = PyDict_GetItemString (font_props, (char *)szFontName); |
From: Mark H. <mha...@us...> - 2004-10-26 01:31:06
|
Update of /cvsroot/pywin32/pywin32/isapi/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21835 Modified Files: Utils.cpp Log Message: Don't return a garbage string if FormatMessage fails. Index: Utils.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/isapi/src/Utils.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Utils.cpp 6 Oct 2004 05:11:54 -0000 1.1 --- Utils.cpp 26 Oct 2004 01:30:57 -0000 1.2 *************** *** 61,64 **** --- 61,65 ---- char *result = (char *)malloc(1024); if (!result) return NULL; + result[0] = '\0'; int nLen =FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL, |
From: Mark H. <mha...@us...> - 2004-10-26 01:30:39
|
Update of /cvsroot/pywin32/pywin32/isapi/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21723 Modified Files: PyFilterObjects.cpp Log Message: Allow GetHeader to specify a default value. Index: PyFilterObjects.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/isapi/src/PyFilterObjects.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** PyFilterObjects.cpp 6 Oct 2004 05:11:53 -0000 1.1 --- PyFilterObjects.cpp 26 Oct 2004 01:30:30 -0000 1.2 *************** *** 478,483 **** DWORD bufSize = sizeof(buffer) / sizeof(TCHAR); char *name; // @pyparm string|header|| ! if (!PyArg_ParseTuple(args, "s:GetHeader", &name)) return NULL; BOOL ok; --- 478,485 ---- DWORD bufSize = sizeof(buffer) / sizeof(TCHAR); char *name; + PyObject *def = NULL; // @pyparm string|header|| ! // @pyparm object|default||If specified, this will be returned on error. ! if (!PyArg_ParseTuple(args, "s|O:GetHeader", &name, &def)) return NULL; BOOL ok; *************** *** 489,494 **** ok = pp->GetHeader(pfc, name, buffer, &bufSize); Py_END_ALLOW_THREADS ! if (!ok) ! return SetPyHFCError("GetHeader"); return PyString_FromStringAndSize(buffer, bufSize-1); } --- 491,500 ---- ok = pp->GetHeader(pfc, name, buffer, &bufSize); Py_END_ALLOW_THREADS ! if (!ok || bufSize==0) { ! if (def == NULL) ! return SetPyHFCError("GetHeader"); ! Py_INCREF(def); ! return def; ! } return PyString_FromStringAndSize(buffer, bufSize-1); } |
From: Mark H. <mha...@us...> - 2004-10-26 01:29:41
|
Update of /cvsroot/pywin32/pywin32/isapi In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21432 Modified Files: threaded_extension.py Log Message: Move the error handler's SendResponseHeaders into the exception handler. Index: threaded_extension.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/isapi/threaded_extension.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** threaded_extension.py 6 Oct 2004 05:11:52 -0000 1.1 --- threaded_extension.py 26 Oct 2004 01:29:32 -0000 1.2 *************** *** 140,145 **** ecb.HttpStatusCode = isapicon.HSE_STATUS_ERROR #control_block.LogData = "we failed!" - ecb.SendResponseHeaders("200 OK", "Content-type: text/html\r\n\r\n", - False) exc_typ, exc_val, exc_tb = sys.exc_info() limit = None --- 140,143 ---- *************** *** 147,150 **** --- 145,150 ---- try: import cgi + ecb.SendResponseHeaders("200 OK", "Content-type: text/html\r\n\r\n", + False) print >> ecb print >> ecb, "<H3>Traceback (most recent call last):</H3>" |
From: Mark H. <mha...@us...> - 2004-10-19 23:03:06
|
Update of /cvsroot/pywin32/pywin32/com/win32com/client In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21984 Modified Files: genpy.py Log Message: If a property had a reserved word, things got messy. via: [ 1049836 ] makepy and reserved word propertyes Index: genpy.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/client/genpy.py,v retrieving revision 1.43 retrieving revision 1.44 diff -C2 -d -r1.43 -r1.44 *** genpy.py 25 Apr 2004 03:29:38 -0000 1.43 --- genpy.py 19 Oct 2004 23:02:56 -0000 1.44 *************** *** 24,28 **** error = "makepy.error" ! makepy_version = "0.4.91" # Written to generated file. GEN_FULL="full" --- 24,28 ---- error = "makepy.error" ! makepy_version = "0.4.92" # Written to generated file. GEN_FULL="full" *************** *** 409,413 **** continue ! print >> stream, '\t\t"%s": %s,' % (key, mapEntry) names = self.propMapGet.keys(); names.sort() for key in names: --- 409,413 ---- continue ! print >> stream, '\t\t"%s": %s,' % (build.MakePublicAttributeName(key), mapEntry) names = self.propMapGet.keys(); names.sort() for key in names: *************** *** 433,437 **** if entry.desc[0]==pythoncom.DISPID_NEWENUM: continue ! print >> stream, '\t\t"%s": %s,' % (key, mapEntry) print >> stream, "\t}" --- 433,437 ---- if entry.desc[0]==pythoncom.DISPID_NEWENUM: continue ! print >> stream, '\t\t"%s": %s,' % (build.MakePublicAttributeName(key), mapEntry) print >> stream, "\t}" *************** *** 451,455 **** else: defArgDesc = defArgDesc + "," ! print >> stream, '\t\t"%s" : ((%s, LCID, %d, 0),(%s)),' % (key, details[0], pythoncom.DISPATCH_PROPERTYPUT, defArgDesc) names = self.propMapPut.keys(); names.sort() --- 451,455 ---- else: defArgDesc = defArgDesc + "," ! print >> stream, '\t\t"%s" : ((%s, LCID, %d, 0),(%s)),' % (build.MakePublicAttributeName(key), details[0], pythoncom.DISPATCH_PROPERTYPUT, defArgDesc) names = self.propMapPut.keys(); names.sort() *************** *** 459,463 **** details = entry.desc defArgDesc = MakeDefaultArgsForPropertyPut(details[2]) ! print >> stream, '\t\t"%s": ((%s, LCID, %d, 0),%s),' % (key, details[0], details[4], defArgDesc) print >> stream, "\t}" --- 459,463 ---- details = entry.desc defArgDesc = MakeDefaultArgsForPropertyPut(details[2]) ! print >> stream, '\t\t"%s": ((%s, LCID, %d, 0),%s),' % (build.MakePublicAttributeName(key), details[0], details[4], defArgDesc) print >> stream, "\t}" |
From: Mark H. <mha...@us...> - 2004-10-18 06:04:37
|
Update of /cvsroot/pywin32/pywin32 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9086 Modified Files: setup_win32all.py Log Message: Oops - fix the new setup_win32all stub. Index: setup_win32all.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/setup_win32all.py,v retrieving revision 1.38 retrieving revision 1.39 diff -C2 -d -r1.38 -r1.39 *** setup_win32all.py 18 Oct 2004 06:02:35 -0000 1.38 --- setup_win32all.py 18 Oct 2004 06:04:21 -0000 1.39 *************** *** 4,6 **** import sys, os mydir=os.path.dirname(sys.argv[0]) ! execfile(os.path.join(mydir, "setup_win32all.py")) --- 4,6 ---- import sys, os mydir=os.path.dirname(sys.argv[0]) ! execfile(os.path.join(mydir, "setup.py")) |
From: Mark H. <mha...@us...> - 2004-10-18 06:02:45
|
Update of /cvsroot/pywin32/pywin32 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8661 Modified Files: setup.py setup_win32all.py Log Message: Make setup.py the official build script, and setup_win32all.py now prints a warning and executes setup.py Make swig_sources() work with Python 2.4 Index: setup.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/setup.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** setup.py 11 Oct 2004 06:43:57 -0000 1.1 --- setup.py 18 Oct 2004 06:02:35 -0000 1.2 *************** *** 1,5 **** ! # Eventually setup_win32all.py will be renamed to setup.py ! # When we do that, we will put a warning + the execfile in setup_win32all.py ! import sys, os ! mydir=os.path.dirname(sys.argv[0]) ! execfile(os.path.join(mydir, "setup_win32all.py")) --- 1,1212 ---- ! build_number=203 ! # Putting buildno at the top prevents automatic __doc__ assignment, and ! # I *want* the build number at the top :) ! __doc__="""This is a distutils setup-script for the pywin32 extnesions [...1188 lines suppressed...] ! # Custom script we run at the end of installing - this is the same script ! # run by bdist_wininst, but the standard 'install' command doesn't seem ! # to have such a concept. ! # This child process won't be able to install the system DLLs until our ! # process has terminated (as distutils imports win32api!), so we must use ! # some 'no wait' executor - spawn seems fine! We pass the PID of this ! # process so the child will wait for us. ! # XXX - hmm - a closer look at distutils shows it only uses win32api ! # if _winreg fails - and this never should. Need to revisit this! ! if not dist.dry_run and dist.command_obj.has_key('install') \ ! and not dist.command_obj.has_key('bdist_wininst'): ! # What executable to use? This one I guess. ! filename = os.path.join( ! os.path.dirname(sys.argv[0]), "pywin32_postinstall.py") ! if not os.path.isfile(filename): ! raise RuntimeError, "Can't find pywin32_postinstall.py" ! print "Executing post install script..." ! os.spawnl(os.P_NOWAIT, sys.executable, ! sys.executable, filename, ! "-quiet", "-wait", str(os.getpid()), "-install") Index: setup_win32all.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/setup_win32all.py,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -d -r1.37 -r1.38 *** setup_win32all.py 10 Oct 2004 22:15:16 -0000 1.37 --- setup_win32all.py 18 Oct 2004 06:02:35 -0000 1.38 *************** *** 1,1219 **** ! build_number=203 ! # Putting buildno at the top prevents automatic __doc__ assignment, and ! # I *want* the build number at the top :) ! __doc__="""This is a distutils setup-script for win32all ! ! To build the win32all extensions, simply execute: ! python setup_win32all.py -q build ! ! These extensions require a number of libraries to build, some of which may ! require you to install special SDKs or toolkits. This script will attempt [...1196 lines suppressed...] ! # XXX - hmm - a closer look at distutils shows it only uses win32api ! # if _winreg fails - and this never should. Need to revisit this! ! if not dist.dry_run and dist.command_obj.has_key('install') \ ! and not dist.command_obj.has_key('bdist_wininst'): ! # What executable to use? This one I guess. ! filename = os.path.join( ! os.path.dirname(sys.argv[0]), "pywin32_postinstall.py") ! if not os.path.isfile(filename): ! raise RuntimeError, "Can't find pywin32_postinstall.py" ! print "Executing post install script..." ! os.spawnl(os.P_NOWAIT, sys.executable, ! sys.executable, filename, ! "-quiet", "-wait", str(os.getpid()), "-install") --- 1,6 ---- ! # The build script used to be called setup_win32all.py ! # We will remove this in a few versions, but give people the hint ! print "Please use 'setup.py' instead of 'setup_win32all.py'" ! import sys, os ! mydir=os.path.dirname(sys.argv[0]) ! execfile(os.path.join(mydir, "setup_win32all.py")) |
From: Mark H. <mha...@us...> - 2004-10-11 06:48:45
|
Update of /cvsroot/pywin32/pywin32 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32003 Added Files: README.txt Log Message: README for the root of the source tree. --- NEW FILE: README.txt --- This is the readme for the Python for Win32 (pywin32) extensions source code. 'setup_win32all.py' (soon to be renamed to the standard 'setup.py') is a standard distutils build script. You probably want to: % setup_win32all.py install or % setup_win32all.py --help As for Python itself, these extensions require MSVC7 for Python 2.4 and later, otherwise MSVC6. Some extensions require a recent "Platform SDK" from Microsoft, and in general, the latest service packs should be installed, but run 'setup_win32all.py' without any arguments to see specific information about dependencies. A vanilla MSVC installation should be able to build most extensions and list any extensions that could not be built due to missing libraries - if the build actually fails with your configuration, please log a bug via http://sourceforge.net/projects/pywin32. |
From: Mark H. <mha...@us...> - 2004-10-11 06:46:29
|
Update of /cvsroot/pywin32/pywin32/com/win32com/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31412 Modified Files: testall.py Log Message: Don't try and invoke python_d - it may exist, but may not have win32all setup for it. Index: testall.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/test/testall.py,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** testall.py 4 May 2004 06:59:15 -0000 1.24 --- testall.py 11 Oct 2004 06:46:14 -0000 1.25 *************** *** 66,75 **** class PippoTest(TestCase): def testit(self): ! # Execute pippo via python_d, so it can refcount check. ! exe_dir = os.path.dirname(sys.executable) ! python = os.path.join(exe_dir, "python_d.exe") ! if not os.path.isfile(python): ! print "Can't find python_d (but pippo would prefer it!)" ! python = sys.executable fname = os.path.join(os.path.dirname(this_file), "testPippo.py") cmd = '%s "%s" 2>&1' % (python, fname) --- 66,70 ---- class PippoTest(TestCase): def testit(self): ! python = sys.executable fname = os.path.join(os.path.dirname(this_file), "testPippo.py") cmd = '%s "%s" 2>&1' % (python, fname) |
From: Mark H. <mha...@us...> - 2004-10-11 06:45:50
|
Update of /cvsroot/pywin32/pywin32/com/win32com/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31342 Modified Files: util.py Log Message: Avoid 2.3isms in the test suite utilities Index: util.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/test/util.py,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** util.py 4 May 2004 06:58:47 -0000 1.5 --- util.py 11 Oct 2004 06:45:38 -0000 1.6 *************** *** 36,40 **** cmd = cmd + ' > "%s" 2>&1' % output_name rc = os.system(cmd) ! output = open(output_name, "U").read().strip() class Failed(Exception): pass try: --- 36,40 ---- cmd = cmd + ' > "%s" 2>&1' % output_name rc = os.system(cmd) ! output = open(output_name, "r").read().strip() class Failed(Exception): pass try: |
From: Mark H. <mha...@us...> - 2004-10-11 06:44:11
|
Update of /cvsroot/pywin32/pywin32 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30801 Added Files: setup.py Log Message: Eventually setup_win32all.py will become setup.py (and setup_win32all will become this stub that calls the real setup) --- NEW FILE: setup.py --- # Eventually setup_win32all.py will be renamed to setup.py # When we do that, we will put a warning + the execfile in setup_win32all.py import sys, os mydir=os.path.dirname(sys.argv[0]) execfile(os.path.join(mydir, "setup_win32all.py")) |
From: Mark H. <mha...@us...> - 2004-10-11 06:42:55
|
Update of /cvsroot/pywin32/pywin32 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30570 Modified Files: MANIFEST.in Log Message: Add the setup scripts and autoduck to the source dist Index: MANIFEST.in =================================================================== RCS file: /cvsroot/pywin32/pywin32/MANIFEST.in,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** MANIFEST.in 10 Oct 2004 22:15:16 -0000 1.5 --- MANIFEST.in 11 Oct 2004 06:42:45 -0000 1.6 *************** *** 6,9 **** --- 6,13 ---- include MANIFEST.in include pywin32.pth + # while we have setup.py and setup_win32all.py, distutils will miss whatever + # one was not used! + include setup_win32all.py + include setup.py # Core win32 stuff include win32/src/*.rc *************** *** 105,106 **** --- 109,113 ---- include SWIG/swig_lib/python/*.i include SWIG/swig_lib/python/*.swg + + include AutoDuck/* + include AutoDuck/bin/* |
From: Mark H. <mha...@us...> - 2004-10-11 06:18:00
|
Update of /cvsroot/pywin32/pywin32/win32/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26470 Modified Files: PythonService.cpp Log Message: A couple of tweaks to the code reintroducing NT support. Index: PythonService.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/PythonService.cpp,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** PythonService.cpp 10 Oct 2004 22:08:29 -0000 1.15 --- PythonService.cpp 11 Oct 2004 06:17:49 -0000 1.16 *************** *** 723,727 **** return FALSE; UINT i; ! for (i=0;i<MAX_SERVICES;i++) { if (DispatchTable[i].lpServiceName==NULL) break; --- 723,727 ---- return FALSE; UINT i; ! for (i=0;i<g_maxServices;i++) { if (DispatchTable[i].lpServiceName==NULL) break; *************** *** 729,733 **** return FALSE; } ! if (i>=MAX_SERVICES) return FALSE; --- 729,733 ---- return FALSE; } ! if (i>=g_maxServices) return FALSE; |
From: Mark H. <mha...@us...> - 2004-10-10 23:07:21
|
Update of /cvsroot/pywin32/pywin32/com/win32com/server In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12868 Modified Files: policy.py Log Message: Correct an error in the new IDispatch typelib provider support. Index: policy.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/server/policy.py,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** policy.py 7 Sep 2004 02:15:07 -0000 1.18 --- policy.py 10 Oct 2004 23:06:08 -0000 1.19 *************** *** 530,534 **** return [] tlb_major, tlb_minor = getattr(self._obj_, '_typelib_version_', (1,0)) ! tlb = pythoncom.LoadRegTypeLib(tlb_guid, tlb_major, tlb_minor, lcid) typecomp = tlb.GetTypeComp() # Not 100% sure what semantics we should use for the default interface. --- 530,534 ---- return [] tlb_major, tlb_minor = getattr(self._obj_, '_typelib_version_', (1,0)) ! tlb = pythoncom.LoadRegTypeLib(tlb_guid, tlb_major, tlb_minor) typecomp = tlb.GetTypeComp() # Not 100% sure what semantics we should use for the default interface. |
From: Mark H. <mha...@us...> - 2004-10-10 22:23:04
|
Update of /cvsroot/pywin32/pywin32/win32/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3421 Modified Files: win32apimodule.cpp Log Message: Add SetConsoleCtrlHandler() Index: win32apimodule.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32apimodule.cpp,v retrieving revision 1.42 retrieving revision 1.43 diff -C2 -d -r1.42 -r1.43 *** win32apimodule.cpp 1 Oct 2004 00:12:59 -0000 1.42 --- win32apimodule.cpp 10 Oct 2004 22:22:51 -0000 1.43 *************** *** 4382,4385 **** --- 4382,4483 ---- } + static BOOL addedCtrlHandler = FALSE; + static PyObject *consoleControlHandlers = NULL; + static BOOL WINAPI PyCtrlHandler(DWORD dwCtrlType) + { + CEnterLeavePython _celp; + // try and keep similar semantics to windows itself - last first, and + // first to return TRUE stops the search. + // Thread-safety provided by GIL + PyObject *args = Py_BuildValue("(i)", dwCtrlType); + if (!args) return FALSE; + BOOL rc = FALSE; + for (int i=PyList_GET_SIZE(consoleControlHandlers);i>0 && !rc;i--) { + // The list may shift underneath us during the call - check index + // is still valid. + if (i > PyList_GET_SIZE(consoleControlHandlers)) + continue; + + PyObject *ob = PyList_GET_ITEM(consoleControlHandlers, i-1); + PyObject *ret = PyObject_Call(ob, args, NULL); + if (ret == NULL) { + PySys_WriteStderr("ConsoleCtrlHandler function failed"); + PyErr_Print(); + PyErr_Clear(); + continue; + } + rc = PyObject_IsTrue(ret); + Py_DECREF(ret); + } + Py_DECREF(args); + return rc; + } + + // @pymethod |win32api|SetConsoleCtrlHandler|Adds or removes an application-defined HandlerRoutine function from the list of handler functions for the calling process. + PyObject *PySetConsoleCtrlHandler(PyObject *self, PyObject *args) + { + // @comm Note that the implementation is a single CtrlHandler in C, which + // keeps a list of the handlers added by this function. So although this + // function uses the same semantics as the Win32 function (ie, last + // registered first called, and first to return True stops the calls) the + // true order of all Python and C implemented CtrlHandlers may not match + // what would happen if all were implemented in C. + // <nl>This handler must acquire the Python lock before it can call any + // of the registered handlers. This means the handler may not be called + // until the current Python thread yields the lock. + // <nl> + // A console process can use the <om win32api.GenerateConsoleCtrlEvent> + // function to send a CTRL+C or CTRL+BREAK signal to a console process + // group. + // <nl>The system generates CTRL_CLOSE_EVENT, CTRL_LOGOFF_EVENT, and + // CTRL_SHUTDOWN_EVENT signals when the user closes the console, logs off, + // or shuts down the system so that the process has an opportunity to + // clean up before termination. + // @pyseeapi SetConsoleCtrlHandler + PyObject *func; + int bAdd = TRUE; + // @pyparm callable|ctrlHandler||The function to call. This function + // should accept one param - the type of signal. + // @pyparm int|bAdd||True if the handler is being added, false if removed. + if (!PyArg_ParseTuple(args, "O|i:SetConsoleCtrlHandler", &func, &bAdd)) + return NULL; + if (!PyCallable_Check(func)) + return PyErr_Format(PyExc_TypeError, + "First argument must be callable (got %s)", + func->ob_type->tp_name); + // thread-safety provided by GIL + if (consoleControlHandlers==NULL) + consoleControlHandlers = PyList_New(0); + if (consoleControlHandlers==NULL) + return NULL; + + if (bAdd) { + if (0 != PyList_Append(consoleControlHandlers, func)) + return NULL; + if (!addedCtrlHandler) { + SetConsoleCtrlHandler(PyCtrlHandler, TRUE); + addedCtrlHandler = TRUE; + } + } else { + int i; + BOOL found = FALSE; + for (i=0;i<PyList_Size(consoleControlHandlers);i++) { + if (PyList_GET_ITEM(consoleControlHandlers, i)==func) { + if (0 != PyList_SetSlice(consoleControlHandlers, i, i+1, NULL)) + return NULL; + found = TRUE; + } + } + if (!found) + return PyErr_Format(PyExc_ValueError, "The object has not been registered"); + if (addedCtrlHandler && PyList_Size(consoleControlHandlers)==0) { + SetConsoleCtrlHandler(PyCtrlHandler, FALSE); + addedCtrlHandler = FALSE; + } + } + Py_INCREF(Py_None); + return Py_None; + } + /* List of functions exported by this module */ // @module win32api|A module, encapsulating the Windows Win32 API. *************** *** 4519,4522 **** --- 4617,4621 ---- {"SearchPath", PySearchPath, 1}, // @pymeth SearchPath|Searches a path for a file. {"SendMessage", PySendMessage, 1}, // @pymeth SendMessage|Send a message to a window. + {"SetConsoleCtrlHandler",PySetConsoleCtrlHandler, 1}, // @pymeth SetConsoleCtrlHandler|Adds or removes an application-defined HandlerRoutine function from the list of handler functions for the calling process. {"SetConsoleTitle", PySetConsoleTitle, 1}, // @pymeth SetConsoleTitle|Sets the title for the current console. {"SetCursorPos", PySetCursorPos,1}, // @pymeth SetCursorPos|The SetCursorPos function moves the cursor to the specified screen coordinates. *************** *** 4642,4648 **** } } - - - - - --- 4741,4742 ---- |
From: Mark H. <mha...@us...> - 2004-10-10 22:15:44
|
Update of /cvsroot/pywin32/pywin32 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1515 Modified Files: MANIFEST.in pywin32_postinstall.py setup_win32all.py Added Files: pywin32.pth Log Message: Just copy the .pth file in like any other file rather than creating it dynamically. This means that simply "unzipping" one of these distributions should largely work. Index: pywin32_postinstall.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/pywin32_postinstall.py,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** pywin32_postinstall.py 9 Oct 2004 02:44:03 -0000 1.16 --- pywin32_postinstall.py 10 Oct 2004 22:15:16 -0000 1.17 *************** *** 129,147 **** import distutils.sysconfig import traceback # Create the .pth file in the site-packages dir, and use only relative paths lib_dir = distutils.sysconfig.get_python_lib(plat_specific=1) ! # Used to write this directly to sys.prefix - clobber it. if os.path.isfile(os.path.join(sys.prefix, "pywin32.pth")): os.unlink(os.path.join(sys.prefix, "pywin32.pth")) ! fname = os.path.join(lib_dir, "pywin32.pth") ! if verbose: ! print "Creating .PTH file %s" % fname ! pthfile = open(fname, "w") ! # Register the file with the uninstaller ! file_created(fname) for name in "win32 win32\\lib Pythonwin".split(): - # Create entries for the PTH file, and at the same time - # add the directory to sys.path so we can load win32api below. - pthfile.write(name + "\n") sys.path.append(os.path.join(lib_dir, name)) # It is possible people with old versions installed with still have --- 129,141 ---- import distutils.sysconfig import traceback + # The .pth file is now installed as a regular file. # Create the .pth file in the site-packages dir, and use only relative paths lib_dir = distutils.sysconfig.get_python_lib(plat_specific=1) ! # We used to write a .pth directly to sys.prefix - clobber it. if os.path.isfile(os.path.join(sys.prefix, "pywin32.pth")): os.unlink(os.path.join(sys.prefix, "pywin32.pth")) ! # The .pth may be new and therefore not loaded in this session. ! # Setup the paths just in case. for name in "win32 win32\\lib Pythonwin".split(): sys.path.append(os.path.join(lib_dir, name)) # It is possible people with old versions installed with still have Index: MANIFEST.in =================================================================== RCS file: /cvsroot/pywin32/pywin32/MANIFEST.in,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** MANIFEST.in 6 Oct 2004 05:13:00 -0000 1.4 --- MANIFEST.in 10 Oct 2004 22:15:16 -0000 1.5 *************** *** 5,8 **** --- 5,9 ---- include MANIFEST.in + include pywin32.pth # Core win32 stuff include win32/src/*.rc Index: setup_win32all.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/setup_win32all.py,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -d -r1.36 -r1.37 *** setup_win32all.py 8 Oct 2004 21:51:25 -0000 1.36 --- setup_win32all.py 10 Oct 2004 22:15:16 -0000 1.37 *************** *** 1177,1180 **** --- 1177,1181 ---- # Note we don't get an auto .pyc - but who cares? ('', ('com/pythoncom.py',)), + ('', ('pywin32.pth',)), ], ) --- NEW FILE: pywin32.pth --- # .pth file for the PyWin32 extensions win32 win32\lib Pythonwin |
From: Mark H. <mha...@us...> - 2004-10-10 22:08:39
|
Update of /cvsroot/pywin32/pywin32/win32/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32436 Modified Files: PythonService.cpp Log Message: Patch from David Bolen to restore Python service functionality on Windows NT. Index: PythonService.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/PythonService.cpp,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** PythonService.cpp 10 Sep 2004 06:58:57 -0000 1.14 --- PythonService.cpp 10 Oct 2004 22:08:29 -0000 1.15 *************** *** 57,60 **** --- 57,89 ---- #define MAX_SERVICES 10 + // 2K/XP support newer service registration functions that enable multiple + // service support, but NT does not. Depending on the run time environment, + // we adjust the number of services we can support as well as which + // registration and service control functions to use. We leave a hard + // reference to the older function to ensure that we can at least fall back + // to that if something goes wrong with the dynamic identification. + + // If we can locate the newer registration function on startup, this will be + // increased to MAX_SERVICES + DWORD g_maxServices = 1; + + #if(WINVER < 0x0500) + // SDK probably doesn't define LPHANDLER_FUNCTION_EX, so do it ourselves. + typedef DWORD (WINAPI *LPHANDLER_FUNCTION_EX)( + DWORD dwControl, + DWORD dwEventType, + LPVOID lpEventData, + LPVOID lpContext + ); + #endif + + typedef SERVICE_STATUS_HANDLE + (WINAPI *REGSVC_EX_FN)(LPCTSTR lpServiceName, + LPHANDLER_FUNCTION_EX lpHandlerProc, + LPVOID lpContext); + + REGSVC_EX_FN g_RegisterServiceCtrlHandlerEx = NULL; + + typedef struct { PyObject *klass; // The Python class we instantiate as the service. *************** *** 68,73 **** // The global SCM dispatch table. A trailing NULL indicates to the SCM ! // how many are used - as we add new entries, we null the next. ! static SERVICE_TABLE_ENTRY DispatchTable[MAX_SERVICES] = { { NULL, NULL } --- 97,102 ---- // The global SCM dispatch table. A trailing NULL indicates to the SCM ! // how many are used, so we allocate one extra for this sentinal ! static SERVICE_TABLE_ENTRY DispatchTable[MAX_SERVICES+1] = { { NULL, NULL } *************** *** 82,85 **** --- 111,115 ---- BOOL WINAPI DebugControlHandler ( DWORD dwCtrlType ); DWORD WINAPI service_ctrl_ex(DWORD, DWORD, LPVOID, LPVOID); + VOID WINAPI service_ctrl(DWORD); BOOL RegisterPythonServiceExe(void); *************** *** 277,281 **** return Py_None; } ! pe->sshStatusHandle = RegisterServiceCtrlHandlerEx(szName, service_ctrl_ex, pe); PyWinObject_FreeWCHAR(szName); PyObject *rc; --- 307,317 ---- return Py_None; } ! if (g_RegisterServiceCtrlHandlerEx) { ! // Use 2K/XP extended registration if available ! pe->sshStatusHandle = g_RegisterServiceCtrlHandlerEx(szName, service_ctrl_ex, pe); ! } else { ! // Otherwise fall back to NT ! pe->sshStatusHandle = RegisterServiceCtrlHandler(szName, service_ctrl); ! } PyWinObject_FreeWCHAR(szName); PyObject *rc; *************** *** 475,478 **** --- 511,515 ---- initservicemanager(void) { + HMODULE advapi32_module; PyObject *dict, *module; module = Py_InitModule("servicemanager", servicemanager_functions); *************** *** 503,506 **** --- 540,559 ---- ADD_CONSTANT(EVENTLOG_AUDIT_FAILURE); PyWinGlobals_Ensure(); + + // Check if we can use the newer control handler registration function + // which permits us to support multiple services. This should be available + // on 2K/XP systems. + + // We already have a hard dependency on advapi32, so it shouldn't + // be possible for us not to load it, but we'll play it safe. + if ((advapi32_module = LoadLibrary(_T("advapi32"))) != NULL) { + g_RegisterServiceCtrlHandlerEx = + (REGSVC_EX_FN)GetProcAddress(advapi32_module, + "RegisterServiceCtrlHandlerExW"); + // If we found it, go ahead and increase our number of services supported + if (g_RegisterServiceCtrlHandlerEx != NULL) { + g_maxServices = MAX_SERVICES; + } + } } *************** *** 796,806 **** // else no instance - an error has already been reported. if (!bServiceDebug) ! // Note - we upgraded this to the win2k only "Ex" function. ! // If this was a problem for someone, you could do a LoadLibrary ! // RegisterServiceCtrlHandlerEx(), and if that fails, fallback to ! // RegisterServiceCtrlHandler(), manually passing the first entry ! // of our PY_SERVICE_TABLE_ENTRY table. You would also need to ! // insist that only 1 service is being hosted. ! pe->sshStatusHandle = RegisterServiceCtrlHandlerEx( lpszArgv[0], service_ctrl_ex, pe); } // No instance - we can't start. --- 849,861 ---- // else no instance - an error has already been reported. if (!bServiceDebug) ! if (g_RegisterServiceCtrlHandlerEx) { ! // Use 2K/XP extended registration if available ! pe->sshStatusHandle = g_RegisterServiceCtrlHandlerEx(lpszArgv[0], ! service_ctrl_ex, pe); ! } else { ! // Otherwise fall back to NT ! pe->sshStatusHandle = RegisterServiceCtrlHandler(lpszArgv[0], ! service_ctrl); ! } } // No instance - we can't start. *************** *** 840,852 **** // The service control handler - receives async notifications from the ! // SCM, and delegates to the Python instance. ! DWORD WINAPI service_ctrl_ex( ! DWORD dwCtrlCode, // requested control code ! DWORD dwEventType, // event type ! LPVOID lpEventData, // event data ! LPVOID lpContext // user-defined context data ! ) { - PY_SERVICE_TABLE_ENTRY *pse = (PY_SERVICE_TABLE_ENTRY *)lpContext; if (pse->obServiceCtrlHandler==NULL) { // Python is in error. if (!bServiceDebug) --- 895,905 ---- // The service control handler - receives async notifications from the ! // SCM, and delegates to the Python instance. One of service_ctrl ! // or service_ctrl_ex are used as entry points depending on whether ! // we are running on NT or 2K/XP. ! ! DWORD WINAPI dispatchServiceCtrl(DWORD dwCtrlCode, ! PY_SERVICE_TABLE_ENTRY *pse) { if (pse->obServiceCtrlHandler==NULL) { // Python is in error. if (!bServiceDebug) *************** *** 872,875 **** --- 925,946 ---- } + DWORD WINAPI service_ctrl_ex( + DWORD dwCtrlCode, // requested control code + DWORD dwEventType, // event type + LPVOID lpEventData, // event data + LPVOID lpContext // user-defined context data + ) + { + PY_SERVICE_TABLE_ENTRY *pse = (PY_SERVICE_TABLE_ENTRY *)lpContext; + return dispatchServiceCtrl(dwCtrlCode, pse); + } + + VOID WINAPI service_ctrl( + DWORD dwCtrlCode // requested control code + ) + { + dispatchServiceCtrl(dwCtrlCode, &PythonServiceTable[0]); + } + // When debugging, a console event handler that simulates a service |
From: Mark H. <mha...@us...> - 2004-10-09 05:53:46
|
Update of /cvsroot/pywin32/pywin32/Pythonwin/pywin/debugger In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12624 Modified Files: debugger.py Log Message: Try and reduce the symptons of an MFC bug that causes thousands of registry entries when saving a toolbar state multiple times. Index: debugger.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/debugger/debugger.py,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** debugger.py 7 Sep 2004 02:23:49 -0000 1.13 --- debugger.py 9 Oct 2004 05:53:33 -0000 1.14 *************** *** 459,463 **** frame = win32ui.GetMainFrame() ! frame.SaveBarState("ToolbarDebugging") # Hide the debuger toolbars (as they wont normally form part of the main toolbar state. for id, klass, float in DebuggerDialogInfos: --- 459,467 ---- frame = win32ui.GetMainFrame() ! # See bug [ 944506 ] PythonWin Menus don't work ! # This relieves most of the symptoms, but I'd love ! # to know what is going on. Sounds alot like ! # Q151446, but that is for MFC4, and doesn't fix it. ! # frame.SaveBarState("ToolbarDebugging") # Hide the debuger toolbars (as they wont normally form part of the main toolbar state. for id, klass, float in DebuggerDialogInfos: |
From: Mark H. <mha...@us...> - 2004-10-09 02:44:24
|
Update of /cvsroot/pywin32/pywin32 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12295 Modified Files: pywin32_postinstall.py Log Message: Try and get the correct group to install shortcuts from the registry Print a big warning if we can't find the correct MFC DLL for Pythonwin. Index: pywin32_postinstall.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/pywin32_postinstall.py,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** pywin32_postinstall.py 8 Oct 2004 23:15:56 -0000 1.15 --- pywin32_postinstall.py 9 Oct 2004 02:44:03 -0000 1.16 *************** *** 268,273 **** fldr = get_special_folder_path("CSIDL_PROGRAMS") ! vi = sys.version_info ! fldr = os.path.join(fldr, "Python %d.%d" % (vi[0], vi[1])) if not os.path.isdir(fldr): os.mkdir(fldr) --- 268,278 ---- fldr = get_special_folder_path("CSIDL_PROGRAMS") ! try: ! install_group = _winreg.QueryValue(get_root_hkey(), ! root_key_name + "\\InstallPath\\InstallGroup") ! except OSError: ! vi = sys.version_info ! install_group = "Python %d.%d" % (vi[0], vi[1]) ! fldr = os.path.join(fldr, install_group) if not os.path.isdir(fldr): os.mkdir(fldr) *************** *** 290,293 **** --- 295,317 ---- print details + # Check the MFC dll exists - it is doesn't, point them at it + # (I should install it, but its a bit tricky with distutils) + # Unfortunately, this is quite likely on Windows XP and MFC71.dll + if sys.hexversion < 0x2040000: + mfc_dll = "mfc42.dll" + else: + mfc_dll = "mfc71.dll" + try: + win32api.SearchPath(None, mfc_dll) + except win32api.error: + print "*" * 20, "WARNING", "*" * 20 + print "It appears that the MFC DLL '%s' is not installed" % (mfc_dll,) + print "Pythonwin will not work without this DLL, and I haven't had the" + print "time to package it in with the installer." + print + print "You can download this DLL from:" + print "http://starship.python.net/crew/mhammond/win32/" + print "*" * 50 + print "The pywin32 extensions were successfully installed." |