pywin32-checkins Mailing List for Python for Windows Extensions (Page 73)
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: Roger U. <ru...@us...> - 2008-08-09 16:46:59
|
Update of /cvsroot/pywin32/pywin32/Pythonwin/pywin/idle In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8819/idle Modified Files: AutoExpand.py AutoIndent.py CallTips.py FormatParagraph.py IdleHistory.py PyParse.py Log Message: Replace use of string module with string methods Index: FormatParagraph.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/idle/FormatParagraph.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** FormatParagraph.py 13 Aug 2000 13:20:20 -0000 1.1 --- FormatParagraph.py 9 Aug 2008 16:47:07 -0000 1.2 *************** *** 51,62 **** if comment_header: # Reformat the comment lines - convert to text sans header. ! lines = string.split(data, "\n") lines = map(lambda st, l=len(comment_header): st[l:], lines) ! data = string.join(lines, "\n") # Reformat to 70 chars or a 20 char width, whichever is greater. format_width = max(70-len(comment_header), 20) newdata = reformat_paragraph(data, format_width) # re-split and re-insert the comment header. ! newdata = string.split(newdata, "\n") # If the block ends in a \n, we dont want the comment # prefix inserted after it. (Im not sure it makes sense to --- 51,62 ---- if comment_header: # Reformat the comment lines - convert to text sans header. ! lines = data.split("\n") lines = map(lambda st, l=len(comment_header): st[l:], lines) ! data = "\n".join(lines) # Reformat to 70 chars or a 20 char width, whichever is greater. format_width = max(70-len(comment_header), 20) newdata = reformat_paragraph(data, format_width) # re-split and re-insert the comment header. ! newdata = newdata.split("\n") # If the block ends in a \n, we dont want the comment # prefix inserted after it. (Im not sure it makes sense to *************** *** 69,73 **** newdata = newdata[:-1] builder = lambda item, prefix=comment_header: prefix+item ! newdata = string.join(map(builder, newdata), '\n') + block_suffix else: # Just a normal text format --- 69,73 ---- newdata = newdata[:-1] builder = lambda item, prefix=comment_header: prefix+item ! newdata = '\n'.join([builder(d) for d in newdata]) + block_suffix else: # Just a normal text format *************** *** 85,89 **** def find_paragraph(text, mark): ! lineno, col = map(int, string.split(mark, ".")) line = text.get("%d.0" % lineno, "%d.0 lineend" % lineno) while text.compare("%d.0" % lineno, "<", "end") and is_all_white(line): --- 85,89 ---- def find_paragraph(text, mark): ! lineno, col = list(map(int, mark.split("."))) line = text.get("%d.0" % lineno, "%d.0 lineend" % lineno) while text.compare("%d.0" % lineno, "<", "end") and is_all_white(line): *************** *** 110,114 **** def reformat_paragraph(data, limit=70): ! lines = string.split(data, "\n") i = 0 n = len(lines) --- 110,114 ---- def reformat_paragraph(data, limit=70): ! lines = data.split("\n") i = 0 n = len(lines) *************** *** 131,137 **** if not word: continue # Can happen when line ends in whitespace ! if len(string.expandtabs(partial + word)) > limit and \ partial != indent1: ! new.append(string.rstrip(partial)) partial = indent2 partial = partial + word + " " --- 131,137 ---- if not word: continue # Can happen when line ends in whitespace ! if len((partial + word).expandtabs()) > limit and \ partial != indent1: ! new.append(partial.rstrip()) partial = indent2 partial = partial + word + " " *************** *** 139,146 **** partial = partial + " " i = i+1 ! new.append(string.rstrip(partial)) # XXX Should reformat remaining paragraphs as well new.extend(lines[i:]) ! return string.join(new, "\n") def is_all_white(line): --- 139,146 ---- partial = partial + " " i = i+1 ! new.append(partial.rstrip()) # XXX Should reformat remaining paragraphs as well new.extend(lines[i:]) ! return "\n".join(new) def is_all_white(line): Index: AutoExpand.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/idle/AutoExpand.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** AutoExpand.py 1 Sep 1999 23:33:51 -0000 1.1 --- AutoExpand.py 9 Aug 2008 16:47:07 -0000 1.2 *************** *** 22,26 **** ] ! wordchars = string.letters + string.digits + "_" def __init__(self, editwin): --- 22,26 ---- ] ! wordchars = string.ascii_letters + string.digits + "_" def __init__(self, editwin): Index: CallTips.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/idle/CallTips.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** CallTips.py 22 Feb 2008 04:05:26 -0000 1.2 --- CallTips.py 9 Aug 2008 16:47:07 -0000 1.3 *************** *** 77,81 **** def get_object_at_cursor(self, ! wordchars="._" + string.uppercase + string.lowercase + string.digits): # XXX - This needs to be moved to a better place # so the "." attribute lookup code can also use it. --- 77,81 ---- def get_object_at_cursor(self, ! wordchars="._" + string.ascii_uppercase + string.ascii_lowercase + string.digits): # XXX - This needs to be moved to a better place # so the "." attribute lookup code can also use it. *************** *** 139,143 **** if fob.func_code.co_flags & 0x8: items.append("***") ! argText = string.join(items , ", ") argText = "(%s)" % argText except: --- 139,143 ---- if fob.func_code.co_flags & 0x8: items.append("***") ! argText = ", ".join(items) argText = "(%s)" % argText except: Index: AutoIndent.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/idle/AutoIndent.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** AutoIndent.py 27 Feb 2006 11:07:09 -0000 1.2 --- AutoIndent.py 9 Aug 2008 16:47:07 -0000 1.3 *************** *** 1,3 **** - import string #from Tkinter import TclError #import tkMessageBox --- 1,2 ---- *************** *** 169,174 **** # Ick. It may require *inserting* spaces if we back up over a # tab character! This is written to be clear, not fast. ! expand, tabwidth = string.expandtabs, self.tabwidth ! have = len(expand(chars, tabwidth)) assert have > 0 want = int((have - 1) / self.indentwidth) * self.indentwidth --- 168,172 ---- # Ick. It may require *inserting* spaces if we back up over a # tab character! This is written to be clear, not fast. ! have = len(chars.expandtabs(self.tabwidth)) assert have > 0 want = int((have - 1) / self.indentwidth) * self.indentwidth *************** *** 177,181 **** chars = chars[:-1] ncharsdeleted = ncharsdeleted + 1 ! have = len(expand(chars, tabwidth)) if have <= want or chars[-1] not in " \t": break --- 175,179 ---- chars = chars[:-1] ncharsdeleted = ncharsdeleted + 1 ! have = len(chars.expandtabs(self.tabwidth)) if have <= want or chars[-1] not in " \t": break *************** *** 211,216 **** pad = '\t' else: ! effective = len(string.expandtabs(prefix, ! self.tabwidth)) n = self.indentwidth pad = ' ' * (n - effective % n) --- 209,213 ---- pad = '\t' else: ! effective = len(prefix.expandtabs(self.tabwidth)) n = self.indentwidth pad = ' ' * (n - effective % n) *************** *** 377,381 **** tabwidth = self._asktabwidth() for pos in range(len(lines)): ! lines[pos] = string.expandtabs(lines[pos], tabwidth) self.set_region(head, tail, chars, lines) --- 374,378 ---- tabwidth = self._asktabwidth() for pos in range(len(lines)): ! lines[pos] = lines[pos].expandtabs(tabwidth) self.set_region(head, tail, chars, lines) *************** *** 418,427 **** tail = text.index("insert lineend +1c") chars = text.get(head, tail) ! lines = string.split(chars, "\n") return head, tail, chars, lines def set_region(self, head, tail, chars, lines): text = self.text ! newchars = string.join(lines, "\n") if newchars == chars: text.bell() --- 415,424 ---- tail = text.index("insert lineend +1c") chars = text.get(head, tail) ! lines = chars.split("\n") return head, tail, chars, lines def set_region(self, head, tail, chars, lines): text = self.text ! newchars = "\n".join(lines) if newchars == chars: text.bell() Index: PyParse.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/idle/PyParse.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** PyParse.py 2 Jun 2002 00:28:00 -0000 1.4 --- PyParse.py 9 Aug 2008 16:47:07 -0000 1.5 *************** *** 13,17 **** if 0: # for throwaway debugging output def dump(*stuff): ! sys.__stdout__.write(string.join(map(str, stuff), " ") + "\n") # Find what looks like the start of a popular stmt. --- 13,17 ---- if 0: # for throwaway debugging output def dump(*stuff): ! sys.__stdout__.write(" ".join(map(str, stuff)) + "\n") # Find what looks like the start of a popular stmt. *************** *** 108,112 **** for ch in "\"'\\\n#": _tran[ord(ch)] = ch ! _tran = string.join(_tran, '') del ch --- 108,112 ---- for ch in "\"'\\\n#": _tran[ord(ch)] = ch ! _tran = ''.join(_tran) del ch *************** *** 152,163 **** # Python 1.5.2 (#0, Apr 13 1999, ... ! def find_good_parse_start(self, use_ps1, is_char_in_string=None, ! _rfind=string.rfind, ! _synchre=_synchre): str, pos = self.str, None if use_ps1: # shell window ps1 = '\n' + sys.ps1 ! i = _rfind(str, ps1) if i >= 0: pos = i + len(ps1) --- 152,161 ---- # Python 1.5.2 (#0, Apr 13 1999, ... ! def find_good_parse_start(self, use_ps1, is_char_in_string=None): str, pos = self.str, None if use_ps1: # shell window ps1 = '\n' + sys.ps1 ! i = str.rfind(ps1) if i >= 0: pos = i + len(ps1) *************** *** 178,185 **** limit = len(str) for tries in range(5): ! i = _rfind(str, ":\n", 0, limit) if i < 0: break ! i = _rfind(str, '\n', 0, i) + 1 # start of colon line m = _synchre(str, i, limit) if m and not is_char_in_string(m.start()): --- 176,183 ---- limit = len(str) for tries in range(5): ! i = str.rfind(":\n", 0, limit) if i < 0: break ! i = str.rfind('\n', 0, i) + 1 # start of colon line m = _synchre(str, i, limit) if m and not is_char_in_string(m.start()): *************** *** 226,230 **** # Creates self.{goodlines, continuation}. ! def _study1(self, _replace=string.replace, _find=string.find): if self.study_level >= 1: return --- 224,228 ---- # Creates self.{goodlines, continuation}. ! def _study1(self): if self.study_level >= 1: return *************** *** 236,245 **** # by a factor of 10-40, and so greatly speed the following loop. str = self.str ! str = string.translate(str, _tran) ! str = _replace(str, 'xxxxxxxx', 'x') ! str = _replace(str, 'xxxx', 'x') ! str = _replace(str, 'xx', 'x') ! str = _replace(str, 'xx', 'x') ! str = _replace(str, '\nx', '\n') # note that replacing x\n with \n would be incorrect, because # x may be preceded by a backslash --- 234,243 ---- # by a factor of 10-40, and so greatly speed the following loop. str = self.str ! str = str.translate(_tran) ! str = str.replace('xxxxxxxx', 'x') ! str = str.replace('xxxx', 'x') ! str = str.replace('xx', 'x') ! str = str.replace('xx', 'x') ! str = str.replace('\nx', '\n') # note that replacing x\n with \n would be incorrect, because # x may be preceded by a backslash *************** *** 322,326 **** if ch == '#': # consume the comment ! i = _find(str, '\n', i) assert i >= 0 continue --- 320,324 ---- if ch == '#': # consume the comment ! i = str.find('\n', i) assert i >= 0 continue *************** *** 363,368 **** # if continuation is C_BRACKET, index of last open bracket ! def _study2(self, _rfind=string.rfind, _find=string.find, ! _ws=string.whitespace): if self.study_level >= 2: return --- 361,366 ---- # if continuation is C_BRACKET, index of last open bracket ! def _study2(self): ! _ws=string.whitespace if self.study_level >= 2: return *************** *** 381,385 **** for nothing in range(goodlines[i-1], goodlines[i]): # tricky: sets p to 0 if no preceding newline ! p = _rfind(str, '\n', 0, p-1) + 1 # The stmt str[p:q] isn't a continuation, but may be blank # or a non-indenting comment line. --- 379,383 ---- for nothing in range(goodlines[i-1], goodlines[i]): # tricky: sets p to 0 if no preceding newline ! p = str.rfind('\n', 0, p-1) + 1 # The stmt str[p:q] isn't a continuation, but may be blank # or a non-indenting comment line. *************** *** 444,448 **** if ch == '#': # consume comment and trailing newline ! p = _find(str, '\n', p, q) + 1 assert p > 0 continue --- 442,446 ---- if ch == '#': # consume comment and trailing newline ! p = str.find('\n', p, q) + 1 assert p > 0 continue *************** *** 465,469 **** # of spaces the next line should be indented. ! def compute_bracket_indent(self, _find=string.find): self._study2() assert self.continuation == C_BRACKET --- 463,467 ---- # of spaces the next line should be indented. ! def compute_bracket_indent(self): self._study2() assert self.continuation == C_BRACKET *************** *** 471,475 **** str = self.str n = len(str) ! origi = i = string.rfind(str, '\n', 0, j) + 1 j = j+1 # one beyond open bracket # find first list item; set i to start of its line --- 469,473 ---- str = self.str n = len(str) ! origi = i = str.rfind('\n', 0, j) + 1 j = j+1 # one beyond open bracket # find first list item; set i to start of its line *************** *** 482,486 **** else: # this line is junk; advance to next line ! i = j = _find(str, '\n', j) + 1 else: # nothing interesting follows the bracket; --- 480,484 ---- else: # this line is junk; advance to next line ! i = j = str.find('\n', j) + 1 else: # nothing interesting follows the bracket; *************** *** 490,495 **** j = j+1 extra = self.indentwidth ! return len(string.expandtabs(str[i:j], ! self.tabwidth)) + extra # Return number of physical lines in last stmt (whether or not --- 488,492 ---- j = j+1 extra = self.indentwidth ! return len(str[i:j].expandtabs(self.tabwidth)) + extra # Return number of physical lines in last stmt (whether or not *************** *** 517,521 **** # See whether the initial line starts an assignment stmt; i.e., # look for an = operator ! endpos = string.find(str, '\n', startpos) + 1 found = level = 0 while i < endpos: --- 514,518 ---- # See whether the initial line starts an assignment stmt; i.e., # look for an = operator ! endpos = str.find('\n', startpos) + 1 found = level = 0 while i < endpos: *************** *** 553,559 **** i = i+1 ! return len(string.expandtabs(str[self.stmt_start : ! i], ! self.tabwidth)) + 1 # Return the leading whitespace on the initial line of the last --- 550,554 ---- i = i+1 ! return len(str[self.stmt_start : i].expandtabs(self.tabwidth)) + 1 # Return the leading whitespace on the initial line of the last Index: IdleHistory.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/idle/IdleHistory.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** IdleHistory.py 13 Aug 2000 13:20:20 -0000 1.1 --- IdleHistory.py 9 Aug 2008 16:47:07 -0000 1.2 *************** *** 23,31 **** # Get source code from start index to end index. Lines in the # text control may be separated by sys.ps2 . ! lines = string.split(self.text.get(start, end), self.output_sep) ! return string.join(lines, "\n") def _put_source(self, where, source): ! output = string.join(string.split(source, "\n"), self.output_sep) self.text.insert(where, output) --- 23,31 ---- # Get source code from start index to end index. Lines in the # text control may be separated by sys.ps2 . ! lines = self.text.get(start, end).split(self.output_sep) ! return "\n".join(lines) def _put_source(self, where, source): ! output = self.output_sep.join(source.split("\n")) self.text.insert(where, output) *************** *** 69,73 **** def history_store(self, source): ! source = string.strip(source) if len(source) > 2: # avoid duplicates --- 69,73 ---- def history_store(self, source): ! source = source.strip() if len(source) > 2: # avoid duplicates *************** *** 81,85 **** def recall(self, s): ! s = string.strip(s) self.text.tag_remove("sel", "1.0", "end") self.text.delete("iomark", "end-1c") --- 81,85 ---- def recall(self, s): ! s = s.strip() self.text.tag_remove("sel", "1.0", "end") self.text.delete("iomark", "end-1c") |
From: Roger U. <ru...@us...> - 2008-08-09 16:46:58
|
Update of /cvsroot/pywin32/pywin32/Pythonwin/pywin/debugger In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8819/debugger Modified Files: debugger.py Log Message: Replace use of string module with string methods Index: debugger.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/debugger/debugger.py,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** debugger.py 20 Feb 2008 22:35:45 -0000 1.16 --- debugger.py 9 Aug 2008 16:47:07 -0000 1.17 *************** *** 256,260 **** key = msg[2] # If someone starts typing, they probably are trying to edit the text! ! if chr(key) in string.uppercase: self.EditSelected() return 0 --- 256,260 ---- key = msg[2] # If someone starts typing, they probably are trying to edit the text! ! if chr(key) in string.ascii_uppercase: self.EditSelected() return 0 *************** *** 308,312 **** for bp in bplist: if id(bp)==item_id: ! if string.lower(string.strip(text))=="none": text = None bp.cond = text --- 308,312 ---- for bp in bplist: if id(bp)==item_id: ! if text.strip().lower()=="none": text = None bp.cond = text *************** *** 347,351 **** def CreateWindow(self, parent): DebuggerListViewWindow.CreateWindow(self, parent) ! items = string.split(win32ui.GetProfileVal("Debugger Windows\\" + self.title, "Items", ""), "\t") index = -1 for item in items: --- 347,351 ---- def CreateWindow(self, parent): DebuggerListViewWindow.CreateWindow(self, parent) ! items = win32ui.GetProfileVal("Debugger Windows\\" + self.title, "Items", "").split("\t") index = -1 for item in items: *************** *** 358,362 **** for i in range(self.GetItemCount()-1): items.append(self.GetItemText(i,0)) ! win32ui.WriteProfileVal("Debugger Windows\\" + self.title, "Items", string.join(items,"\t")) return 1 --- 358,362 ---- for i in range(self.GetItemCount()-1): items.append(self.GetItemText(i,0)) ! win32ui.WriteProfileVal("Debugger Windows\\" + self.title, "Items", "\t".join(items)) return 1 *************** *** 399,403 **** except: t, v, tb = sys.exc_info() ! val = string.strip(traceback.format_exception_only(t, v)[0]) tb = None # prevent a cycle. self.SetItemText(i, 1, val) --- 399,403 ---- except: t, v, tb = sys.exc_info() ! val = traceback.format_exception_only(t, v)[0].strip() tb = None # prevent a cycle. self.SetItemText(i, 1, val) *************** *** 536,540 **** self.close() def canonic(self, fname): ! return string.lower(os.path.abspath(fname)) def reset(self): debugger_parent.reset(self) --- 536,540 ---- self.close() def canonic(self, fname): ! return os.path.abspath(fname).lower() def reset(self): debugger_parent.reset(self) *************** *** 950,954 **** import linecache line = linecache.getline(filename, lineno) ! print "%s(%d): %s" % (os.path.basename(filename), lineno, string.expandtabs(line[:-1],4)) return 0 --- 950,954 ---- import linecache line = linecache.getline(filename, lineno) ! print "%s(%d): %s" % (os.path.basename(filename), lineno, line[:-1].expandtabs(4)) return 0 |
From: Roger U. <ru...@us...> - 2008-08-09 16:46:33
|
Update of /cvsroot/pywin32/pywin32/Pythonwin/pywin/Demos/app In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8780/app Modified Files: basictimerapp.py customprint.py Log Message: Replace use of string module with string methods Index: customprint.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/Demos/app/customprint.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** customprint.py 28 Oct 1999 02:11:23 -0000 1.2 --- customprint.py 9 Aug 2008 16:46:40 -0000 1.3 *************** *** 175,179 **** strMag = self.magCtl.GetWindowText() try: ! self['mag'] = string.atoi(strMag) except: pass --- 175,179 ---- strMag = self.magCtl.GetWindowText() try: ! self['mag'] = int(strMag) except: pass Index: basictimerapp.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/Demos/app/basictimerapp.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** basictimerapp.py 10 Dec 2006 21:51:10 -0000 1.3 --- basictimerapp.py 9 Aug 2008 16:46:40 -0000 1.4 *************** *** 85,89 **** sys.stderr = self.oldErr def write(self, str): ! s = string.strip(str) if len(s): if self.bHaveSetPrompt1: --- 85,89 ---- sys.stderr = self.oldErr def write(self, str): ! s = str.strip() if len(s): if self.bHaveSetPrompt1: |
From: Roger U. <ru...@us...> - 2008-08-09 16:46:33
|
Update of /cvsroot/pywin32/pywin32/Pythonwin/pywin/Demos In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8780 Modified Files: dibdemo.py Log Message: Replace use of string module with string methods Index: dibdemo.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/Demos/dibdemo.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** dibdemo.py 1 Sep 1999 23:33:35 -0000 1.1 --- dibdemo.py 9 Aug 2008 16:46:41 -0000 1.2 *************** *** 42,48 **** raise "Failed" # check magic? ! rowcollist=string.split(f.readline()) ! cols=string.atoi(rowcollist[0]) ! rows=string.atoi(rowcollist[1]) f.readline() # whats this one? dib.LoadPBMData(f,(cols,rows)) --- 42,48 ---- raise "Failed" # check magic? ! rowcollist=f.readline().split() ! cols=int(rowcollist[0]) ! rows=int(rowcollist[1]) f.readline() # whats this one? dib.LoadPBMData(f,(cols,rows)) |
Update of /cvsroot/pywin32/pywin32/com/win32comext/shell/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7746/com/win32comext/shell/src Modified Files: PyIContextMenu.h shell.cpp Added Files: PyIContextMenu2.cpp PyIContextMenu2.h PyIContextMenu3.cpp PyIContextMenu3.h Log Message: win32com.shell gets support for IContextMenu2 and IContextMenu3 Index: shell.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/shell/src/shell.cpp,v retrieving revision 1.66 retrieving revision 1.67 diff -C2 -d -r1.66 -r1.67 *** shell.cpp 27 Jul 2008 13:01:18 -0000 1.66 --- shell.cpp 9 Aug 2008 01:53:01 -0000 1.67 *************** *** 22,25 **** --- 22,27 ---- #include "PyICategoryProvider.h" #include "PyIContextMenu.h" + #include "PyIContextMenu2.h" + #include "PyIContextMenu3.h" #include "PyIDefaultExtractIconInit.h" #include "PyIExtractIcon.h" *************** *** 3255,3258 **** --- 3257,3262 ---- PYCOM_INTERFACE_FULL(AsyncOperation), PYCOM_INTERFACE_FULL(ContextMenu), + PYCOM_INTERFACE_SERVER_ONLY(ContextMenu2), + PYCOM_INTERFACE_SERVER_ONLY(ContextMenu3), PYCOM_INTERFACE_FULL(ExtractIcon), PYCOM_INTERFACE_FULL(ExtractIconW), Index: PyIContextMenu.h =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/shell/src/PyIContextMenu.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** PyIContextMenu.h 24 May 2007 06:01:05 -0000 1.2 --- PyIContextMenu.h 9 Aug 2008 01:53:01 -0000 1.3 *************** *** 4,7 **** --- 4,8 ---- // // Interface Declaration + #pragma once class PyIContextMenu : public PyIUnknown --- NEW FILE: PyIContextMenu3.cpp --- // This file implements the IContextMenu Interface and Gateway for Python. // Generated by makegw.py #include "shell_pch.h" #include "PyIContextMenu3.h" // @doc - This file contains autoduck documentation // --------------------------------------------------- // // Gateway Implementation STDMETHODIMP PyGContextMenu3::QueryContextMenu(HMENU hmenu, UINT indexMenu, UINT idCmdFirst, UINT idCmdLast, UINT uFlags) { return PyGContextMenu2::QueryContextMenu(hmenu, indexMenu, idCmdFirst, idCmdLast, uFlags); } STDMETHODIMP PyGContextMenu3::InvokeCommand(CMINVOKECOMMANDINFO * lpici) { return PyGContextMenu2::InvokeCommand(lpici); } STDMETHODIMP PyGContextMenu3::GetCommandString( UINT_PTR idCmd, UINT uType, UINT __RPC_FAR * pwReserved, LPSTR pszName, UINT cchMax) { return PyGContextMenu2::GetCommandString(idCmd, uType, pwReserved, pszName, cchMax); } STDMETHODIMP PyGContextMenu3::HandleMenuMsg( UINT uMsg, WPARAM wParam, LPARAM lParam) { return PyGContextMenu2::HandleMenuMsg(uMsg, wParam, lParam); } STDMETHODIMP PyGContextMenu3::HandleMenuMsg2( UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT *lpResult) { PY_GATEWAY_METHOD; PyObject *ret; HRESULT hr=InvokeViaPolicy("HandleMenuMsg2", &ret, "INN", uMsg, PyWinObject_FromPARAM(wParam), PyWinObject_FromPARAM(lParam)); if (FAILED(hr)) return hr; if (lpResult) { if (ret == Py_None) *lpResult = FALSE; else { PyWinObject_AsPARAM(ret, (WPARAM *)lpResult); hr = PyCom_SetAndLogCOMErrorFromPyException("HandleMenuMsg2", IID_IContextMenu3); } } Py_DECREF(ret); return hr; } --- NEW FILE: PyIContextMenu3.h --- // This file declares the IContextMenu Interface and Gateway for Python. // Generated by makegw.py // --------------------------------------------------- // --------------------------------------------------- // // Gateway Declaration #include "PyIContextMenu2.h" class PyGContextMenu3 : public PyGContextMenu2, public IContextMenu3 { protected: PyGContextMenu3(PyObject *instance) : PyGContextMenu2(instance) { ; } PYGATEWAY_MAKE_SUPPORT2(PyGContextMenu3, IContextMenu3, IID_IContextMenu3, PyGContextMenu2) // IContextMenu STDMETHOD(QueryContextMenu)( HMENU hmenu, UINT indexMenu, UINT idCmdFirst, UINT idCmdLast, UINT uFlags); STDMETHOD(InvokeCommand)( CMINVOKECOMMANDINFO __RPC_FAR * lpici); STDMETHOD(GetCommandString)( UINT_PTR idCmd, UINT uType, UINT __RPC_FAR * pwReserved, LPSTR pszName, UINT cchMax); // IContextMenu2 STDMETHOD(HandleMenuMsg)( UINT uMsg, WPARAM wParam, LPARAM lParam); // IContextMenu3 STDMETHOD(HandleMenuMsg2)( UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT *plResult); }; --- NEW FILE: PyIContextMenu2.cpp --- // This file implements the IContextMenu Interface and Gateway for Python. // Generated by makegw.py #include "shell_pch.h" #include "PyIContextMenu2.h" // @doc - This file contains autoduck documentation // --------------------------------------------------- // // Gateway Implementation STDMETHODIMP PyGContextMenu2::QueryContextMenu(HMENU hmenu, UINT indexMenu, UINT idCmdFirst, UINT idCmdLast, UINT uFlags) { return PyGContextMenu::QueryContextMenu(hmenu, indexMenu, idCmdFirst, idCmdLast, uFlags); } STDMETHODIMP PyGContextMenu2::InvokeCommand(CMINVOKECOMMANDINFO * lpici) { return PyGContextMenu::InvokeCommand(lpici); } STDMETHODIMP PyGContextMenu2::GetCommandString( UINT_PTR idCmd, UINT uType, UINT __RPC_FAR * pwReserved, LPSTR pszName, UINT cchMax) { return PyGContextMenu::GetCommandString(idCmd, uType, pwReserved, pszName, cchMax); } STDMETHODIMP PyGContextMenu2::HandleMenuMsg( UINT uMsg, WPARAM wParam, LPARAM lParam) { PY_GATEWAY_METHOD; PyObject *ret; HRESULT hr=InvokeViaPolicy("HandleMenuMsg", NULL, "INN", uMsg, PyWinObject_FromPARAM(wParam), PyWinObject_FromPARAM(lParam)); if (FAILED(hr)) return hr; return S_OK; } --- NEW FILE: PyIContextMenu2.h --- // This file declares the IContextMenu Interface and Gateway for Python. // Generated by makegw.py // --------------------------------------------------- // --------------------------------------------------- // // Gateway Declaration #pragma once #include "PyIContextMenu.h" class PyGContextMenu2 : public PyGContextMenu, public IContextMenu2 { protected: PyGContextMenu2(PyObject *instance) : PyGContextMenu(instance) { ; } PYGATEWAY_MAKE_SUPPORT2(PyGContextMenu2, IContextMenu2, IID_IContextMenu2, PyGContextMenu) // IContextMenu STDMETHOD(QueryContextMenu)( HMENU hmenu, UINT indexMenu, UINT idCmdFirst, UINT idCmdLast, UINT uFlags); STDMETHOD(InvokeCommand)( CMINVOKECOMMANDINFO __RPC_FAR * lpici); STDMETHOD(GetCommandString)( UINT_PTR idCmd, UINT uType, UINT __RPC_FAR * pwReserved, LPSTR pszName, UINT cchMax); // IContextMenu2 STDMETHOD(HandleMenuMsg)( UINT uMsg, WPARAM wParam, LPARAM lParam); }; |
From: Mark H. <mha...@us...> - 2008-08-09 01:52:52
|
Update of /cvsroot/pywin32/pywin32 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7746 Modified Files: setup.py CHANGES.txt Log Message: win32com.shell gets support for IContextMenu2 and IContextMenu3 Index: setup.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/setup.py,v retrieving revision 1.80 retrieving revision 1.81 diff -C2 -d -r1.80 -r1.81 *** setup.py 9 Aug 2008 01:51:39 -0000 1.80 --- setup.py 9 Aug 2008 01:53:01 -0000 1.81 *************** *** 1506,1509 **** --- 1506,1511 ---- %(shell)s/PyIColumnProvider.cpp %(shell)s/PyIContextMenu.cpp + %(shell)s/PyIContextMenu2.cpp + %(shell)s/PyIContextMenu3.cpp %(shell)s/PyICopyHook.cpp %(shell)s/PyIDefaultExtractIconInit.cpp Index: CHANGES.txt =================================================================== RCS file: /cvsroot/pywin32/pywin32/CHANGES.txt,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** CHANGES.txt 9 Aug 2008 01:51:39 -0000 1.24 --- CHANGES.txt 9 Aug 2008 01:53:01 -0000 1.25 *************** *** 11,14 **** --- 11,16 ---- * MAPI gets support for IMAPIAdviseSink + * win32com.shell gets support for IContextMenu2 and IContextMenu3 + Since build 211: ---------------- |
From: Mark H. <mha...@us...> - 2008-08-09 01:51:31
|
Update of /cvsroot/pywin32/pywin32/com/win32comext/mapi/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7290/com/win32comext/mapi/src Modified Files: PyIMAPISession.i PyIMAPITable.i PyMAPIUtil.h mapi.i mapilib.i mapiutil.cpp Added Files: PyIMAPIAdviseSink.cpp PyIMAPIAdviseSink.h Log Message: Add support for IMAPIAdviseSink Index: mapiutil.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/mapi/src/mapiutil.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** mapiutil.cpp 18 Apr 2006 11:53:47 -0000 1.5 --- mapiutil.cpp 9 Aug 2008 01:51:39 -0000 1.6 *************** *** 54,57 **** --- 54,90 ---- } + PyObject *PyObject_FromMAPIERROR(MAPIERROR *e, BOOL bIsUnicode, BOOL free_buffer) + { + PyObject *obError; + if (e->lpszError) + obError = bIsUnicode ? PyWinObject_FromWCHAR((const WCHAR *)e->lpszError) : + PyString_FromString((const char *)e->lpszError); + + else { + obError = Py_None; + Py_INCREF(Py_None); + } + PyObject *obComp; + if (e->lpszComponent) + obComp = bIsUnicode ? PyWinObject_FromWCHAR((const WCHAR *)e->lpszComponent) : + PyString_FromString((const char *)e->lpszComponent); + else { + obComp = Py_None; + Py_INCREF(Py_None); + } + + PyObject *ret = Py_BuildValue("lOOll", + e->ulVersion, + obError, + obComp, + e->ulLowLevelError, + e->ulContext); + Py_XDECREF(obError); + Py_XDECREF(obComp); + if (free_buffer) + MAPIFreeBuffer(e); + return ret; + } + BOOL AllocMVBuffer(PyObject *seq, size_t itemSize, void *pAllocMoreLinkBlock, void **pbuf, ULONG *pLen) { *************** *** 489,492 **** --- 522,542 ---- } + PyObject *PyMAPIObject_FromSPropValueArray(SPropValue *pv, ULONG nvalues) + { + PyObject *ret = PyList_New(nvalues); + if (!ret) + return NULL; + ULONG i; + for (i=0;i<nvalues;i++) { + PyObject *sub = PyMAPIObject_FromSPropValue(pv+i); + if (!sub) { + Py_DECREF(ret); + return NULL; + } + PyList_SET_ITEM(ret, i, sub); + } + return ret; + } + // @object PySPropValueArray|A sequence of <o PySPropValue>, as passed to many MAPI functions. BOOL PyMAPIObject_AsSPropValueArray(PyObject *obs, SPropValue **ppv, ULONG *pcValues) --- NEW FILE: PyIMAPIAdviseSink.cpp --- // This file implements the IMAPIAdviseSink Interface and Gateway for Python. // Generated by makegw.py #include "PythonCOM.h" #include "PythonCOMServer.h" #include "mapidefs.h" #include "mapiguid.h" #include "PyMAPIUtil.h" #include "PyIMAPIAdviseSink.h" // @doc - This file contains autoduck documentation // --------------------------------------------------- // PyObject *PyObject_FromNOTIFICATION(NOTIFICATION *n) { PyObject *ret = NULL; switch (n->ulEventType) { case fnevCriticalError: { ERROR_NOTIFICATION &err(n->info.err); ret = Py_BuildValue("k(s#iiN)", n->ulEventType, err.lpEntryID, err.cbEntryID, err.scode, err.ulFlags, PyObject_FromMAPIERROR(err.lpMAPIError, err.ulFlags&MAPI_UNICODE, FALSE)); break; } case fnevExtended: { EXTENDED_NOTIFICATION &ext(n->info.ext); ret = Py_BuildValue("k(ks#)", n->ulEventType, ext.ulEvent, ext.pbEventParameters, ext.cb); break; } case fnevNewMail: { NEWMAIL_NOTIFICATION &newmail(n->info.newmail); PyObject *msg_class = newmail.ulFlags&MAPI_UNICODE? PyWinObject_FromWCHAR((const WCHAR *)newmail.lpszMessageClass) : PyString_FromString((const char *)newmail.lpszMessageClass); if (!msg_class) return NULL; ret = Py_BuildValue("k(s#s#kNk)", n->ulEventType, newmail.lpEntryID, newmail.cbEntryID, newmail.lpParentID, newmail.cbParentID, newmail.ulFlags, msg_class, newmail.ulMessageFlags); break; } case fnevObjectCopied: case fnevObjectCreated: case fnevObjectDeleted: case fnevObjectModified: case fnevObjectMoved: case fnevSearchComplete: { OBJECT_NOTIFICATION &obj(n->info.obj); PyObject *obArray = PyMAPIObject_FromSPropTagArray(obj.lpPropTagArray); if (!obArray) return NULL; ret = Py_BuildValue("k(s#is#s#s#N)", n->ulEventType, obj.lpEntryID, obj.cbEntryID, obj.ulObjType, obj.lpParentID, obj.cbParentID, obj.lpOldID, obj.cbOldID, obj.lpOldParentID, obj.cbOldParentID, obArray); break; } case fnevTableModified: { TABLE_NOTIFICATION &tab(n->info.tab); ret = Py_BuildValue("k(kiNNN)", n->ulEventType, tab.ulTableEvent, tab.hResult, PyMAPIObject_FromSPropValue(&tab.propIndex), PyMAPIObject_FromSPropValue(&tab.propPrior), PyMAPIObject_FromSRow(&tab.row)); break; } case fnevStatusObjectModified: { STATUS_OBJECT_NOTIFICATION &statobj(n->info.statobj); ret = Py_BuildValue("k(s#N)", n->ulEventType, statobj.lpEntryID, statobj.cbEntryID, PyMAPIObject_FromSPropValueArray(statobj.lpPropVals, statobj.cValues)); break; } default: { PyCom_LoggerWarning(NULL, "unknown MAPI notification type %x", n->ulEventType); ret = Py_BuildValue("k(O)", n->ulEventType, Py_None); break; } } return ret; } ULONG PyGMAPIAdviseSink::OnNotify(ULONG cNotif, LPNOTIFICATION lpNotifications ) { PY_GATEWAY_METHOD; PyObject *arg = PyList_New(cNotif); if (!arg) return MAKE_PYCOM_GATEWAY_FAILURE_CODE("OnNotify"); ULONG i; for (i=0;i<cNotif;i++) { PyObject *sub = PyObject_FromNOTIFICATION(lpNotifications+i); if (!sub) { Py_DECREF(arg); return MAKE_PYCOM_GATEWAY_FAILURE_CODE("OnNotify"); } PyList_SET_ITEM(arg, i, sub); } return InvokeViaPolicy("OnNotify", NULL, "(N)", arg); } Index: mapi.i =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/mapi/src/mapi.i,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** mapi.i 16 Mar 2006 11:20:55 -0000 1.7 --- mapi.i 9 Aug 2008 01:51:39 -0000 1.8 *************** *** 44,47 **** --- 44,48 ---- #include "PyIProfSect.h" #include "PyIMsgServiceAdmin.h" + #include "PyIMAPIAdviseSink.h" #include "MAPISPI.H" *************** *** 172,176 **** if ( PyCom_RegisterClientType(&PyIMsgServiceAdmin::type, &IID_IMsgServiceAdmin) != 0 ) return; ADD_IID(IID_IMsgServiceAdmin); ! ADD_IID(PS_PUBLIC_STRINGS); --- 173,179 ---- if ( PyCom_RegisterClientType(&PyIMsgServiceAdmin::type, &IID_IMsgServiceAdmin) != 0 ) return; ADD_IID(IID_IMsgServiceAdmin); ! ! if ( PyCom_RegisterGatewayObject(IID_IMAPIAdviseSink, GET_PYGATEWAY_CTOR(PyGMAPIAdviseSink), "IMAPIAdviseSink") != 0) return; ! ADD_IID(IID_IMAPIAdviseSink); ADD_IID(PS_PUBLIC_STRINGS); Index: mapilib.i =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/mapi/src/mapilib.i,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** mapilib.i 11 Feb 2006 03:47:02 -0000 1.3 --- mapilib.i 9 Aug 2008 01:51:39 -0000 1.4 *************** *** 469,497 **** %typemap(python,argout) MAPIERROR **OUTPUT { ! PyObject *obError; ! if ((*$source)->lpszError) ! obError = PyWinObject_FromTCHAR((*$source)->lpszError); ! else { ! obError = Py_None; ! Py_INCREF(Py_None); ! } ! PyObject *obComp; ! if ((*$source)->lpszComponent) ! obComp = PyWinObject_FromTCHAR((*$source)->lpszComponent); ! else { ! obComp = Py_None; ! Py_INCREF(Py_None); ! } ! ! Py_DECREF($target); ! $target = Py_BuildValue("lOOll", ! (*$source)->ulVersion, ! obError, ! obComp, ! (*$source)->ulLowLevelError, ! (*$source)->ulContext); ! Py_XDECREF(obError); ! Py_XDECREF(obComp); ! MAPIFreeBuffer(*$source); } --- 469,473 ---- %typemap(python,argout) MAPIERROR **OUTPUT { ! PyObject_FromMAPIERROR(*$source, TRUE, TRUE); } Index: PyMAPIUtil.h =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/mapi/src/PyMAPIUtil.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** PyMAPIUtil.h 21 Oct 2005 06:14:03 -0000 1.3 --- PyMAPIUtil.h 9 Aug 2008 01:51:39 -0000 1.4 *************** *** 8,11 **** --- 8,13 ---- PyObject *PyMAPIObject_FromTypedUnknown( ULONG typ, IUnknown *pUnk, BOOL bAddRef); + PyObject *PyObject_FromMAPIERROR(MAPIERROR *e, BOOL bIsUnicode, BOOL free_buffer); + /* Create (and free) a SBinaryArray from a PyObject */ BOOL PyMAPIObject_AsSBinaryArray(PyObject *ob, SBinaryArray *pv); *************** *** 17,22 **** PyObject *PyMAPIObject_FromSPropValue(SPropValue *pv); ! /* Create a PyObject from a SPropValue Array*/ BOOL PyMAPIObject_AsSPropValueArray(PyObject *ob, SPropValue **ppv, ULONG *pcValues); /* Create a PyObject from a SRow/SRowSet */ --- 19,26 ---- PyObject *PyMAPIObject_FromSPropValue(SPropValue *pv); ! /* Create a PyObject to/from a SPropValue Array*/ BOOL PyMAPIObject_AsSPropValueArray(PyObject *ob, SPropValue **ppv, ULONG *pcValues); + PyObject *PyMAPIObject_FromSPropValueArray(SPropValue *pv, ULONG nvalues); + /* Create a PyObject from a SRow/SRowSet */ --- NEW FILE: PyIMAPIAdviseSink.h --- // This file declares the IMAPIAdviseSink Gateway for Python. // ---------------------------------------------------------- // // Gateway Declaration class PyGMAPIAdviseSink : public PyGatewayBase, public IMAPIAdviseSink { protected: PyGMAPIAdviseSink(PyObject *instance) : PyGatewayBase(instance) { ; } PYGATEWAY_MAKE_SUPPORT2(PyGMAPIAdviseSink, IMAPIAdviseSink, IID_IMAPIAdviseSink, PyGatewayBase) // IMAPIAdviseSink MAPIMETHOD_(ULONG, OnNotify)(ULONG cNotif, LPNOTIFICATION lpNotifications); }; Index: PyIMAPISession.i =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/mapi/src/PyIMAPISession.i,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** PyIMAPISession.i 16 Jun 2003 05:01:11 -0000 1.2 --- PyIMAPISession.i 9 Aug 2008 01:51:39 -0000 1.3 *************** *** 149,152 **** --- 149,209 ---- %} + // @pyswig int|Advise| + // @rdesc The result is an integer which should be passed to + // <om PyIMAPISession.Unadvise> + %native(Advise) Advise; + %{ + PyObject *PyIMAPISession::Advise(PyObject *self, PyObject *args) + { + IMAPISession *_swig_self; + if ((_swig_self=GetI(self))==NULL) return NULL; + + // @pyparm string|entryId||The entryID of the object + // @pyparm int|mask|| + // @pyparm <o PyIMAPIAdviseSink>|sink|| + PyObject *obEntry, *obSink; + int mask; + if(!PyArg_ParseTuple(args,"OkO:Advise",&obEntry, &mask, &obSink)) + return NULL; + char *entryString; + Py_ssize_t entryStrLen; + if (obEntry==Py_None) { + entryString = NULL; + entryStrLen = 0; + } else if PyString_Check(obEntry) { + entryString = PyString_AsString(obEntry); + entryStrLen = PyString_Size(obEntry); + } else { + PyErr_SetString(PyExc_TypeError, "EntryID must be a string or None"); + return NULL; + } + IMAPIAdviseSink *psink = NULL; + if (!PyCom_InterfaceFromPyObject(obSink, IID_IMAPIAdviseSink, (void **)&psink, FALSE)) + return NULL; + unsigned long connection; + HRESULT _result; + PyObject *rc; + Py_BEGIN_ALLOW_THREADS + _result = _swig_self->Advise(entryStrLen, (LPENTRYID)entryString, + mask, psink, &connection); + Py_END_ALLOW_THREADS + if (FAILED(_result)) + rc = OleSetOleError(_result); + else + rc = PyLong_FromUnsignedLong(connection); + { + Py_BEGIN_ALLOW_THREADS + psink->Release(); + Py_END_ALLOW_THREADS + } + return rc; + } + %} + + // @pyswig |Unadvise| + // @pyparm int|connection||Value returned from <om PyIMAPISession.Advise> + HRESULT Unadvise(unsigned long connection); + + // @pyswig int|CompareEntryIDs|Compares two entry identifiers belonging to a particular address book provider to determine if they refer to the same address book object // @rdesc The result is set to TRUE if the two entry identifiers refer to the same object, and FALSE otherwise. Index: PyIMAPITable.i =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/mapi/src/PyIMAPITable.i,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** PyIMAPITable.i 12 Jun 2004 13:29:31 -0000 1.2 --- PyIMAPITable.i 9 Aug 2008 01:51:39 -0000 1.3 *************** *** 126,134 **** ); ! /* ! Unadvise|Cancels the sending of notifications previously set up with a call to the IMAPITable::Advise method. ! QuerySortOrder|Retrieves the current sort order for a table. --- 126,135 ---- ); ! // @pyswig |Unadvise|Cancels the sending of notifications previously set up with a call to the IMAPITable::Advise method. ! HRESULT Unadvise( ! unsigned long handle); // @pyparm int|handle||Handle returned from <om PyIMAPITable.Advise> + /* QuerySortOrder|Retrieves the current sort order for a table. |
From: Mark H. <mha...@us...> - 2008-08-09 01:51:31
|
Update of /cvsroot/pywin32/pywin32 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7290 Modified Files: setup.py CHANGES.txt Log Message: Add support for IMAPIAdviseSink Index: setup.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/setup.py,v retrieving revision 1.79 retrieving revision 1.80 diff -C2 -d -r1.79 -r1.80 *** setup.py 9 Aug 2008 01:49:49 -0000 1.79 --- setup.py 9 Aug 2008 01:51:39 -0000 1.80 *************** *** 1483,1486 **** --- 1483,1487 ---- %(mapi)s/PyIProfAdmin.i %(mapi)s/PyIProfAdmin.cpp %(mapi)s/PyIProfSect.i %(mapi)s/PyIProfSect.cpp + %(mapi)s/PyIMAPIAdviseSink.cpp %(mapi)s/mapiutil.cpp Index: CHANGES.txt =================================================================== RCS file: /cvsroot/pywin32/pywin32/CHANGES.txt,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** CHANGES.txt 31 Jul 2008 09:30:53 -0000 1.23 --- CHANGES.txt 9 Aug 2008 01:51:39 -0000 1.24 *************** *** 6,9 **** --- 6,14 ---- However contributors are encouraged to add their own entries for their work. + Since build 212: + ---------------- + + * MAPI gets support for IMAPIAdviseSink + Since build 211: ---------------- |
From: Mark H. <mha...@us...> - 2008-08-09 01:49:45
|
Update of /cvsroot/pywin32/pywin32 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6445 Modified Files: setup.py Log Message: bump build number to 212.1 Index: setup.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/setup.py,v retrieving revision 1.78 retrieving revision 1.79 diff -C2 -d -r1.78 -r1.79 *** setup.py 31 Jul 2008 09:30:53 -0000 1.78 --- setup.py 9 Aug 2008 01:49:49 -0000 1.79 *************** *** 1,3 **** ! build_id="212" # may optionally include a ".{patchno}" suffix. # Putting buildno at the top prevents automatic __doc__ assignment, and # I *want* the build number at the top :) --- 1,3 ---- ! build_id="212.1" # may optionally include a ".{patchno}" suffix. # Putting buildno at the top prevents automatic __doc__ assignment, and # I *want* the build number at the top :) |
From: Mark H. <mha...@us...> - 2008-08-07 07:42:48
|
Update of /cvsroot/pywin32/pywin32/com/win32comext/shell/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4469 Modified Files: PyIContextMenu.cpp Log Message: Fix leak of result in PyGContextMenu::QueryContextMenu Index: PyIContextMenu.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/shell/src/PyIContextMenu.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** PyIContextMenu.cpp 3 Jun 2007 14:53:07 -0000 1.6 --- PyIContextMenu.cpp 7 Aug 2008 07:41:33 -0000 1.7 *************** *** 147,150 **** --- 147,151 ---- if (PyInt_Check(ret)) hr = MAKE_HRESULT(SEVERITY_SUCCESS, 0, PyInt_AsLong(ret)); + Py_DECREF(ret); return hr; } |
From: Vernon C. <kf...@us...> - 2008-08-06 16:18:01
|
Update of /cvsroot/pywin32/pywin32/adodbapi In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24504 Modified Files: adodbapi.py readme.txt Log Message: adodbapi version 2.1.1 Bug fix so nextset() will work even if a result set is empty [Bob Kline] Bug fix to call CoInintialize before calling Dispatch [Adam Vandenberg] Cleanups to test routines Index: adodbapi.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/adodbapi/adodbapi.py,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** adodbapi.py 4 Jan 2008 18:49:09 -0000 1.1.1.1 --- adodbapi.py 6 Aug 2008 16:18:06 -0000 1.2 *************** *** 1,3 **** ! """adodbapi v2.1 - A python DB API 2.0 interface to Microsoft ADO Copyright (C) 2002 Henrik Ekelund --- 1,3 ---- ! """adodbapi v2.1.1 - A python DB API 2.0 interface to Microsoft ADO Copyright (C) 2002 Henrik Ekelund *************** *** 246,252 **** global verbose try: - conn=Dispatch('ADODB.Connection') if win32: ! pythoncom.CoInitialize() #v2.1 Paj except: raise InterfaceError #Probably COM Error --- 246,252 ---- global verbose try: if win32: ! pythoncom.CoInitialize() #v2.1 Paj ! conn=Dispatch('ADODB.Connection') #connect _after_ CoIninialize v2.1.1 adamvan except: raise InterfaceError #Probably COM Error *************** *** 502,508 **** return retLst ! def _makeDescriptionFromRS(self,rs): if (rs == None) or (rs.State == adStateClosed): ! self.rs=None self.description=None else: --- 502,509 ---- return retLst ! def _makeDescriptionFromRS(self,rs): ! self.rs = rs #v2.1.1 bkline if (rs == None) or (rs.State == adStateClosed): ! ##self.rs=None #removed v2.1.1 bkline self.description=None else: *************** *** 516,520 **** # and rowcount will then be set accurately [Cole] self.rowcount = -1 ! self.rs=rs nOfFields=rs.Fields.Count self.description=[] --- 517,521 ---- # and rowcount will then be set accurately [Cole] self.rowcount = -1 ! ##self.rs=rs #removed v2.1.1 bkline nOfFields=rs.Fields.Count self.description=[] *************** *** 542,546 **** if self.rs and self.rs.State != adStateClosed: # rs exists and is open #v2.1 Rose self.rs.Close() #v2.1 Rose ! self.rs = None #let go of the recordset os ADO will let it be disposed #v2.1 Rose # ------------------------ --- 543,547 ---- if self.rs and self.rs.State != adStateClosed: # rs exists and is open #v2.1 Rose self.rs.Close() #v2.1 Rose ! self.rs = None #let go of the recordset so ADO will let it be disposed #v2.1 Rose # ------------------------ *************** *** 741,745 **** self._raiseCursorError(Error,None) return ! if rs == None: self._raiseCursorError(Error,None) return --- 742,746 ---- self._raiseCursorError(Error,None) return ! if rs == None or rs.State == adStateClosed: #v2.1.1 bkline self._raiseCursorError(Error,None) return Index: readme.txt =================================================================== RCS file: /cvsroot/pywin32/pywin32/adodbapi/readme.txt,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** readme.txt 4 Jan 2008 18:49:09 -0000 1.1.1.1 --- readme.txt 6 Aug 2008 16:18:06 -0000 1.2 *************** *** 19,22 **** --- 19,27 ---- * (this version included within) Mark Hammond's win32all python for windows extensions. + + Whats new in version 2.1.1? + 1. Bugfix so nextset() will work even if a rowset is empty [ Bob Kline ] + 2. Bugfix to call CoInitailize() before calling Dispatch() [ Adam Vandenberg ] + Whats new in version 2.1? 1. Use of Decimal.decimal data type for currency and numeric data. [ Cole ] *************** *** 64,68 **** LGPL, see http://www.opensource.org/licenses/lgpl-license.php - Documentation ------------- --- 69,72 ---- *************** *** 75,87 **** ------------- The adodbapi mailing lists have been deactivated. Submit comments to the ! bug tracker. - Contribute - ---------- - Use the sourceforge bug tracking system to submit bugs, feature requests - and comments. Relase history -------------- 2.1 Python 2.4 version 2.0 See what's new above. --- 79,88 ---- ------------- The adodbapi mailing lists have been deactivated. Submit comments to the ! pywin32 lists. Relase history -------------- + 2.1.1 Bugfix to CoIninialize() and nextset() 2.1 Python 2.4 version 2.0 See what's new above. |
From: Vernon C. <kf...@us...> - 2008-08-06 16:17:59
|
Update of /cvsroot/pywin32/pywin32/adodbapi/tests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24504/tests Modified Files: adodbapitest.py adodbapitestconfig.py Log Message: adodbapi version 2.1.1 Bug fix so nextset() will work even if a result set is empty [Bob Kline] Bug fix to call CoInintialize before calling Dispatch [Adam Vandenberg] Cleanups to test routines Index: adodbapitest.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/adodbapi/tests/adodbapitest.py,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** adodbapitest.py 4 Jan 2008 18:49:10 -0000 1.1.1.1 --- adodbapitest.py 6 Aug 2008 16:18:06 -0000 1.2 *************** *** 21,24 **** --- 21,25 ---- Updated for decimal data and version 2.1 by Vernon Cole + AS400 tests removed v 2.1.1 - Vernon Cole """ *************** *** 388,394 **** crsr.execute(tabdef) ! for multiplier in (1,decimal.Decimal('2.5'),78,9999,999999,7007): crsr.execute("DELETE FROM tblTemp") ! crsr.execute("INSERT INTO tblTemp(fldCurr) VALUES (12.50*%f)" % multiplier) sql="SELECT fldCurr FROM tblTemp " --- 389,396 ---- crsr.execute(tabdef) ! for multiplier in (1,decimal.Decimal('2.5'),78,9999,99999,7007): crsr.execute("DELETE FROM tblTemp") ! correct = decimal.Decimal('12.50') * multiplier ! crsr.execute("INSERT INTO tblTemp(fldCurr) VALUES (?)",[correct]) sql="SELECT fldCurr FROM tblTemp " *************** *** 399,403 **** print sql fldcurr=crsr.fetchone()[0] - correct = decimal.Decimal('12.50') * multiplier self.assertEquals( fldcurr,correct) --- 401,404 ---- *************** *** 535,538 **** --- 536,550 ---- self.engine = 'ACCESS' + def tearDown(self): + try: + self.conn.rollback() + except: + pass + try: + self.conn.close() + except: + pass + self.conn=None + def getConnection(self): return adodbapi.connect(adodbapitestconfig.connStrAccess) *************** *** 561,584 **** assert c != None - class TestADOwithAS400DB(CommonDBTests): - def setUp(self): - try: - adoConn=win32com.client.Dispatch("ADODB.Connection") - except: - self.fail('SetUpError: Is MDAC installed?') - try: - adoConn.Open(adodbapitestconfig.connStrAS400) - except: - self.fail('SetUpError: Can not connect to the testdatabase, all other tests will fail...\nAdo error:%s' % adoConn.Errors(0)) - self.engine = 'IBMDA400' - - def getConnection(self): - return adodbapi.connect(adodbapitestconfig.connStrAS400) - - def testOkConnect(self): - c=adodbapi.connect(adodbapitestconfig.connStrAS400) - assert c != None - - class TimeConverterInterfaceTest(unittest.TestCase): def testIDate(self): --- 573,576 ---- *************** *** 732,737 **** if adodbapitestconfig.doMySqlTest: suites.append( unittest.makeSuite(TestADOwithMySql,'test')) ! if adodbapitestconfig.doAS400Test: ! suites.append( unittest.makeSuite(TestADOwithAS400DB,'test')) suite=unittest.TestSuite(suites) if __name__ == '__main__': --- 724,728 ---- if adodbapitestconfig.doMySqlTest: suites.append( unittest.makeSuite(TestADOwithMySql,'test')) ! suite=unittest.TestSuite(suites) if __name__ == '__main__': Index: adodbapitestconfig.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/adodbapi/tests/adodbapitestconfig.py,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** adodbapitestconfig.py 4 Jan 2008 18:49:10 -0000 1.1.1.1 --- adodbapitestconfig.py 6 Aug 2008 16:18:06 -0000 1.2 *************** *** 5,8 **** --- 5,10 ---- doAccessTest = True doSqlServerTest = True + doMySqlTest = True + try: #If mx extensions are installed, use mxDateTime import mx.DateTime *************** *** 10,15 **** except: doMxDateTimeTest=False #Requires eGenixMXExtensions ! doAS400Test = False ! doMySqlTest = False import sys if float(sys.version[:3])>2.29: --- 12,17 ---- except: doMxDateTimeTest=False #Requires eGenixMXExtensions ! ! import sys if float(sys.version[:3])>2.29: *************** *** 82,89 **** if doMySqlTest: ! _computername='5.128.134.143' _databasename='test' ! connStrMySql = 'Driver={MySQL ODBC 3.51 Driver};Server=%s;Port=3306;Database=%s;Option=3;' % \ (_computername,_databasename) print ' ...Testing MySql login...' --- 84,91 ---- if doMySqlTest: ! _computername='10.100.5.249' _databasename='test' ! connStrMySql = 'Driver={MySQL ODBC 5.1 Driver};Server=%s;Port=3306;Database=%s;Option=3;' % \ (_computername,_databasename) print ' ...Testing MySql login...' *************** *** 95,113 **** doMySqlTest = False ! if doAS400Test: ! #OLE DB -> "PROVIDER=IBMDA400; DATA SOURCE=MY_SYSTEM_NAME;USER ID=myUserName;PASSWORD=myPwd;DEFAULT COLLECTION=MY_LIBRARY;" ! connStrAS400skl = "Provider=IBMDA400; DATA SOURCE=%s;DEFAULT COLLECTION=%s;User ID=%s;Password=%s" ! # NOTE! user's PC must have OLE support installed in IBM Client Access Express ! _computername='PEPPER' ! _databasename="DPDAN" ! _username = raw_input(' AS400 User ID for data retrieval [%s]:' % defaultUser) ! _password = getpass.getpass(' AS400 password:') #read the password ! connStrAS400 = connStrAS400skl % (_computername,_databasename,_username,_password) #build the connection string ! print ' ...Testing AS400 login...' ! try: ! s = adodbapi.connect(connStrAS400) #connect to server ! s.close() ! except adodbapi.DatabaseError, inst: ! print inst.args[0][2] # should be the AS400 error message ! doAS400Test = False ! \ No newline at end of file --- 97,99 ---- doMySqlTest = False ! \ No newline at end of file |
From: Mark H. <mha...@us...> - 2008-07-31 09:30:45
|
Update of /cvsroot/pywin32/pywin32 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24031 Modified Files: setup.py CHANGES.txt Log Message: build 212 Index: setup.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/setup.py,v retrieving revision 1.77 retrieving revision 1.78 diff -C2 -d -r1.77 -r1.78 *** setup.py 26 Jul 2008 07:02:34 -0000 1.77 --- setup.py 31 Jul 2008 09:30:53 -0000 1.78 *************** *** 1,3 **** ! build_id="211.1" # may optionally include a ".{patchno}" suffix. # Putting buildno at the top prevents automatic __doc__ assignment, and # I *want* the build number at the top :) --- 1,3 ---- ! build_id="212" # may optionally include a ".{patchno}" suffix. # Putting buildno at the top prevents automatic __doc__ assignment, and # I *want* the build number at the top :) Index: CHANGES.txt =================================================================== RCS file: /cvsroot/pywin32/pywin32/CHANGES.txt,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** CHANGES.txt 7 Jun 2008 07:23:54 -0000 1.22 --- CHANGES.txt 31 Jul 2008 09:30:53 -0000 1.23 *************** *** 9,15 **** ---------------- ! * Add win32net.NetValidatePasswordPolicy, including a demo. - * Add win32pipe.TransactNamedPipe, including tests. Since build 210: --- 9,40 ---- ---------------- ! * Remove warning about VARDESCs in obscure circumstances when using ! COM objects. ! ! * Add winapi.SetSystemPowerState(), win32pipe.TransactNamedPipe(), ! win32net.NetValidatePasswordPolicy(), ! ! * win32api.GetConsoleTitle() could raise win32api.error with an error ! code of 0 when the title was > 64 characters. It now returns the ! full title. ! ! * New IExplorerPaneVisibility interface, minor shell bugfixes. ! ! * Fix a couple of makepy related unicode issues, and generate to ! a .temp file so an error doesn't leave a 1/2 generated module. ! ! * Fix so makepy works in IDLE in non-English locales. ! ! * Pythonwin changes from Roger: ! - Right-click menu gets "Copy code without prompts" and "Execute ! code from clipboard" options. ! - If text is selected when period key is pressed, replace text ! instead of doing autocomplete ! - Add a keyboard shortcut to fold up second level indents ! - Allow keypad keys to perform original function when folding ! is disabled (feature req 1798328) ! ! * Add some extra service configuration parameters introduced with Vista Since build 210: |
From: Mark H. <mha...@us...> - 2008-07-27 13:02:24
|
Update of /cvsroot/pywin32/pywin32/com/win32com/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15282/com/win32com/src Modified Files: PythonCOM.cpp Log Message: autoduck corrections. Index: PythonCOM.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/src/PythonCOM.cpp,v retrieving revision 1.51 retrieving revision 1.52 diff -C2 -d -r1.51 -r1.52 *** PythonCOM.cpp 20 Jul 2008 03:16:25 -0000 1.51 --- PythonCOM.cpp 27 Jul 2008 13:01:17 -0000 1.52 *************** *** 1754,1758 **** PyObject *obIID = NULL; PyObject *obwparam; ! // @pyparam int|lresult|| // @pyparm <o PyIID>|iid||The IID to query // @pyparm int|wparm|| --- 1754,1758 ---- PyObject *obIID = NULL; PyObject *obwparam; ! // @pyparm int|lresult|| // @pyparm <o PyIID>|iid||The IID to query // @pyparm int|wparm|| *************** *** 1807,1811 **** PyObject *obAddr; PyObject *obIID = NULL; ! // @pyparam int|address||The address which holds a COM object // @pyparm <o PyIID>|iid|IUnknown|The IID to query if (!PyArg_ParseTuple(args, "O|O", &obAddr, &obIID)) --- 1807,1811 ---- PyObject *obAddr; PyObject *obIID = NULL; ! // @pyparm int|address||The address which holds a COM object // @pyparm <o PyIID>|iid|IUnknown|The IID to query if (!PyArg_ParseTuple(args, "O|O", &obAddr, &obIID)) |
From: Mark H. <mha...@us...> - 2008-07-27 13:01:10
|
Update of /cvsroot/pywin32/pywin32/com/win32comext/shell/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15282/com/win32comext/shell/src Modified Files: shell.cpp Log Message: autoduck corrections. Index: shell.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/shell/src/shell.cpp,v retrieving revision 1.65 retrieving revision 1.66 diff -C2 -d -r1.65 -r1.66 *** shell.cpp 26 Jul 2008 07:02:35 -0000 1.65 --- shell.cpp 27 Jul 2008 13:01:18 -0000 1.66 *************** *** 2933,2937 **** PyObject *obname, *obctx, *obiid; // @pyparm unicode|name|| ! // @pyparm <i PyIBindCtx>|ctx|| // @pyparm <o PyIID>|iid|| --- 2933,2937 ---- PyObject *obname, *obctx, *obiid; // @pyparm unicode|name|| ! // @pyparm <o PyIBindCtx>|ctx|| // @pyparm <o PyIID>|iid|| *************** *** 2989,2993 **** // @pyparm <o PyIShellItem>|parent|| // @pyparm unicode|name|| ! // @pyparm <i PyIBindCtx>|ctx|| // @pyparm <o PyIID>|iid|| --- 2989,2993 ---- // @pyparm <o PyIShellItem>|parent|| // @pyparm unicode|name|| ! // @pyparm <o PyIBindCtx>|ctx|| // @pyparm <o PyIID>|iid|| *************** *** 3052,3056 **** PyObject *obname, *obiid, *obguid; // @pyparm unicode|name|| ! // @pyparm <i PyIBindCtx>|ctx|| // @pyparm <o PyIID>|iid|| --- 3052,3056 ---- PyObject *obname, *obiid, *obguid; // @pyparm unicode|name|| ! // @pyparm <o PyIBindCtx>|ctx|| // @pyparm <o PyIID>|iid|| |
From: Mark H. <mha...@us...> - 2008-07-27 06:45:00
|
Update of /cvsroot/pywin32/pywin32/com/win32com/makegw In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27146/com/win32com/makegw Modified Files: makegwparse.py Log Message: Few HWND and similar fixes. Index: makegwparse.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/makegw/makegwparse.py,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** makegwparse.py 9 Apr 2008 10:03:21 -0000 1.12 --- makegwparse.py 27 Jul 2008 06:44:59 -0000 1.13 *************** *** 57,61 **** return "*" else: ! return "??" raise error_not_supported, "Can't indirect this far - please fix me :-)" def GetIndirectedArgName(self, indirectFrom, indirectionTo): --- 57,61 ---- return "*" else: ! return "?? (%d)" % (dif,) raise error_not_supported, "Can't indirect this far - please fix me :-)" def GetIndirectedArgName(self, indirectFrom, indirectionTo): *************** *** 240,243 **** --- 240,271 ---- return s + # for types which are 64bits on AMD64 - eg, HWND + class ArgFormatterLONG_PTR(ArgFormatter): + def GetFormatChar(self): + return "O" + def DeclareParseArgTupleInputConverter(self): + # Declare a PyObject variable + return "\tPyObject *ob%s;\n" % self.arg.name + def GetParseTupleArg(self): + return "&ob"+self.arg.name + def _GetPythonTypeDesc(self): + return "int/long" + def GetBuildValueArg(self): + return "ob" + self.arg.name + def GetBuildForInterfacePostCode(self): + return "\tPy_XDECREF(ob%s);\n" % self.arg.name + def DeclareParseArgTupleInputConverter(self): + # Declare a PyObject variable + return "\tPyObject *ob%s;\n" % self.arg.name + + def GetParsePostCode(self): + return "\tif (bPythonIsHappy && !PyWinLong_AsULONG_PTR(ob%s, (ULONG_PTR *)%s)) bPythonIsHappy = FALSE;\n" % (self.arg.name, self.GetIndirectedArgName(None, 2)) + def GetBuildForInterfacePreCode(self): + notdirected = self.GetIndirectedArgName(None, 1) + return "\tob%s = PyWinObject_FromULONG_PTR(%s);\n" % \ + (self.arg.name, notdirected) + def GetBuildForGatewayPostCode(self): + return "\tPy_XDECREF(ob%s);\n" % self.arg.name + class ArgFormatterPythonCOM(ArgFormatter): """An arg formatter for types exposed in the PythonCOM module""" *************** *** 463,471 **** "int": ("int", "int", "i"), "long": ("long", "int", "l"), - "HWND": ("HWND", "HWND", "l"), - "HDC": ("HDC", "HDC", "l"), - "LPARAM" : ("LPARAM", "long", "l"), - "LRESULT" : ("LRESULT", "long", "l"), - "WPARAM" : ("LPARAM", "int", "i"), "DISPID": ("DISPID", "long", "l"), "APPBREAKFLAGS": ("int", "int", "i"), --- 491,494 ---- *************** *** 524,531 **** "WORD": (ArgFormatterShort, 0), "VARIANT_BOOL": (ArgFormatterShort, 0), ! "HWND": (ArgFormatterShort, 0), ! "HMENU": (ArgFormatterShort, 0), ! "HOLEMENU": (ArgFormatterShort, 0), ! "HICON": (ArgFormatterShort, 0), "UINT": (ArgFormatterShort, 0), "SVSIF": (ArgFormatterShort, 0), --- 547,558 ---- "WORD": (ArgFormatterShort, 0), "VARIANT_BOOL": (ArgFormatterShort, 0), ! "HWND": (ArgFormatterLONG_PTR, 1), ! "HMENU": (ArgFormatterLONG_PTR, 1), ! "HOLEMENU": (ArgFormatterLONG_PTR, 1), ! "HICON": (ArgFormatterLONG_PTR, 1), ! "HDC": (ArgFormatterLONG_PTR, 1), ! "LPARAM": (ArgFormatterLONG_PTR, 1), ! "WPARAM": (ArgFormatterLONG_PTR, 1), ! "LRESULT": (ArgFormatterLONG_PTR, 1), "UINT": (ArgFormatterShort, 0), "SVSIF": (ArgFormatterShort, 0), |
From: Mark H. <mha...@us...> - 2008-07-26 07:02:27
|
Update of /cvsroot/pywin32/pywin32/com/win32comext/shell/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2322/com/win32comext/shell/src Modified Files: shell.cpp Added Files: PyINameSpaceTreeControl.cpp PyINameSpaceTreeControl.h Log Message: Support for INameSpaceTreeControl and new functions: SHCreateItemFromIDList, SHCreateItemFromParsingName, SHCreateItemFromRelativeName, SHCreateItemInKnownFolder, SHCreateItemWithParent and SHGetIDListFromObject and tests. --- NEW FILE: PyINameSpaceTreeControl.cpp --- // This file implements the INameSpaceTreeControl Interface and Gateway for Python. // Generated by makegw.py #include "shell_pch.h" #include "PyINameSpaceTreeControl.h" // @doc - This file contains autoduck documentation // --------------------------------------------------- // // Interface Implementation PyINameSpaceTreeControl::PyINameSpaceTreeControl(IUnknown *pdisp): PyIUnknown(pdisp) { ob_type = &type; } PyINameSpaceTreeControl::~PyINameSpaceTreeControl() { } /* static */ INameSpaceTreeControl *PyINameSpaceTreeControl::GetI(PyObject *self) { return (INameSpaceTreeControl *)PyIUnknown::GetI(self); } // @pymethod |PyINameSpaceTreeControl|Initialize|Description of Initialize. PyObject *PyINameSpaceTreeControl::Initialize(PyObject *self, PyObject *args) { INameSpaceTreeControl *pINSTC = GetI(self); if ( pINSTC == NULL ) return NULL; // @pyparm int/long|hwndParent||Description for hwndParent RECT rc; // @pyparm (int, int, int, int)|prc||Description for prc // @pyparm int|nsctsFlags||Description for nsctsFlags PyObject *obhwndParent; HWND hwndParent; DWORD nsctsFlags; if ( !PyArg_ParseTuple(args, "O(iiii)l:Initialize", &obhwndParent, &rc.left, &rc.top, &rc.bottom, &rc.right, &nsctsFlags)) return NULL; if (!PyWinLong_AsULONG_PTR(obhwndParent, (ULONG_PTR *)&hwndParent)) return NULL; HRESULT hr; PY_INTERFACE_PRECALL; hr = pINSTC->Initialize( hwndParent, &rc, nsctsFlags ); PY_INTERFACE_POSTCALL; if ( FAILED(hr) ) return PyCom_BuildPyException(hr, pINSTC, IID_INameSpaceTreeControl ); Py_INCREF(Py_None); return Py_None; } // @pymethod |PyINameSpaceTreeControl|TreeAdvise|Description of TreeAdvise. PyObject *PyINameSpaceTreeControl::TreeAdvise(PyObject *self, PyObject *args) { INameSpaceTreeControl *pINSTC = GetI(self); if ( pINSTC == NULL ) return NULL; // @pyparm <o PyIUnknown>|punk||Description for punk PyObject *obpunk; IUnknown * punk; DWORD dwCookie; if ( !PyArg_ParseTuple(args, "O:TreeAdvise", &obpunk) ) return NULL; if (!PyCom_InterfaceFromPyInstanceOrObject(obpunk, IID_IUnknown, (void **)&punk, TRUE /* bNoneOK */)) return NULL; HRESULT hr; PY_INTERFACE_PRECALL; hr = pINSTC->TreeAdvise( punk, &dwCookie ); if (punk) punk->Release(); PY_INTERFACE_POSTCALL; if ( FAILED(hr) ) return PyCom_BuildPyException(hr, pINSTC, IID_INameSpaceTreeControl ); return PyInt_FromLong(dwCookie); } // @pymethod |PyINameSpaceTreeControl|TreeUnadvise|Description of TreeUnadvise. PyObject *PyINameSpaceTreeControl::TreeUnadvise(PyObject *self, PyObject *args) { INameSpaceTreeControl *pINSTC = GetI(self); if ( pINSTC == NULL ) return NULL; // @pyparm int|dwCookie||Description for dwCookie DWORD dwCookie; if ( !PyArg_ParseTuple(args, "l:TreeUnadvise", &dwCookie) ) return NULL; HRESULT hr; PY_INTERFACE_PRECALL; hr = pINSTC->TreeUnadvise( dwCookie ); PY_INTERFACE_POSTCALL; if ( FAILED(hr) ) return PyCom_BuildPyException(hr, pINSTC, IID_INameSpaceTreeControl ); Py_INCREF(Py_None); return Py_None; } // @pymethod |PyINameSpaceTreeControl|AppendRoot|Description of AppendRoot. PyObject *PyINameSpaceTreeControl::AppendRoot(PyObject *self, PyObject *args) { INameSpaceTreeControl *pINSTC = GetI(self); if ( pINSTC == NULL ) return NULL; // @pyparm <o PyIShellItem>|psiRoot||Description for psiRoot // @pyparm int|grfEnumFlags||Description for grfEnumFlags // @pyparm int|grfRootStyle||Description for grfRootStyle // @pyparm <o PyIShellItemFilter>|pif||Description for pif PyObject *obpsiRoot; PyObject *obpif; IShellItem * psiRoot; DWORD grfEnumFlags; DWORD grfRootStyle; IShellItemFilter * pif; if ( !PyArg_ParseTuple(args, "OkkO:AppendRoot", &obpsiRoot, &grfEnumFlags, &grfRootStyle, &obpif) ) return NULL; if (!PyCom_InterfaceFromPyInstanceOrObject(obpsiRoot, IID_IShellItem, (void **)&psiRoot, TRUE /* bNoneOK */)) return NULL; if (!PyCom_InterfaceFromPyInstanceOrObject(obpif, IID_IShellItemFilter, (void **)&pif, TRUE /* bNoneOK */)) { if (pif) pif->Release(); return NULL; } HRESULT hr; PY_INTERFACE_PRECALL; hr = pINSTC->AppendRoot( psiRoot, grfEnumFlags, grfRootStyle, pif ); if (psiRoot) psiRoot->Release(); if (pif) pif->Release(); PY_INTERFACE_POSTCALL; if ( FAILED(hr) ) return PyCom_BuildPyException(hr, pINSTC, IID_INameSpaceTreeControl ); Py_INCREF(Py_None); return Py_None; } // @pymethod |PyINameSpaceTreeControl|InsertRoot|Description of InsertRoot. PyObject *PyINameSpaceTreeControl::InsertRoot(PyObject *self, PyObject *args) { INameSpaceTreeControl *pINSTC = GetI(self); if ( pINSTC == NULL ) return NULL; // @pyparm int|iIndex||Description for iIndex // @pyparm <o PyIShellItem>|psiRoot||Description for psiRoot // @pyparm int|grfEnumFlags||Description for grfEnumFlags // @pyparm int|grfRootStyle||Description for grfRootStyle // @pyparm <o PyIShellItemFilter>|pif||Description for pif PyObject *obpsiRoot; PyObject *obpif; int iIndex; IShellItem * psiRoot; DWORD grfEnumFlags; DWORD grfRootStyle; IShellItemFilter * pif; if ( !PyArg_ParseTuple(args, "iOkkO:InsertRoot", &iIndex, &obpsiRoot, &grfEnumFlags, &grfRootStyle, &obpif) ) return NULL; BOOL bPythonIsHappy = TRUE; if (bPythonIsHappy && !PyCom_InterfaceFromPyInstanceOrObject(obpsiRoot, IID_IShellItem, (void **)&psiRoot, TRUE /* bNoneOK */)) bPythonIsHappy = FALSE; if (bPythonIsHappy && !PyCom_InterfaceFromPyInstanceOrObject(obpif, IID_IShellItemFilter, (void **)&pif, TRUE /* bNoneOK */)) bPythonIsHappy = FALSE; if (!bPythonIsHappy) return NULL; HRESULT hr; PY_INTERFACE_PRECALL; hr = pINSTC->InsertRoot( iIndex, psiRoot, grfEnumFlags, grfRootStyle, pif ); if (psiRoot) psiRoot->Release(); if (pif) pif->Release(); PY_INTERFACE_POSTCALL; if ( FAILED(hr) ) return PyCom_BuildPyException(hr, pINSTC, IID_INameSpaceTreeControl ); Py_INCREF(Py_None); return Py_None; } // @pymethod |PyINameSpaceTreeControl|RemoveRoot|Description of RemoveRoot. PyObject *PyINameSpaceTreeControl::RemoveRoot(PyObject *self, PyObject *args) { INameSpaceTreeControl *pINSTC = GetI(self); if ( pINSTC == NULL ) return NULL; // @pyparm <o PyIShellItem>|psiRoot||Description for psiRoot PyObject *obpsiRoot; IShellItem * psiRoot; if ( !PyArg_ParseTuple(args, "O:RemoveRoot", &obpsiRoot) ) return NULL; if (!PyCom_InterfaceFromPyInstanceOrObject(obpsiRoot, IID_IShellItem, (void **)&psiRoot, TRUE /* bNoneOK */)) return NULL; HRESULT hr; PY_INTERFACE_PRECALL; hr = pINSTC->RemoveRoot( psiRoot ); if (psiRoot) psiRoot->Release(); PY_INTERFACE_POSTCALL; if ( FAILED(hr) ) return PyCom_BuildPyException(hr, pINSTC, IID_INameSpaceTreeControl ); Py_INCREF(Py_None); return Py_None; } // @pymethod |PyINameSpaceTreeControl|RemoveAllRoots|Description of RemoveAllRoots. PyObject *PyINameSpaceTreeControl::RemoveAllRoots(PyObject *self, PyObject *args) { INameSpaceTreeControl *pINSTC = GetI(self); if ( pINSTC == NULL ) return NULL; if ( !PyArg_ParseTuple(args, ":RemoveAllRoots") ) return NULL; HRESULT hr; PY_INTERFACE_PRECALL; hr = pINSTC->RemoveAllRoots( ); PY_INTERFACE_POSTCALL; if ( FAILED(hr) ) return PyCom_BuildPyException(hr, pINSTC, IID_INameSpaceTreeControl ); Py_INCREF(Py_None); return Py_None; } // @pymethod |PyINameSpaceTreeControl|GetRootItems|Description of GetRootItems. PyObject *PyINameSpaceTreeControl::GetRootItems(PyObject *self, PyObject *args) { INameSpaceTreeControl *pINSTC = GetI(self); if ( pINSTC == NULL ) return NULL; IShellItemArray * ppsiaRootItems; if ( !PyArg_ParseTuple(args, ":GetRootItems") ) return NULL; HRESULT hr; PY_INTERFACE_PRECALL; hr = pINSTC->GetRootItems( &ppsiaRootItems ); PY_INTERFACE_POSTCALL; if ( FAILED(hr) ) return PyCom_BuildPyException(hr, pINSTC, IID_INameSpaceTreeControl ); return PyCom_PyObjectFromIUnknown(ppsiaRootItems, IID_IShellItemArray, FALSE); } // @pymethod |PyINameSpaceTreeControl|SetItemState|Description of SetItemState. PyObject *PyINameSpaceTreeControl::SetItemState(PyObject *self, PyObject *args) { INameSpaceTreeControl *pINSTC = GetI(self); if ( pINSTC == NULL ) return NULL; // @pyparm <o PyIShellItem>|psi||Description for psi // @pyparm int|nstcisMask||Description for nstcisMask // @pyparm int|nstcisFlags||Description for nstcisFlags PyObject *obpsi; IShellItem * psi; DWORD nstcisMask; DWORD nstcisFlags; if ( !PyArg_ParseTuple(args, "Okk:SetItemState", &obpsi, &nstcisMask, &nstcisFlags) ) return NULL; if (!PyCom_InterfaceFromPyInstanceOrObject(obpsi, IID_IShellItem, (void **)&psi, TRUE /* bNoneOK */)) return NULL; HRESULT hr; PY_INTERFACE_PRECALL; hr = pINSTC->SetItemState( psi, nstcisMask, nstcisFlags ); if (psi) psi->Release(); PY_INTERFACE_POSTCALL; if ( FAILED(hr) ) return PyCom_BuildPyException(hr, pINSTC, IID_INameSpaceTreeControl ); Py_INCREF(Py_None); return Py_None; } // @pymethod |PyINameSpaceTreeControl|GetItemState|Description of GetItemState. PyObject *PyINameSpaceTreeControl::GetItemState(PyObject *self, PyObject *args) { INameSpaceTreeControl *pINSTC = GetI(self); if ( pINSTC == NULL ) return NULL; // @pyparm <o PyIShellItem>|psi||Description for psi // @pyparm int|nstcisMask||Description for nstcisMask PyObject *obpsi; IShellItem * psi; DWORD nstcisMask; DWORD nstcisFlags; if ( !PyArg_ParseTuple(args, "Ok:GetItemState", &obpsi, &nstcisMask) ) return NULL; BOOL bPythonIsHappy = TRUE; if (bPythonIsHappy && !PyCom_InterfaceFromPyInstanceOrObject(obpsi, IID_IShellItem, (void **)&psi, TRUE /* bNoneOK */)) bPythonIsHappy = FALSE; if (!bPythonIsHappy) return NULL; HRESULT hr; PY_INTERFACE_PRECALL; hr = pINSTC->GetItemState( psi, nstcisMask, &nstcisFlags ); if (psi) psi->Release(); PY_INTERFACE_POSTCALL; if ( FAILED(hr) ) return PyCom_BuildPyException(hr, pINSTC, IID_INameSpaceTreeControl ); return PyLong_FromUnsignedLong(nstcisFlags); } // @pymethod |PyINameSpaceTreeControl|GetSelectedItems|Description of GetSelectedItems. PyObject *PyINameSpaceTreeControl::GetSelectedItems(PyObject *self, PyObject *args) { INameSpaceTreeControl *pINSTC = GetI(self); if ( pINSTC == NULL ) return NULL; IShellItemArray * psiaItems; if ( !PyArg_ParseTuple(args, ":GetSelectedItems") ) return NULL; HRESULT hr; PY_INTERFACE_PRECALL; hr = pINSTC->GetSelectedItems( &psiaItems ); PY_INTERFACE_POSTCALL; if ( FAILED(hr) ) return PyCom_BuildPyException(hr, pINSTC, IID_INameSpaceTreeControl ); return PyCom_PyObjectFromIUnknown(psiaItems, IID_IShellItemArray, FALSE); } // @pymethod |PyINameSpaceTreeControl|GetItemCustomState|Description of GetItemCustomState. PyObject *PyINameSpaceTreeControl::GetItemCustomState(PyObject *self, PyObject *args) { INameSpaceTreeControl *pINSTC = GetI(self); if ( pINSTC == NULL ) return NULL; // @pyparm <o PyIShellItem>|psi||Description for psi PyObject *obpsi; IShellItem * psi; int iStateNumber; if ( !PyArg_ParseTuple(args, "O:GetItemCustomState", &obpsi) ) return NULL; if (!PyCom_InterfaceFromPyInstanceOrObject(obpsi, IID_IShellItem, (void **)&psi, TRUE /* bNoneOK */)) return NULL; HRESULT hr; PY_INTERFACE_PRECALL; hr = pINSTC->GetItemCustomState( psi, &iStateNumber ); if (psi) psi->Release(); PY_INTERFACE_POSTCALL; if ( FAILED(hr) ) return PyCom_BuildPyException(hr, pINSTC, IID_INameSpaceTreeControl ); return PyInt_FromLong(iStateNumber); } // @pymethod |PyINameSpaceTreeControl|SetItemCustomState|Description of SetItemCustomState. PyObject *PyINameSpaceTreeControl::SetItemCustomState(PyObject *self, PyObject *args) { INameSpaceTreeControl *pINSTC = GetI(self); if ( pINSTC == NULL ) return NULL; // @pyparm <o PyIShellItem>|psi||Description for psi // @pyparm int|iStateNumber||Description for iStateNumber PyObject *obpsi; IShellItem * psi; int iStateNumber; if ( !PyArg_ParseTuple(args, "Oi:SetItemCustomState", &obpsi, &iStateNumber) ) return NULL; if (!PyCom_InterfaceFromPyInstanceOrObject(obpsi, IID_IShellItem, (void **)&psi, TRUE /* bNoneOK */)) return NULL; HRESULT hr; PY_INTERFACE_PRECALL; hr = pINSTC->SetItemCustomState( psi, iStateNumber ); if (psi) psi->Release(); PY_INTERFACE_POSTCALL; if ( FAILED(hr) ) return PyCom_BuildPyException(hr, pINSTC, IID_INameSpaceTreeControl ); Py_INCREF(Py_None); return Py_None; } // @pymethod |PyINameSpaceTreeControl|EnsureItemVisible|Description of EnsureItemVisible. PyObject *PyINameSpaceTreeControl::EnsureItemVisible(PyObject *self, PyObject *args) { INameSpaceTreeControl *pINSTC = GetI(self); if ( pINSTC == NULL ) return NULL; // @pyparm <o PyIShellItem>|psi||Description for psi PyObject *obpsi; IShellItem * psi; if ( !PyArg_ParseTuple(args, "O:EnsureItemVisible", &obpsi) ) return NULL; if (!PyCom_InterfaceFromPyInstanceOrObject(obpsi, IID_IShellItem, (void **)&psi, TRUE /* bNoneOK */)) return NULL; HRESULT hr; PY_INTERFACE_PRECALL; hr = pINSTC->EnsureItemVisible( psi ); if (psi) psi->Release(); PY_INTERFACE_POSTCALL; if ( FAILED(hr) ) return PyCom_BuildPyException(hr, pINSTC, IID_INameSpaceTreeControl ); Py_INCREF(Py_None); return Py_None; } // @pymethod |PyINameSpaceTreeControl|SetTheme|Description of SetTheme. PyObject *PyINameSpaceTreeControl::SetTheme(PyObject *self, PyObject *args) { INameSpaceTreeControl *pINSTC = GetI(self); if ( pINSTC == NULL ) return NULL; // @pyparm <o unicode>|pszTheme||Description for pszTheme PyObject *obpszTheme; LPWSTR pszTheme; if ( !PyArg_ParseTuple(args, "O:SetTheme", &obpszTheme) ) return NULL; if (!PyWinObject_AsBstr(obpszTheme, &pszTheme)) return NULL; HRESULT hr; PY_INTERFACE_PRECALL; hr = pINSTC->SetTheme( pszTheme ); SysFreeString(pszTheme); PY_INTERFACE_POSTCALL; if ( FAILED(hr) ) return PyCom_BuildPyException(hr, pINSTC, IID_INameSpaceTreeControl ); Py_INCREF(Py_None); return Py_None; } // @pymethod |PyINameSpaceTreeControl|GetNextItem|Description of GetNextItem. PyObject *PyINameSpaceTreeControl::GetNextItem(PyObject *self, PyObject *args) { INameSpaceTreeControl *pINSTC = GetI(self); if ( pINSTC == NULL ) return NULL; // @pyparm <o PyIShellItem>|psi||Description for psi // @pyparm int|nstcgi||Description for nstcgi PyObject *obpsi; IShellItem * psi; DWORD nstcgi; IShellItem * ppsiNext; if ( !PyArg_ParseTuple(args, "Ol:GetNextItem", &obpsi, &nstcgi) ) return NULL; if (!PyCom_InterfaceFromPyInstanceOrObject(obpsi, IID_IShellItem, (void **)&psi, TRUE /* bNoneOK */)) return NULL; HRESULT hr; PY_INTERFACE_PRECALL; hr = pINSTC->GetNextItem( psi, nstcgi, &ppsiNext ); if (psi) psi->Release(); PY_INTERFACE_POSTCALL; if ( FAILED(hr) ) return PyCom_BuildPyException(hr, pINSTC, IID_INameSpaceTreeControl ); return PyCom_PyObjectFromIUnknown(ppsiNext, IID_IShellItem, FALSE); } // @pymethod |PyINameSpaceTreeControl|HitTest|Description of HitTest. PyObject *PyINameSpaceTreeControl::HitTest(PyObject *self, PyObject *args) { INameSpaceTreeControl *pINSTC = GetI(self); if ( pINSTC == NULL ) return NULL; POINT pt; // @pyparm (int, int)|pt||Description for ppt IShellItem * ppsiOut; if ( !PyArg_ParseTuple(args, "(ii):HitTest", &pt.x, &pt.y) ) return NULL; HRESULT hr; PY_INTERFACE_PRECALL; hr = pINSTC->HitTest( &pt, &ppsiOut ); PY_INTERFACE_POSTCALL; if ( FAILED(hr) ) return PyCom_BuildPyException(hr, pINSTC, IID_INameSpaceTreeControl ); return PyCom_PyObjectFromIUnknown(ppsiOut, IID_IShellItem, FALSE); } // @pymethod |PyINameSpaceTreeControl|GetItemRect|Description of GetItemRect. PyObject *PyINameSpaceTreeControl::GetItemRect(PyObject *self, PyObject *args) { INameSpaceTreeControl *pINSTC = GetI(self); if ( pINSTC == NULL ) return NULL; PyObject *obpsi; IShellItem * psi; if ( !PyArg_ParseTuple(args, "O:GetItemRect", &obpsi) ) return NULL; if (!PyCom_InterfaceFromPyInstanceOrObject(obpsi, IID_IShellItem, (void **)&psi, TRUE /* bNoneOK */)) return NULL; RECT rect; HRESULT hr; PY_INTERFACE_PRECALL; hr = pINSTC->GetItemRect( psi, &rect ); if (psi) psi->Release(); PY_INTERFACE_POSTCALL; if ( FAILED(hr) ) return PyCom_BuildPyException(hr, pINSTC, IID_INameSpaceTreeControl ); return Py_BuildValue("iiii", rect.left, rect.top, rect.right, rect.bottom); } // @pymethod |PyINameSpaceTreeControl|CollapseAll|Description of CollapseAll. PyObject *PyINameSpaceTreeControl::CollapseAll(PyObject *self, PyObject *args) { INameSpaceTreeControl *pINSTC = GetI(self); if ( pINSTC == NULL ) return NULL; if ( !PyArg_ParseTuple(args, ":CollapseAll") ) return NULL; HRESULT hr; PY_INTERFACE_PRECALL; hr = pINSTC->CollapseAll( ); PY_INTERFACE_POSTCALL; if ( FAILED(hr) ) return PyCom_BuildPyException(hr, pINSTC, IID_INameSpaceTreeControl ); Py_INCREF(Py_None); return Py_None; } // @object PyINameSpaceTreeControl|Description of the interface static struct PyMethodDef PyINameSpaceTreeControl_methods[] = { { "Initialize", PyINameSpaceTreeControl::Initialize, 1 }, // @pymeth Initialize|Description of Initialize { "TreeAdvise", PyINameSpaceTreeControl::TreeAdvise, 1 }, // @pymeth TreeAdvise|Description of TreeAdvise { "TreeUnadvise", PyINameSpaceTreeControl::TreeUnadvise, 1 }, // @pymeth TreeUnadvise|Description of TreeUnadvise { "AppendRoot", PyINameSpaceTreeControl::AppendRoot, 1 }, // @pymeth AppendRoot|Description of AppendRoot { "InsertRoot", PyINameSpaceTreeControl::InsertRoot, 1 }, // @pymeth InsertRoot|Description of InsertRoot { "RemoveRoot", PyINameSpaceTreeControl::RemoveRoot, 1 }, // @pymeth RemoveRoot|Description of RemoveRoot { "RemoveAllRoots", PyINameSpaceTreeControl::RemoveAllRoots, 1 }, // @pymeth RemoveAllRoots|Description of RemoveAllRoots { "GetRootItems", PyINameSpaceTreeControl::GetRootItems, 1 }, // @pymeth GetRootItems|Description of GetRootItems { "SetItemState", PyINameSpaceTreeControl::SetItemState, 1 }, // @pymeth SetItemState|Description of SetItemState { "GetItemState", PyINameSpaceTreeControl::GetItemState, 1 }, // @pymeth GetItemState|Description of GetItemState { "GetSelectedItems", PyINameSpaceTreeControl::GetSelectedItems, 1 }, // @pymeth GetSelectedItems|Description of GetSelectedItems { "GetItemCustomState", PyINameSpaceTreeControl::GetItemCustomState, 1 }, // @pymeth GetItemCustomState|Description of GetItemCustomState { "SetItemCustomState", PyINameSpaceTreeControl::SetItemCustomState, 1 }, // @pymeth SetItemCustomState|Description of SetItemCustomState { "EnsureItemVisible", PyINameSpaceTreeControl::EnsureItemVisible, 1 }, // @pymeth EnsureItemVisible|Description of EnsureItemVisible { "SetTheme", PyINameSpaceTreeControl::SetTheme, 1 }, // @pymeth SetTheme|Description of SetTheme { "GetNextItem", PyINameSpaceTreeControl::GetNextItem, 1 }, // @pymeth GetNextItem|Description of GetNextItem { "HitTest", PyINameSpaceTreeControl::HitTest, 1 }, // @pymeth HitTest|Description of HitTest { "GetItemRect", PyINameSpaceTreeControl::GetItemRect, 1 }, // @pymeth GetItemRect|Description of GetItemRect { "CollapseAll", PyINameSpaceTreeControl::CollapseAll, 1 }, // @pymeth CollapseAll|Description of CollapseAll { NULL } }; PyComTypeObject PyINameSpaceTreeControl::type("PyINameSpaceTreeControl", &PyIUnknown::type, sizeof(PyINameSpaceTreeControl), PyINameSpaceTreeControl_methods, GET_PYCOM_CTOR(PyINameSpaceTreeControl)); --- NEW FILE: PyINameSpaceTreeControl.h --- // This file declares the INameSpaceTreeControl Interface and Gateway for Python. // Generated by makegw.py // --------------------------------------------------- // // Interface Declaration class PyINameSpaceTreeControl : public PyIUnknown { public: MAKE_PYCOM_CTOR(PyINameSpaceTreeControl); static INameSpaceTreeControl *GetI(PyObject *self); static PyComTypeObject type; // The Python methods static PyObject *Initialize(PyObject *self, PyObject *args); static PyObject *TreeAdvise(PyObject *self, PyObject *args); static PyObject *TreeUnadvise(PyObject *self, PyObject *args); static PyObject *AppendRoot(PyObject *self, PyObject *args); static PyObject *InsertRoot(PyObject *self, PyObject *args); static PyObject *RemoveRoot(PyObject *self, PyObject *args); static PyObject *RemoveAllRoots(PyObject *self, PyObject *args); static PyObject *GetRootItems(PyObject *self, PyObject *args); static PyObject *SetItemState(PyObject *self, PyObject *args); static PyObject *GetItemState(PyObject *self, PyObject *args); static PyObject *GetSelectedItems(PyObject *self, PyObject *args); static PyObject *GetItemCustomState(PyObject *self, PyObject *args); static PyObject *SetItemCustomState(PyObject *self, PyObject *args); static PyObject *EnsureItemVisible(PyObject *self, PyObject *args); static PyObject *SetTheme(PyObject *self, PyObject *args); static PyObject *GetNextItem(PyObject *self, PyObject *args); static PyObject *HitTest(PyObject *self, PyObject *args); static PyObject *GetItemRect(PyObject *self, PyObject *args); static PyObject *CollapseAll(PyObject *self, PyObject *args); protected: PyINameSpaceTreeControl(IUnknown *pdisp); ~PyINameSpaceTreeControl(); }; // --------------------------------------------------- // // Gateway Declaration class PyGNameSpaceTreeControl : public PyGatewayBase, public INameSpaceTreeControl { protected: PyGNameSpaceTreeControl(PyObject *instance) : PyGatewayBase(instance) { ; } PYGATEWAY_MAKE_SUPPORT2(PyGNameSpaceTreeControl, INameSpaceTreeControl, IID_INameSpaceTreeControl, PyGatewayBase) // INameSpaceTreeControl STDMETHOD(Initialize)( HWND hwndParent, RECT * prc, DWORD nsctsFlags); STDMETHOD(TreeAdvise)( IUnknown * punk, DWORD * pdwCookie); STDMETHOD(TreeUnadvise)( DWORD dwCookie); STDMETHOD(AppendRoot)( IShellItem * psiRoot, DWORD grfEnumFlags, DWORD grfRootStyle, IShellItemFilter * pif); STDMETHOD(InsertRoot)( int iIndex, IShellItem * psiRoot, DWORD grfEnumFlags, DWORD grfRootStyle, IShellItemFilter * pif); STDMETHOD(RemoveRoot)( IShellItem * psiRoot); STDMETHOD(RemoveAllRoots)( void); STDMETHOD(GetRootItems)( IShellItemArray ** ppsiaRootItems); STDMETHOD(SetItemState)( IShellItem * psi, DWORD nstcisMask, DWORD nstcisFlags); STDMETHOD(GetItemState)( IShellItem * psi, DWORD nstcisMask, DWORD * pnstcisFlags); STDMETHOD(GetSelectedItems)( IShellItemArray ** psiaItems); STDMETHOD(GetItemCustomState)( IShellItem * psi, int * piStateNumber); STDMETHOD(SetItemCustomState)( IShellItem * psi, int iStateNumber); STDMETHOD(EnsureItemVisible)( IShellItem * psi); STDMETHOD(SetTheme)( LPCWSTR pszTheme); STDMETHOD(GetNextItem)( IShellItem * psi, DWORD nstcgi, IShellItem ** ppsiNext); STDMETHOD(HitTest)( POINT * ppt, IShellItem ** ppsiOut); STDMETHOD(GetItemRect)( IShellItem * psi, RECT * prect); STDMETHOD(CollapseAll)( void); }; Index: shell.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/shell/src/shell.cpp,v retrieving revision 1.64 retrieving revision 1.65 diff -C2 -d -r1.64 -r1.65 *** shell.cpp 24 Jul 2008 23:22:56 -0000 1.64 --- shell.cpp 26 Jul 2008 07:02:35 -0000 1.65 *************** *** 60,63 **** --- 60,64 ---- #include "PyIShellItem.h" #include "PyIShellItemArray.h" + #include "PyINameSpaceTreeControl.h" #include "PythonCOMRegister.h" // For simpler registration of IIDs etc. *************** *** 136,139 **** --- 137,159 ---- static PFNSHCreateDefaultContextMenu pfnSHCreateDefaultContextMenu = NULL; + typedef HRESULT (WINAPI *PFNSHCreateItemFromIDList)(PCIDLIST_ABSOLUTE, REFIID, void **); + static PFNSHCreateItemFromIDList pfnSHCreateItemFromIDList = NULL; + + typedef HRESULT (WINAPI *PFNSHCreateItemFromParsingName)(PCWSTR, IBindCtx *, REFIID, void **); + static PFNSHCreateItemFromParsingName pfnSHCreateItemFromParsingName = NULL; + + typedef HRESULT (WINAPI *PFNSHCreateItemFromRelativeName)(IShellItem *, PCWSTR, IBindCtx *, REFIID, void **); + static PFNSHCreateItemFromRelativeName pfnSHCreateItemFromRelativeName = NULL; + + typedef HRESULT (WINAPI *PFNSHCreateItemInKnownFolder)(REFKNOWNFOLDERID, DWORD, PCWSTR, REFIID, void **); + static PFNSHCreateItemInKnownFolder pfnSHCreateItemInKnownFolder = NULL; + + typedef HRESULT (WINAPI *PFNSHCreateItemWithParent)(PCIDLIST_ABSOLUTE, IShellFolder *, PCUITEMID_CHILD, REFIID, void **); + static PFNSHCreateItemWithParent pfnSHCreateItemWithParent = NULL; + + typedef HRESULT (WINAPI *PFNSHGetIDListFromObject)(IUnknown *, PIDLIST_ABSOLUTE *); + static PFNSHGetIDListFromObject pfnSHGetIDListFromObject = NULL; + + void PyShell_FreeMem(void *p) { *************** *** 2863,2866 **** --- 2883,3189 ---- } + // @pymethod |shell|SHCreateItemFromIDList|Creates and initializes a Shell item + // object from a PIDL. The resulting shell item object supports the IShellItem interface. + static PyObject *PySHCreateItemFromIDList(PyObject *self, PyObject *args) + { + // @comm This function is only available on Vista and later; a + // COM exception with E_NOTIMPL will be thrown if the function can't be located. + if (pfnSHCreateItemFromIDList==NULL) + return PyCom_BuildPyException(E_NOTIMPL); + PyObject *ret = NULL; + PyObject *obiid; + PyObject *obpidl; + if(!PyArg_ParseTuple(args, "OO:SHCreateItemFromIDList", &obpidl, &obiid)) + return NULL; + PIDLIST_ABSOLUTE pidl; + IID iid; + // @pyparm PIDL|parent|| + if (!PyObject_AsPIDL(obpidl, &pidl)) + goto done; + // @pyparm <o PyIID>|iid|| + if (!PyWinObject_AsIID(obiid, &iid)) + goto done; + HRESULT hr; + void *out; + { + PY_INTERFACE_PRECALL; + hr = (*pfnSHCreateItemFromIDList)(pidl, iid, &out); + PY_INTERFACE_POSTCALL; + } + if (FAILED(hr)) { + PyCom_BuildPyException(hr); + goto done; + } + ret = PyCom_PyObjectFromIUnknown((IUnknown *)out, iid, FALSE); + done: + if (pidl) + PyObject_FreePIDL(pidl); + return ret; + } + + // @pymethod |shell|SHCreateItemFromParsingName|Creates and initializes a Shell item object from a parsing name. + static PyObject *PySHCreateItemFromParsingName(PyObject *self, PyObject *args) + { + // @comm This function is only available on Vista and later; a + // COM exception with E_NOTIMPL will be thrown if the function can't be located. + if (pfnSHCreateItemFromParsingName==NULL) + return PyCom_BuildPyException(E_NOTIMPL); + + PyObject *ret = NULL; + PyObject *obname, *obctx, *obiid; + // @pyparm unicode|name|| + // @pyparm <i PyIBindCtx>|ctx|| + // @pyparm <o PyIID>|iid|| + + if(!PyArg_ParseTuple(args, "OOO:SHCreateItemFromParsingName", &obname, &obctx, &obiid)) + return NULL; + + IBindCtx *ctx = NULL; + IID iid; + WCHAR *name = NULL; + void *out = NULL; + HRESULT hr; + + if (!PyCom_InterfaceFromPyInstanceOrObject(obctx, IID_IBindCtx, (void **)&ctx, TRUE /* bNoneOK */)) + goto done; + + if (!PyWinObject_AsIID(obiid, &iid)) + goto done; + + if (!PyWinObject_AsWCHAR(obname, &name)) + goto done; + + { + PY_INTERFACE_PRECALL; + hr = (*pfnSHCreateItemFromParsingName)(name, ctx, iid, &out); + PY_INTERFACE_POSTCALL; + } + if (FAILED(hr)) { + PyCom_BuildPyException(hr); + goto done; + } + ret = PyCom_PyObjectFromIUnknown((IUnknown *)out, iid, FALSE); + + done: + if (ctx) { + PY_INTERFACE_PRECALL; + ctx->Release(); + PY_INTERFACE_POSTCALL; + } + if (name) + PyWinObject_FreeWCHAR(name); + + return ret; + } + + // @pymethod |shell|SHCreateItemFromRelativeName|Creates and initializes a Shell item object from a relative parsing name. + static PyObject *PySHCreateItemFromRelativeName(PyObject *self, PyObject *args) + { + // @comm This function is only available on Vista and later; a + // COM exception with E_NOTIMPL will be thrown if the function can't be located. + if (pfnSHCreateItemFromRelativeName==NULL) + return PyCom_BuildPyException(E_NOTIMPL); + + PyObject *ret = NULL; + PyObject *obname, *obctx, *obiid, *obparent; + // @pyparm <o PyIShellItem>|parent|| + // @pyparm unicode|name|| + // @pyparm <i PyIBindCtx>|ctx|| + // @pyparm <o PyIID>|iid|| + + if(!PyArg_ParseTuple(args, "OOOO:SHCreateItemFromRelativeName", &obparent, &obname, &obctx, &obiid)) + return NULL; + + IBindCtx *ctx = NULL; + IShellItem *parent = NULL; + IID iid; + WCHAR *name = NULL; + void *out = NULL; + HRESULT hr; + + if (!PyCom_InterfaceFromPyInstanceOrObject(obparent, IID_IShellItem, (void **)&parent, FALSE/* bNoneOK */)) + goto done; + + if (!PyCom_InterfaceFromPyInstanceOrObject(obctx, IID_IBindCtx, (void **)&ctx, TRUE /* bNoneOK */)) + goto done; + + if (!PyWinObject_AsIID(obiid, &iid)) + goto done; + + if (!PyWinObject_AsWCHAR(obname, &name)) + goto done; + + { + PY_INTERFACE_PRECALL; + hr = (*pfnSHCreateItemFromRelativeName)(parent, name, ctx, iid, &out); + PY_INTERFACE_POSTCALL; + } + if (FAILED(hr)) { + PyCom_BuildPyException(hr); + goto done; + } + ret = PyCom_PyObjectFromIUnknown((IUnknown *)out, iid, FALSE); + + done: + if (ctx || parent) { + PY_INTERFACE_PRECALL; + if (ctx) + ctx->Release(); + if (parent) + parent->Release(); + PY_INTERFACE_POSTCALL; + } + if (name) + PyWinObject_FreeWCHAR(name); + + return ret; + } + + // @pymethod |shell|SHCreateItemInKnownFolder|Creates a Shell item object for a single file that exists inside a known folder. + static PyObject *PySHCreateItemInKnownFolder(PyObject *self, PyObject *args) + { + // @comm This function is only available on Vista and later; a + // COM exception with E_NOTIMPL will be thrown if the function can't be located. + if (pfnSHCreateItemInKnownFolder==NULL) + return PyCom_BuildPyException(E_NOTIMPL); + + PyObject *ret = NULL; + DWORD flags; + PyObject *obname, *obiid, *obguid; + // @pyparm unicode|name|| + // @pyparm <i PyIBindCtx>|ctx|| + // @pyparm <o PyIID>|iid|| + + if(!PyArg_ParseTuple(args, "OkOO:SHCreateItemInKnownFolder", &obguid, &flags, &obname, &obiid)) + return NULL; + + IID iid; + GUID guid; + WCHAR *name = NULL; + void *out = NULL; + HRESULT hr; + + if (!PyWinObject_AsIID(obguid, &guid)) + goto done; + + if (!PyWinObject_AsIID(obiid, &iid)) + goto done; + + if (!PyWinObject_AsWCHAR(obname, &name, TRUE)) + goto done; + + { + PY_INTERFACE_PRECALL; + hr = (*pfnSHCreateItemInKnownFolder)(guid, flags, name, iid, &out); + PY_INTERFACE_POSTCALL; + } + if (FAILED(hr)) { + PyCom_BuildPyException(hr); + goto done; + } + ret = PyCom_PyObjectFromIUnknown((IUnknown *)out, iid, FALSE); + done: + if (name) + PyWinObject_FreeWCHAR(name); + + return ret; + } + + // @pymethod |shell|SHCreateItemWithParent|Create a Shell item, given a parent folder and a child item ID. + static PyObject *PySHCreateItemWithParent(PyObject *self, PyObject *args) + { + // @comm This function is only available on Vista and later; a + // COM exception with E_NOTIMPL will be thrown if the function can't be located. + if (pfnSHCreateItemWithParent==NULL) + return PyCom_BuildPyException(E_NOTIMPL); + PyObject *ret = NULL; + PyObject *obpidlparent, *obsfparent, *obpidl, *obiid; + if(!PyArg_ParseTuple(args, "OOOO:SHCreateItemWithParent", &obpidlparent, &obsfparent, &obpidl, &obiid)) + return NULL; + IID iid; + PIDLIST_ABSOLUTE parentpidl; + PUITEMID_CHILD pidl; + IShellFolder *sfparent; + + // @pyparm PIDL|parent|| + // @pyparm <o PyIShellFolder>|parent|| + // @pyparm PIDL|child|| + // @pyparm <o PyIID>|iid|| + if (!PyObject_AsPIDL(obpidlparent, &parentpidl, TRUE)) + goto done; + if (!PyObject_AsPIDL(obpidl, &pidl)) + goto done; + if (!PyWinObject_AsIID(obiid, &iid)) + goto done; + if (!PyCom_InterfaceFromPyInstanceOrObject(obsfparent, IID_IShellFolder, (void **)&sfparent, TRUE /* bNoneOK */)) + goto done; + + HRESULT hr; + void *out; + { + PY_INTERFACE_PRECALL; + hr = (*pfnSHCreateItemWithParent)(parentpidl, sfparent, pidl, iid, &out); + PY_INTERFACE_POSTCALL; + } + if (FAILED(hr)) { + PyCom_BuildPyException(hr); + goto done; + } + ret = PyCom_PyObjectFromIUnknown((IUnknown *)out, iid, FALSE); + done: + if (parentpidl) + PyObject_FreePIDL(parentpidl); + if (pidl) + PyObject_FreePIDL(pidl); + if (sfparent) { + PY_INTERFACE_PRECALL; + sfparent->Release(); + PY_INTERFACE_POSTCALL; + } + + return ret; + } + + // @pymethod |shell|SHGetIDListFromObject|Retrieves the PIDL of an object. + static PyObject *PySHGetIDListFromObject(PyObject *self, PyObject *args) + { + // @comm This function is only available on Vista and later; a + // COM exception with E_NOTIMPL will be thrown if the function can't be located. + if (pfnSHGetIDListFromObject==NULL) + return PyCom_BuildPyException(E_NOTIMPL); + + PyObject *ret = NULL; + PyObject *ob; + + // @pyparm <o PyIUnknown>|unk|| + + if(!PyArg_ParseTuple(args, "O:SHGetIDListFromObject", &ob)) + return NULL; + + IUnknown *unk; + PIDLIST_ABSOLUTE pidl; + HRESULT hr; + if (!PyCom_InterfaceFromPyInstanceOrObject(ob, IID_IUnknown, (void **)&unk, FALSE/* bNoneOK */)) + goto done; + + { + PY_INTERFACE_PRECALL; + hr = (*pfnSHGetIDListFromObject)(unk, &pidl); + PY_INTERFACE_POSTCALL; + } + if (FAILED(hr)) { + PyCom_BuildPyException(hr); + goto done; + } + ret = PyObject_FromPIDL(pidl, TRUE); + done: + if (unk) { + PY_INTERFACE_PRECALL; + unk->Release(); + PY_INTERFACE_POSTCALL; + } + return ret; + } + /* List of module functions */ *************** *** 2901,2904 **** --- 3224,3233 ---- { "SHChangeNotifyRegister", PySHChangeNotifyRegister, 1}, // @pymeth SHChangeNotifyRegister|Registers a window that receives notifications from the file system or shell. { "SHChangeNotifyDeregister", PySHChangeNotifyDeregister, 1}, // @pymeth SHChangeNotifyDeregister|Unregisters the client's window process from receiving notification events + { "SHCreateItemFromIDList", PySHCreateItemFromIDList, 1}, // @pymeth SHCreateItemFromIDList|Creates and initializes a Shell item object. + { "SHCreateItemFromParsingName", PySHCreateItemFromParsingName, 1}, // @pymeth SHCreateItemFromParsingName|Creates and initializes a Shell item object from a parsing name. + { "SHCreateItemFromRelativeName", PySHCreateItemFromRelativeName, 1}, // @pymeth SHCreateItemFromRelativeName|Creates and initializes a Shell item object from a relative parsing name. + { "SHCreateItemInKnownFolder", PySHCreateItemInKnownFolder, 1}, // @pymeth SHCreateItemInKnownFolder|Creates a Shell item object for a single file that exists inside a known folder. + { "SHCreateItemWithParent", PySHCreateItemWithParent, 1}, // @pymeth SHCreateItemWithParent|Create a Shell item, given a parent folder and a child item ID. + { "SHGetIDListFromObject", PySHGetIDListFromObject, 1}, // @pymeth SHGetIDListFromObject|Retrieves the PIDL of an object. { "SHGetInstanceExplorer", PySHGetInstanceExplorer, 1}, // @pymeth SHGetInstanceExplorer|Allows components that run in a Web browser (Iexplore.exe) or a nondefault Windows® Explorer (Explorer.exe) process to hold a reference to the process. The components can use the reference to prevent the process from closing prematurely. { "SHFileOperation", PySHFileOperation, 1}, // @pymeth SHFileOperation|Copies, moves, renames, or deletes a file system object. *************** *** 2959,2962 **** --- 3288,3292 ---- PYCOM_INTERFACE_SERVER_ONLY(ExplorerCommandProvider), PYCOM_INTERFACE_CLIENT_ONLY(ExplorerPaneVisibility), + PYCOM_INTERFACE_CLIENT_ONLY(NameSpaceTreeControl), // IID_ICopyHook doesn't exist - hack it up { &IID_IShellCopyHook, "IShellCopyHook", "IID_IShellCopyHook", &PyICopyHook::type, GET_PYGATEWAY_CTOR(PyGCopyHook) }, *************** *** 3036,3039 **** --- 3366,3376 ---- pfnSHCreateDefaultContextMenu=(PFNSHCreateDefaultContextMenu)GetProcAddress(shell32, "SHCreateDefaultContextMenu"); pfnSHCreateDataObject=(PFNSHCreateDataObject)GetProcAddress(shell32, "SHCreateDataObject"); + pfnSHCreateItemFromIDList =(PFNSHCreateItemFromIDList)GetProcAddress(shell32, "SHCreateItemFromIDList"); + pfnSHCreateItemFromParsingName =(PFNSHCreateItemFromParsingName)GetProcAddress(shell32, "SHCreateItemFromParsingName"); + pfnSHCreateItemFromRelativeName =(PFNSHCreateItemFromRelativeName)GetProcAddress(shell32, "SHCreateItemFromRelativeName"); + pfnSHCreateItemInKnownFolder =(PFNSHCreateItemInKnownFolder)GetProcAddress(shell32, "SHCreateItemInKnownFolder"); + pfnSHCreateItemWithParent =(PFNSHCreateItemWithParent)GetProcAddress(shell32, "SHCreateItemWithParent"); + pfnSHGetIDListFromObject =(PFNSHGetIDListFromObject)GetProcAddress(shell32, "SHGetIDListFromObject"); + } // SHGetFolderPath comes from shfolder.dll on older systems |
From: Mark H. <mha...@us...> - 2008-07-26 07:02:26
|
Update of /cvsroot/pywin32/pywin32/com/win32comext/shell In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2322/com/win32comext/shell Modified Files: shellcon.py Log Message: Support for INameSpaceTreeControl and new functions: SHCreateItemFromIDList, SHCreateItemFromParsingName, SHCreateItemFromRelativeName, SHCreateItemInKnownFolder, SHCreateItemWithParent and SHGetIDListFromObject and tests. Index: shellcon.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/shell/shellcon.py,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** shellcon.py 7 Feb 2008 05:17:05 -0000 1.18 --- shellcon.py 26 Jul 2008 07:02:34 -0000 1.19 *************** *** 144,147 **** --- 144,150 ---- GIL_FORSHELL = 2 GIL_ASYNC = 32 + GIL_DEFAULTICON = 64 + GIL_FORSHORTCUT = 128 + GIL_CHECKSHIELD = 512 GIL_SIMULATEDOC = 1 GIL_PERINSTANCE = 2 *************** *** 149,152 **** --- 152,157 ---- GIL_NOTFILENAME = 8 GIL_DONTCACHE = 16 + GIL_SHIELD = 512 + GIL_FORCENOSHIELD = 1024 ISIOI_ICONFILE = 1 ISIOI_ICONINDEX = 2 *************** *** 1139,1142 **** --- 1144,1195 ---- ASSOCCLASS_STAR = 9 # none + NSTCS_HASEXPANDOS = 0x1 + NSTCS_HASLINES = 0x2 + NSTCS_SINGLECLICKEXPAND = 0x4 + NSTCS_FULLROWSELECT = 0x8 + NSTCS_SPRINGEXPAND = 0x10 + NSTCS_HORIZONTALSCROLL = 0x20 + NSTCS_ROOTHASEXPANDO = 0x40 + NSTCS_SHOWSELECTIONALWAYS = 0x80 + NSTCS_NOINFOTIP = 0x200 + NSTCS_EVENHEIGHT = 0x400 + NSTCS_NOREPLACEOPEN = 0x800 + NSTCS_DISABLEDRAGDROP = 0x1000 + NSTCS_NOORDERSTREAM = 0x2000 + NSTCS_RICHTOOLTIP = 0x4000 + NSTCS_BORDER = 0x8000 + NSTCS_NOEDITLABELS = 0x10000 + NSTCS_TABSTOP = 0x20000 + NSTCS_FAVORITESMODE = 0x80000 + NSTCS_AUTOHSCROLL = 0x100000 + NSTCS_FADEINOUTEXPANDOS = 0x200000 + NSTCS_EMPTYTEXT = 0x400000 + NSTCS_CHECKBOXES = 0x800000 + NSTCS_PARTIALCHECKBOXES = 0x1000000 + NSTCS_EXCLUSIONCHECKBOXES = 0x2000000 + NSTCS_DIMMEDCHECKBOXES = 0x4000000 + NSTCS_NOINDENTCHECKS = 0x8000000 + NSTCS_ALLOWJUNCTIONS = 0x10000000 + NSTCS_SHOWTABSBUTTON = 0x20000000 + NSTCS_SHOWDELETEBUTTON = 0x40000000 + NSTCS_SHOWREFRESHBUTTON = -2147483648 # 0x80000000 + + NSTCRS_VISIBLE = 0 + NSTCRS_HIDDEN = 0x1 + NSTCRS_EXPANDED = 0x2 + NSTCIS_NONE = 0 + NSTCIS_SELECTED = 0x1 + NSTCIS_EXPANDED = 0x2 + NSTCIS_BOLD = 0x4 + NSTCIS_DISABLED = 0x8 + NSTCGNI_NEXT = 0 + NSTCGNI_NEXTVISIBLE = 0x1 + NSTCGNI_PREV = 0x2 + NSTCGNI_PREVVISIBLE = 0x3 + NSTCGNI_PARENT = 0x4 + NSTCGNI_CHILD = 0x5 + NSTCGNI_FIRSTVISIBLE = 0x6 + NSTCGNI_LASTVISIBLE = 0x7 + CLSID_ExplorerBrowser = "{71f96385-ddd6-48d3-a0c1-ae06e8b055fb}" |
From: Mark H. <mha...@us...> - 2008-07-26 07:02:26
|
Update of /cvsroot/pywin32/pywin32/com/win32comext/shell/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2322/com/win32comext/shell/test Added Files: testShellItem.py Log Message: Support for INameSpaceTreeControl and new functions: SHCreateItemFromIDList, SHCreateItemFromParsingName, SHCreateItemFromRelativeName, SHCreateItemInKnownFolder, SHCreateItemWithParent and SHGetIDListFromObject and tests. --- NEW FILE: testShellItem.py --- # Test IShellItem and related interfaces from win32com.shell import shell, shellcon, knownfolders import unittest class TestShellItem(unittest.TestCase): def assertShellItemsEqual(self, i1, i2): n1 = i1.GetDisplayName(shellcon.SHGDN_FORPARSING) n2 = i2.GetDisplayName(shellcon.SHGDN_FORPARSING) self.assertEqual(n1, n2) def test_idlist_roundtrip(self): pidl = shell.SHGetSpecialFolderLocation(0, shellcon.CSIDL_DESKTOP) item = shell.SHCreateItemFromIDList(pidl, shell.IID_IShellItem) pidl_back = shell.SHGetIDListFromObject(item) self.assertEqual(pidl, pidl_back) def test_parsing_name(self): sf = shell.SHGetDesktopFolder() flags = shellcon.SHCONTF_FOLDERS | shellcon.SHCONTF_NONFOLDERS children = sf.EnumObjects(0, flags) child_pidl = children.next() name = sf.GetDisplayNameOf(child_pidl, shellcon.SHGDN_FORPARSING) item = shell.SHCreateItemFromParsingName(name, None, shell.IID_IShellItem) # test the name we get from the item is the same as from the folder. self.assertEqual(name, item.GetDisplayName(shellcon.SHGDN_FORPARSING)) def test_parsing_relative(self): desktop_pidl = shell.SHGetSpecialFolderLocation(0, shellcon.CSIDL_DESKTOP) desktop_item = shell.SHCreateItemFromIDList(desktop_pidl, shell.IID_IShellItem) sf = shell.SHGetDesktopFolder() flags = shellcon.SHCONTF_FOLDERS | shellcon.SHCONTF_NONFOLDERS children = sf.EnumObjects(0, flags) child_pidl = children.next() name_flags = shellcon.SHGDN_FORPARSING | shellcon.SHGDN_INFOLDER name = sf.GetDisplayNameOf(child_pidl, name_flags) item = shell.SHCreateItemFromRelativeName(desktop_item, name, None, shell.IID_IShellItem) # test the name we get from the item is the same as from the folder. self.assertEqual(name, item.GetDisplayName(name_flags)) def test_create_in_known_folder(self): item = shell.SHCreateItemInKnownFolder(knownfolders.FOLDERID_Desktop, 0, None, shell.IID_IShellItem) # this will do for now :) def test_create_item_with_parent(self): desktop_pidl = shell.SHGetSpecialFolderLocation(0, shellcon.CSIDL_DESKTOP) desktop_item = shell.SHCreateItemFromIDList(desktop_pidl, shell.IID_IShellItem) sf = shell.SHGetDesktopFolder() flags = shellcon.SHCONTF_FOLDERS | shellcon.SHCONTF_NONFOLDERS children = sf.EnumObjects(0, flags) child_pidl = children.next() item1 = shell.SHCreateItemWithParent(desktop_pidl, None, child_pidl, shell.IID_IShellItem) item2 = shell.SHCreateItemWithParent(None, sf, child_pidl, shell.IID_IShellItem) self.assertShellItemsEqual(item1, item2) if __name__=='__main__': unittest.main() |
From: Mark H. <mha...@us...> - 2008-07-26 07:02:26
|
Update of /cvsroot/pywin32/pywin32/com/win32comext/shell/demos In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2322/com/win32comext/shell/demos Modified Files: explorer_browser.py Log Message: Support for INameSpaceTreeControl and new functions: SHCreateItemFromIDList, SHCreateItemFromParsingName, SHCreateItemFromRelativeName, SHCreateItemInKnownFolder, SHCreateItemWithParent and SHGetIDListFromObject and tests. Index: explorer_browser.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/shell/demos/explorer_browser.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** explorer_browser.py 8 Jan 2008 00:41:44 -0000 1.1 --- explorer_browser.py 26 Jul 2008 07:02:34 -0000 1.2 *************** *** 3,6 **** --- 3,7 ---- # * CPU sits at 100% while running. + import sys import pythoncom from win32com.shell import shell, shellcon *************** *** 61,66 **** flags = (shellcon.FVM_LIST, shellcon.FWF_AUTOARRANGE | shellcon.FWF_NOWEBVIEW) eb.Initialize(self.hwnd, rect, (0, shellcon.FVM_DETAILS)) ! # And start browsing at the root of the namespace. ! eb.BrowseToIDList([], shellcon.SBSP_ABSOLUTE) #eb.FillFromObject(None, shellcon.EBF_NODROPTARGET); #eb.SetEmptyText("No known folders yet..."); --- 62,93 ---- flags = (shellcon.FVM_LIST, shellcon.FWF_AUTOARRANGE | shellcon.FWF_NOWEBVIEW) eb.Initialize(self.hwnd, rect, (0, shellcon.FVM_DETAILS)) ! if len(sys.argv)==2: ! # If an arg was specified, ask the desktop parse it. ! # You can pass anything explorer accepts as its '/e' argument - ! # eg, "::{guid}\::{guid}" etc. ! # "::{20D04FE0-3AEA-1069-A2D8-08002B30309D}" is "My Computer" ! pidl = shell.SHGetDesktopFolder().ParseDisplayName(0, None, sys.argv[1])[1] ! else: ! # And start browsing at the root of the namespace. ! pidl = [] ! eb.BrowseToIDList(pidl, shellcon.SBSP_ABSOLUTE) ! # and for some reason the "Folder" view in the navigator pane doesn't ! # magically synchronize itself - so let's do that ourself. ! # Get the tree control. ! sp = eb.QueryInterface(pythoncom.IID_IServiceProvider) ! try: ! tree = sp.QueryService(shell.IID_INameSpaceTreeControl, ! shell.IID_INameSpaceTreeControl) ! except pythoncom.com_error, exc: ! # this should really only fail if no "nav" frame exists... ! print "Strange - failed to get the tree control even though " \ ! "we asked for a EBO_SHOWFRAMES" ! print exc ! else: ! # get the IShellItem for the selection. ! si = shell.SHCreateItemFromIDList(pidl, shell.IID_IShellItem) ! # set it to selected. ! tree.SetItemState(si, shellcon.NSTCIS_SELECTED, shellcon.NSTCIS_SELECTED) ! #eb.FillFromObject(None, shellcon.EBF_NODROPTARGET); #eb.SetEmptyText("No known folders yet..."); |
From: Mark H. <mha...@us...> - 2008-07-26 07:02:26
|
Update of /cvsroot/pywin32/pywin32 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2322 Modified Files: setup.py Log Message: Support for INameSpaceTreeControl and new functions: SHCreateItemFromIDList, SHCreateItemFromParsingName, SHCreateItemFromRelativeName, SHCreateItemInKnownFolder, SHCreateItemWithParent and SHGetIDListFromObject and tests. Index: setup.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/setup.py,v retrieving revision 1.76 retrieving revision 1.77 diff -C2 -d -r1.76 -r1.77 *** setup.py 24 Jul 2008 23:22:56 -0000 1.76 --- setup.py 26 Jul 2008 07:02:34 -0000 1.77 *************** *** 1523,1526 **** --- 1523,1527 ---- %(shell)s/PyIExtractImage.cpp %(shell)s/PyIInputObject.cpp + %(shell)s/PyINameSpaceTreeControl.cpp %(shell)s/PyIPersistFolder.cpp %(shell)s/PyIPersistFolder2.cpp |
From: Mark H. <mha...@us...> - 2008-07-26 07:00:40
|
Update of /cvsroot/pywin32/pywin32/com/win32comext/shell In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1861/com/win32comext/shell Added Files: knownfolders.py Log Message: List of IIDs of "known folders" from knownfolders.h --- NEW FILE: knownfolders.py --- # from KnownFolders.h # legacy CSIDL value: CSIDL_NETWORK # display name: "Network" # legacy display name: "My Network Places" # default path: FOLDERID_NetworkFolder = "{D20BEEC4-5CA8-4905-AE3B-BF251EA09B53}" FOLDERID_ComputerFolder = "{0AC0837C-BBF8-452A-850D-79D08E667CA7}" FOLDERID_InternetFolder = "{4D9F7874-4E0C-4904-967B-40B0D20C3E4B}" FOLDERID_ControlPanelFolder = "{82A74AEB-AEB4-465C-A014-D097EE346D63}" FOLDERID_PrintersFolder = "{76FC4E2D-D6AD-4519-A663-37BD56068185}" FOLDERID_SyncManagerFolder = "{43668BF8-C14E-49B2-97C9-747784D784B7}" FOLDERID_SyncSetupFolder = "{0F214138-B1D3-4a90-BBA9-27CBC0C5389A}" FOLDERID_ConflictFolder = "{4bfefb45-347d-4006-a5be-ac0cb0567192}" FOLDERID_SyncResultsFolder = "{289a9a43-be44-4057-a41b-587a76d7e7f9}" FOLDERID_RecycleBinFolder = "{B7534046-3ECB-4C18-BE4E-64CD4CB7D6AC}" FOLDERID_ConnectionsFolder = "{6F0CD92B-2E97-45D1-88FF-B0D186B8DEDD}" FOLDERID_Fonts = "{FD228CB7-AE11-4AE3-864C-16F3910AB8FE}" # display name: "Desktop" # default path: "C:\Users\<UserName>\Desktop" # legacy default path: "C:\Documents and Settings\<userName>\Desktop" # legacy CSIDL value: CSIDL_DESKTOP FOLDERID_Desktop = "{B4BFCC3A-DB2C-424C-B029-7FE99A87C641}" FOLDERID_Startup = "{B97D20BB-F46A-4C97-BA10-5E3608430854}" FOLDERID_Programs = "{A77F5D77-2E2B-44C3-A6A2-ABA601054A51}" FOLDERID_StartMenu = "{625B53C3-AB48-4EC1-BA1F-A1EF4146FC19}" FOLDERID_Recent = "{AE50C081-EBD2-438A-8655-8A092E34987A}" FOLDERID_SendTo = "{8983036C-27C0-404B-8F08-102D10DCFD74}" FOLDERID_Documents = "{FDD39AD0-238F-46AF-ADB4-6C85480369C7}" FOLDERID_Favorites = "{1777F761-68AD-4D8A-87BD-30B759FA33DD}" FOLDERID_NetHood = "{C5ABBF53-E17F-4121-8900-86626FC2C973}" FOLDERID_PrintHood = "{9274BD8D-CFD1-41C3-B35E-B13F55A758F4}" FOLDERID_Templates = "{A63293E8-664E-48DB-A079-DF759E0509F7}" FOLDERID_CommonStartup = "{82A5EA35-D9CD-47C5-9629-E15D2F714E6E}" FOLDERID_CommonPrograms = "{0139D44E-6AFE-49F2-8690-3DAFCAE6FFB8}" FOLDERID_CommonStartMenu = "{A4115719-D62E-491D-AA7C-E74B8BE3B067}" FOLDERID_PublicDesktop = "{C4AA340D-F20F-4863-AFEF-F87EF2E6BA25}" FOLDERID_ProgramData = "{62AB5D82-FDC1-4DC3-A9DD-070D1D495D97}" FOLDERID_CommonTemplates = "{B94237E7-57AC-4347-9151-B08C6C32D1F7}" FOLDERID_PublicDocuments = "{ED4824AF-DCE4-45A8-81E2-FC7965083634}" FOLDERID_RoamingAppData = "{3EB685DB-65F9-4CF6-A03A-E3EF65729F3D}" FOLDERID_LocalAppData = "{F1B32785-6FBA-4FCF-9D55-7B8E7F157091}" FOLDERID_LocalAppDataLow = "{A520A1A4-1780-4FF6-BD18-167343C5AF16}" FOLDERID_InternetCache = "{352481E8-33BE-4251-BA85-6007CAEDCF9D}" FOLDERID_Cookies = "{2B0F765D-C0E9-4171-908E-08A611B84FF6}" FOLDERID_History = "{D9DC8A3B-B784-432E-A781-5A1130A75963}" FOLDERID_System = "{1AC14E77-02E7-4E5D-B744-2EB1AE5198B7}" FOLDERID_SystemX86 = "{D65231B0-B2F1-4857-A4CE-A8E7C6EA7D27}" FOLDERID_Windows = "{F38BF404-1D43-42F2-9305-67DE0B28FC23}" FOLDERID_Profile = "{5E6C858F-0E22-4760-9AFE-EA3317B67173}" FOLDERID_Pictures = "{33E28130-4E1E-4676-835A-98395C3BC3BB}" FOLDERID_ProgramFilesX86 = "{7C5A40EF-A0FB-4BFC-874A-C0F2E0B9FA8E}" FOLDERID_ProgramFilesCommonX86 = "{DE974D24-D9C6-4D3E-BF91-F4455120B917}" FOLDERID_ProgramFilesX64 = "{6D809377-6AF0-444b-8957-A3773F02200E}" FOLDERID_ProgramFilesCommonX64 = "{6365D5A7-0F0D-45e5-87F6-0DA56B6A4F7D}" FOLDERID_ProgramFiles = "{905e63b6-c1bf-494e-b29c-65b732d3d21a}" FOLDERID_ProgramFilesCommon = "{F7F1ED05-9F6D-47A2-AAAE-29D317C6F066}" FOLDERID_AdminTools = "{724EF170-A42D-4FEF-9F26-B60E846FBA4F}" FOLDERID_CommonAdminTools = "{D0384E7D-BAC3-4797-8F14-CBA229B392B5}" FOLDERID_Music = "{4BD8D571-6D19-48D3-BE97-422220080E43}" FOLDERID_Videos = "{18989B1D-99B5-455B-841C-AB7C74E4DDFC}" FOLDERID_PublicPictures = "{B6EBFB86-6907-413C-9AF7-4FC2ABF07CC5}" FOLDERID_PublicMusic = "{3214FAB5-9757-4298-BB61-92A9DEAA44FF}" FOLDERID_PublicVideos = "{2400183A-6185-49FB-A2D8-4A392A602BA3}" FOLDERID_ResourceDir = "{8AD10C31-2ADB-4296-A8F7-E4701232C972}" FOLDERID_LocalizedResourcesDir = "{2A00375E-224C-49DE-B8D1-440DF7EF3DDC}" FOLDERID_CommonOEMLinks = "{C1BAE2D0-10DF-4334-BEDD-7AA20B227A9D}" FOLDERID_CDBurning = "{9E52AB10-F80D-49DF-ACB8-4330F5687855}" FOLDERID_UserProfiles = "{0762D272-C50A-4BB0-A382-697DCD729B80}" FOLDERID_Playlists = "{DE92C1C7-837F-4F69-A3BB-86E631204A23}" FOLDERID_SamplePlaylists = "{15CA69B3-30EE-49C1-ACE1-6B5EC372AFB5}" FOLDERID_SampleMusic = "{B250C668-F57D-4EE1-A63C-290EE7D1AA1F}" FOLDERID_SamplePictures = "{C4900540-2379-4C75-844B-64E6FAF8716B}" FOLDERID_SampleVideos = "{859EAD94-2E85-48AD-A71A-0969CB56A6CD}" FOLDERID_PhotoAlbums = "{69D2CF90-FC33-4FB7-9A0C-EBB0F0FCB43C}" FOLDERID_Public = "{DFDF76A2-C82A-4D63-906A-5644AC457385}" FOLDERID_ChangeRemovePrograms = "{df7266ac-9274-4867-8d55-3bd661de872d}" FOLDERID_AppUpdates = "{a305ce99-f527-492b-8b1a-7e76fa98d6e4}" FOLDERID_AddNewPrograms = "{de61d971-5ebc-4f02-a3a9-6c82895e5c04}" FOLDERID_Downloads = "{374DE290-123F-4565-9164-39C4925E467B}" FOLDERID_PublicDownloads = "{3D644C9B-1FB8-4f30-9B45-F670235F79C0}" FOLDERID_SavedSearches = "{7d1d3a04-debb-4115-95cf-2f29da2920da}" FOLDERID_QuickLaunch = "{52a4f021-7b75-48a9-9f6b-4b87a210bc8f}" FOLDERID_Contacts = "{56784854-C6CB-462b-8169-88E350ACB882}" FOLDERID_SidebarParts = "{A75D362E-50FC-4fb7-AC2C-A8BEAA314493}" FOLDERID_SidebarDefaultParts = "{7B396E54-9EC5-4300-BE0A-2482EBAE1A26}" FOLDERID_TreeProperties = "{5b3749ad-b49f-49c1-83eb-15370fbd4882}" FOLDERID_PublicGameTasks = "{DEBF2536-E1A8-4c59-B6A2-414586476AEA}" FOLDERID_GameTasks = "{054FAE61-4DD8-4787-80B6-090220C4B700}" FOLDERID_SavedGames = "{4C5C32FF-BB9D-43b0-B5B4-2D72E54EAAA4}" FOLDERID_Games = "{CAC52C1A-B53D-4edc-92D7-6B2E8AC19434}" FOLDERID_RecordedTV = "{bd85e001-112e-431e-983b-7b15ac09fff1}" FOLDERID_SEARCH_MAPI = "{98ec0e18-2098-4d44-8644-66979315a281}" FOLDERID_SEARCH_CSC = "{ee32e446-31ca-4aba-814f-a5ebd2fd6d5e}" FOLDERID_Links = "{bfb9d5e0-c6a9-404c-b2b2-ae6db6af4968}" FOLDERID_UsersFiles = "{f3ce0f7c-4901-4acc-8648-d5d44b04ef8f}" FOLDERID_SearchHome = "{190337d1-b8ca-4121-a639-6d472d16972a}" FOLDERID_OriginalImages = "{2C36C0AA-5812-4b87-BFD0-4CD0DFB19B39}" |
From: Mark H. <mha...@us...> - 2008-07-26 02:31:43
|
Update of /cvsroot/pywin32/pywin32/com/win32comext/shell/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30348/src Modified Files: PyIExtractIcon.cpp PyIExtractIconW.cpp Log Message: Use "handle" functions to get HICON from IExtractIconA/W and IExtractIcon is explicitly for the ascii version of the interface. Index: PyIExtractIconW.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/shell/src/PyIExtractIconW.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** PyIExtractIconW.cpp 8 Jan 2008 00:41:03 -0000 1.1 --- PyIExtractIconW.cpp 26 Jul 2008 02:31:48 -0000 1.2 *************** *** 56,60 **** if (hr==S_FALSE) return Py_BuildValue("OO", Py_None, Py_None); ! return Py_BuildValue("ii", hiconLarge, hiconSmall); // @rdesc The result is (hicon_large, hicon_small), or // (None,None) if the underlying function returns S_FALSE, indicating --- 56,61 ---- if (hr==S_FALSE) return Py_BuildValue("OO", Py_None, Py_None); ! return Py_BuildValue("NN", PyWinLong_FromHANDLE(hiconLarge), ! PyWinLong_FromHANDLE(hiconSmall)); // @rdesc The result is (hicon_large, hicon_small), or // (None,None) if the underlying function returns S_FALSE, indicating *************** *** 125,129 **** hr = PyInt_AsLong(result); else { ! PyArg_ParseTuple(result, "ii", phiconLarge, phiconSmall); hr = MAKE_PYCOM_GATEWAY_FAILURE_CODE("Extract"); } --- 126,136 ---- hr = PyInt_AsLong(result); else { ! PyObject *oblarge, *obsmall; ! if (PyArg_ParseTuple(result, "OO", &oblarge, &obsmall) && ! PyWinObject_AsHANDLE(oblarge, (HANDLE *)phiconLarge) && ! PyWinObject_AsHANDLE(obsmall, (HANDLE *)phiconSmall)) { ! // we worked - no error should be present! ! assert(!PyErr_Occurred()); ! } hr = MAKE_PYCOM_GATEWAY_FAILURE_CODE("Extract"); } Index: PyIExtractIcon.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/shell/src/PyIExtractIcon.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** PyIExtractIcon.cpp 26 Jan 2005 22:31:09 -0000 1.4 --- PyIExtractIcon.cpp 26 Jul 2008 02:31:48 -0000 1.5 *************** *** 52,56 **** if (hr==S_FALSE) return Py_BuildValue("OO", Py_None, Py_None); ! return Py_BuildValue("ii", hiconLarge, hiconSmall); // @rdesc The result is (hicon_large, hicon_small), or // (None,None) if the underlying function returns S_FALSE, indicating --- 52,57 ---- if (hr==S_FALSE) return Py_BuildValue("OO", Py_None, Py_None); ! return Py_BuildValue("NN", PyWinLong_FromHANDLE(hiconLarge), ! PyWinLong_FromHANDLE(hiconSmall)); // @rdesc The result is (hicon_large, hicon_small), or // (None,None) if the underlying function returns S_FALSE, indicating *************** *** 113,117 **** PY_GATEWAY_METHOD; PyObject *obpszFile; ! obpszFile = PyWinObject_FromTCHAR((LPTSTR)pszFile); PyObject *result; HRESULT hr=InvokeViaPolicy("Extract", &result, "Oii", obpszFile, nIconIndex, nIconSize); --- 114,118 ---- PY_GATEWAY_METHOD; PyObject *obpszFile; ! obpszFile = PyString_FromString((LPTSTR)pszFile); PyObject *result; HRESULT hr=InvokeViaPolicy("Extract", &result, "Oii", obpszFile, nIconIndex, nIconSize); *************** *** 121,125 **** hr = PyInt_AsLong(result); else { ! PyArg_ParseTuple(result, "ii", phiconLarge, phiconSmall); hr = MAKE_PYCOM_GATEWAY_FAILURE_CODE("Extract"); } --- 122,132 ---- hr = PyInt_AsLong(result); else { ! PyObject *oblarge, *obsmall; ! if (PyArg_ParseTuple(result, "OO", &oblarge, &obsmall) && ! PyWinObject_AsHANDLE(oblarge, (HANDLE *)phiconLarge) && ! PyWinObject_AsHANDLE(obsmall, (HANDLE *)phiconSmall)) { ! // we worked - no error should be present! ! assert(!PyErr_Occurred()); ! } hr = MAKE_PYCOM_GATEWAY_FAILURE_CODE("Extract"); } *************** *** 149,161 **** else { if (PyArg_ParseTuple(result, "Oii", &obFileName, piIndex, pflags)) { ! TCHAR *filename; ! if (PyWinObject_AsTCHAR(obFileName, &filename)) { ! #ifdef UNICODE ! // WTF - _tcsncpy resolving to strncpy?! ! wcsncpy(szIconFile, filename, cchMax); ! #else ! _tcsncpy(szIconFile, filename, cchMax); ! #endif ! PyWinObject_FreeTCHAR(filename); } } --- 156,163 ---- else { if (PyArg_ParseTuple(result, "Oii", &obFileName, piIndex, pflags)) { ! char *filename; ! if (PyWinObject_AsString(obFileName, &filename)) { ! strncpy(szIconFile, filename, cchMax); ! PyWinObject_FreeString(filename); } } |
From: Mark H. <mha...@us...> - 2008-07-25 01:26:25
|
Update of /cvsroot/pywin32/pywin32/win32/Demos In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17985/win32/Demos Modified Files: win32gui_menu.py Log Message: Need to detach from the GDIHandle before passing ownership to the menu Index: win32gui_menu.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/Demos/win32gui_menu.py,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** win32gui_menu.py 30 Jun 2008 12:58:02 -0000 1.7 --- win32gui_menu.py 25 Jul 2008 01:26:33 -0000 1.8 *************** *** 166,170 **** DeleteDC(hdcBitmap) item, extras = PackMENUITEMINFO(text="Menu with icon", ! hbmpItem=hbm, wID=1011) InsertMenuItem(menu, 0, 1, item) --- 166,170 ---- DeleteDC(hdcBitmap) item, extras = PackMENUITEMINFO(text="Menu with icon", ! hbmpItem=hbm.Detach(), wID=1011) InsertMenuItem(menu, 0, 1, item) |
From: Mark H. <mha...@us...> - 2008-07-25 01:18:02
|
Update of /cvsroot/pywin32/pywin32/win32/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14644/win32/src Modified Files: win32consolemodule.cpp Log Message: autoduck: clarify return value for win32console.GetConsoleWindow() Index: win32consolemodule.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32consolemodule.cpp,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** win32consolemodule.cpp 12 Aug 2007 08:31:41 -0000 1.12 --- win32consolemodule.cpp 25 Jul 2008 01:18:10 -0000 1.13 *************** *** 1893,1896 **** --- 1893,1899 ---- // @pymethod int|win32console|GetConsoleWindow|Returns a handle to the console's window, or 0 if none exists + // @rdesc This function may raise NotImplementedError if it does not exist on + // the platform, or a <o PyHANDLE> object with a value of 0. It will never + // raise a win32 exception. static PyObject *PyGetConsoleWindow(PyObject *self, PyObject *args) { |