Update of /cvsroot/pywin32/pywin32/com/win32comext/shell/demos/servers
In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv20331/com/win32comext/shell/demos/servers
Modified Files:
Tag: py3k
column_provider.py context_menu.py copy_hook.py
empty_volume_cache.py folder_view.py icon_handler.py
shell_view.py
Log Message:
many more upgrades to py3k syntax
Index: column_provider.py
===================================================================
RCS file: /cvsroot/pywin32/pywin32/com/win32comext/shell/demos/servers/column_provider.py,v
retrieving revision 1.1
retrieving revision 1.1.4.1
diff -C2 -d -r1.1 -r1.1.4.1
*** column_provider.py 6 Nov 2003 06:12:16 -0000 1.1
--- column_provider.py 26 Nov 2008 09:03:30 -0000 1.1.4.1
***************
*** 36,40 ****
def Initialize(self, colInit):
flags, reserved, name = colInit
! print "ColumnProvider initializing for file", name
def GetColumnInfo(self, index):
# We support exactly 2 columns - 'pyc size' and 'pyo size'
--- 36,40 ----
def Initialize(self, colInit):
flags, reserved, name = colInit
! print("ColumnProvider initializing for file", name)
def GetColumnInfo(self, index):
# We support exactly 2 columns - 'pyc size' and 'pyo size'
***************
*** 85,89 ****
str(ColumnProvider._reg_clsid_ ))
_winreg.SetValueEx(key, None, 0, _winreg.REG_SZ, ColumnProvider._reg_desc_)
! print ColumnProvider._reg_desc_, "registration complete."
def DllUnregisterServer():
--- 85,89 ----
str(ColumnProvider._reg_clsid_ ))
_winreg.SetValueEx(key, None, 0, _winreg.REG_SZ, ColumnProvider._reg_desc_)
! print(ColumnProvider._reg_desc_, "registration complete.")
def DllUnregisterServer():
***************
*** 93,101 ****
"Folder\\ShellEx\\ColumnHandlers\\" + \
str(ColumnProvider._reg_clsid_) )
! except WindowsError, details:
import errno
if details.errno != errno.ENOENT:
raise
! print ColumnProvider._reg_desc_, "unregistration complete."
if __name__=='__main__':
--- 93,101 ----
"Folder\\ShellEx\\ColumnHandlers\\" + \
str(ColumnProvider._reg_clsid_) )
! except WindowsError as details:
import errno
if details.errno != errno.ENOENT:
raise
! print(ColumnProvider._reg_desc_, "unregistration complete.")
if __name__=='__main__':
Index: copy_hook.py
===================================================================
RCS file: /cvsroot/pywin32/pywin32/com/win32comext/shell/demos/servers/copy_hook.py,v
retrieving revision 1.2
retrieving revision 1.2.4.1
diff -C2 -d -r1.2 -r1.2.4.1
*** copy_hook.py 8 Oct 2003 08:40:20 -0000 1.2
--- copy_hook.py 26 Nov 2008 09:03:30 -0000 1.2.4.1
***************
*** 27,31 ****
# IDNO Prevents the operation on this folder but continues with any other operations that have been approved (for example, a batch copy operation).
# IDCANCEL Prevents the current operation and cancels any pending operations.
! print "CopyCallBack", hwnd, func, flags, srcName, srcAttr, destName, destAttr
return win32gui.MessageBox(hwnd, "Allow operation?", "CopyHook",
win32con.MB_YESNO)
--- 27,31 ----
# IDNO Prevents the operation on this folder but continues with any other operations that have been approved (for example, a batch copy operation).
# IDCANCEL Prevents the current operation and cancels any pending operations.
! print("CopyCallBack", hwnd, func, flags, srcName, srcAttr, destName, destAttr)
return win32gui.MessageBox(hwnd, "Allow operation?", "CopyHook",
win32con.MB_YESNO)
***************
*** 41,45 ****
ShellExtension._reg_desc_)
_winreg.SetValueEx(key, None, 0, _winreg.REG_SZ, ShellExtension._reg_clsid_)
! print ShellExtension._reg_desc_, "registration complete."
def DllUnregisterServer():
--- 41,45 ----
ShellExtension._reg_desc_)
_winreg.SetValueEx(key, None, 0, _winreg.REG_SZ, ShellExtension._reg_clsid_)
! print(ShellExtension._reg_desc_, "registration complete.")
def DllUnregisterServer():
***************
*** 49,53 ****
"directory\\shellex\\CopyHookHandlers\\" +
ShellExtension._reg_desc_)
! except WindowsError, details:
import errno
if details.errno != errno.ENOENT:
--- 49,53 ----
"directory\\shellex\\CopyHookHandlers\\" +
ShellExtension._reg_desc_)
! except WindowsError as details:
import errno
if details.errno != errno.ENOENT:
***************
*** 57,65 ****
"*\\shellex\\CopyHookHandlers\\" +
ShellExtension._reg_desc_)
! except WindowsError, details:
import errno
if details.errno != errno.ENOENT:
raise
! print ShellExtension._reg_desc_, "unregistration complete."
if __name__=='__main__':
--- 57,65 ----
"*\\shellex\\CopyHookHandlers\\" +
ShellExtension._reg_desc_)
! except WindowsError as details:
import errno
if details.errno != errno.ENOENT:
raise
! print(ShellExtension._reg_desc_, "unregistration complete.")
if __name__=='__main__':
Index: empty_volume_cache.py
===================================================================
RCS file: /cvsroot/pywin32/pywin32/com/win32comext/shell/demos/servers/empty_volume_cache.py,v
retrieving revision 1.1
retrieving revision 1.1.2.1
diff -C2 -d -r1.1 -r1.1.2.1
*** empty_volume_cache.py 15 Feb 2007 13:11:02 -0000 1.1
--- empty_volume_cache.py 26 Nov 2008 09:03:30 -0000 1.1.2.1
***************
*** 21,25 ****
if not os.path.isfile(ico):
ico = None
! print "Can't find python.ico - no icon will be installed"
class EmptyVolumeCache:
--- 21,25 ----
if not os.path.isfile(ico):
ico = None
! print("Can't find python.ico - no icon will be installed")
class EmptyVolumeCache:
***************
*** 33,37 ****
def Initialize(self, hkey, volume, flags):
# This should never be called, except on win98.
! print "Unless we are on 98, Initialize call is unexpected!"
raise COMException(hresult=winerror.E_NOTIMPL)
--- 33,37 ----
def Initialize(self, hkey, volume, flags):
# This should never be called, except on win98.
! print("Unless we are on 98, Initialize call is unexpected!")
raise COMException(hresult=winerror.E_NOTIMPL)
***************
*** 39,46 ****
# Must return a tuple of:
# (display_name, description, button_name, flags)
! print "InitializeEx called with", hkey, volume, key_name, flags
self.volume = volume
if flags & shellcon.EVCF_SETTINGSMODE:
! print "We are being run on a schedule"
# In this case, "because there is no opportunity for user
# feedback, only those files that are extremely safe to clean up
--- 39,46 ----
# Must return a tuple of:
# (display_name, description, button_name, flags)
! print("InitializeEx called with", hkey, volume, key_name, flags)
self.volume = volume
if flags & shellcon.EVCF_SETTINGSMODE:
! print("We are being run on a schedule")
# In this case, "because there is no opportunity for user
# feedback, only those files that are extremely safe to clean up
***************
*** 54,61 ****
# handler obviously should not delete files that would cause an
# application to fail or the user to lose data."
! print "We are being run as we are out of disk-space"
else:
# This case is not documented - we are guessing :)
! print "We are being run because the user asked"
# For the sake of demo etc, we tell the shell to only show us when
--- 54,61 ----
# handler obviously should not delete files that would cause an
# application to fail or the user to lose data."
! print("We are being run as we are out of disk-space")
else:
# This case is not documented - we are guessing :)
! print("We are being run because the user asked")
# For the sake of demo etc, we tell the shell to only show us when
***************
*** 90,94 ****
# referenced
if total_list is None:
! print "Deleting file", fqn
# Should do callback.PurgeProcess - left as an exercise :)
os.remove(fqn)
--- 90,94 ----
# referenced
if total_list is None:
! print("Deleting file", fqn)
# Should do callback.PurgeProcess - left as an exercise :)
os.remove(fqn)
***************
*** 112,125 ****
for d in self._GetDirectories():
os.path.walk(d, self._WalkCallback, (callback, total))
! print "After looking in", d, "we have", total[0], "bytes"
! except pythoncom.error, (hr, msg, exc, arg):
# This will be raised by the callback when the user selects 'cancel'.
if hr != winerror.E_ABORT:
raise # that's the documented error code!
! print "User cancelled the operation"
return total[0]
def Purge(self, amt_to_free, callback):
! print "Purging", amt_to_free, "bytes..."
# we ignore amt_to_free - it is generally what we returned for
# GetSpaceUsed
--- 112,127 ----
for d in self._GetDirectories():
os.path.walk(d, self._WalkCallback, (callback, total))
! print("After looking in", d, "we have", total[0], "bytes")
! except pythoncom.error as xxx_todo_changeme:
! # This will be raised by the callback when the user selects 'cancel'.
! (hr, msg, exc, arg) = xxx_todo_changeme.args
# This will be raised by the callback when the user selects 'cancel'.
if hr != winerror.E_ABORT:
raise # that's the documented error code!
! print("User cancelled the operation")
return total[0]
def Purge(self, amt_to_free, callback):
! print("Purging", amt_to_free, "bytes...")
# we ignore amt_to_free - it is generally what we returned for
# GetSpaceUsed
***************
*** 127,135 ****
for d in self._GetDirectories():
os.path.walk(d, self._WalkCallback, (callback, None))
! except pythoncom.error, (hr, msg, exc, arg):
# This will be raised by the callback when the user selects 'cancel'.
if hr != winerror.E_ABORT:
raise # that's the documented error code!
! print "User cancelled the operation"
def ShowProperties(self, hwnd):
--- 129,139 ----
for d in self._GetDirectories():
os.path.walk(d, self._WalkCallback, (callback, None))
! except pythoncom.error as xxx_todo_changeme1:
! # This will be raised by the callback when the user selects 'cancel'.
! (hr, msg, exc, arg) = xxx_todo_changeme1.args
# This will be raised by the callback when the user selects 'cancel'.
if hr != winerror.E_ABORT:
raise # that's the documented error code!
! print("User cancelled the operation")
def ShowProperties(self, hwnd):
***************
*** 137,141 ****
def Deactivate(self):
! print "Deactivate called"
return 0
--- 141,145 ----
def Deactivate(self):
! print("Deactivate called")
return 0
***************
*** 156,164 ****
try:
key = _winreg.DeleteKey(_winreg.HKEY_LOCAL_MACHINE, kn)
! except WindowsError, details:
import errno
if details.errno != errno.ENOENT:
raise
! print EmptyVolumeCache._reg_desc_, "unregistration complete."
if __name__=='__main__':
--- 160,168 ----
try:
key = _winreg.DeleteKey(_winreg.HKEY_LOCAL_MACHINE, kn)
! except WindowsError as details:
import errno
if details.errno != errno.ENOENT:
raise
! print(EmptyVolumeCache._reg_desc_, "unregistration complete.")
if __name__=='__main__':
Index: folder_view.py
===================================================================
RCS file: /cvsroot/pywin32/pywin32/com/win32comext/shell/demos/servers/folder_view.py,v
retrieving revision 1.1
retrieving revision 1.1.2.1
diff -C2 -d -r1.1 -r1.1.2.1
*** folder_view.py 7 Feb 2008 05:42:01 -0000 1.1
--- folder_view.py 26 Nov 2008 09:03:30 -0000 1.1.2.1
***************
*** 219,223 ****
self.cmd.callback(items, bind_ctx)
else:
! print "No callback for command ", LoadString(self.cmd.ids)
def EnumSubCommands(self):
if not self.cmd.children:
--- 219,223 ----
self.cmd.callback(items, bind_ctx)
else:
! print("No callback for command ", LoadString(self.cmd.ids))
def EnumSubCommands(self):
if not self.cmd.children:
***************
*** 679,683 ****
import _winreg
if sys.getwindowsversion()[0] < 6:
! print "This sample only works on Vista"
sys.exit(1)
--- 679,683 ----
import _winreg
if sys.getwindowsversion()[0] < 6:
! print("This sample only works on Vista")
sys.exit(1)
***************
*** 701,705 ****
_winreg.SetValueEx(key, None, 0, _winreg.REG_SZ, ContextMenu._reg_clsid_)
propsys.PSRegisterPropertySchema(get_schema_fname())
! print ShellFolder._reg_desc_, "registration complete."
def DllUnregisterServer():
--- 701,705 ----
_winreg.SetValueEx(key, None, 0, _winreg.REG_SZ, ContextMenu._reg_clsid_)
propsys.PSRegisterPropertySchema(get_schema_fname())
! print(ShellFolder._reg_desc_, "registration complete.")
def DllUnregisterServer():
***************
*** 712,722 ****
try:
_winreg.DeleteKey(_winreg.HKEY_LOCAL_MACHINE, path)
! except WindowsError, details:
import errno
if details.errno != errno.ENOENT:
! print "FAILED to remove %s: %s" % (path, details)
propsys.PSUnregisterPropertySchema(get_schema_fname())
! print ShellFolder._reg_desc_, "unregistration complete."
if __name__=='__main__':
--- 712,722 ----
try:
_winreg.DeleteKey(_winreg.HKEY_LOCAL_MACHINE, path)
! except WindowsError as details:
import errno
if details.errno != errno.ENOENT:
! print("FAILED to remove %s: %s" % (path, details))
propsys.PSUnregisterPropertySchema(get_schema_fname())
! print(ShellFolder._reg_desc_, "unregistration complete.")
if __name__=='__main__':
Index: shell_view.py
===================================================================
RCS file: /cvsroot/pywin32/pywin32/com/win32comext/shell/demos/servers/shell_view.py,v
retrieving revision 1.12
retrieving revision 1.12.2.1
diff -C2 -d -r1.12 -r1.12.2.1
*** shell_view.py 20 Jul 2008 03:16:25 -0000 1.12
--- shell_view.py 26 Nov 2008 09:03:30 -0000 1.12.2.1
***************
*** 116,123 ****
return 0
def ParseDisplayName(self, hwnd, reserved, displayName, attr):
! print "ParseDisplayName", displayName
# return cchEaten, pidl, attr
def BindToStorage(self, pidl, bc, iid):
! print "BTS", iid, IIDToInterfaceName(iid)
def BindToObject(self, pidl, bc, iid):
# We may be passed a set of relative PIDLs here - ie
--- 116,123 ----
return 0
def ParseDisplayName(self, hwnd, reserved, displayName, attr):
! print("ParseDisplayName", displayName)
# return cchEaten, pidl, attr
def BindToStorage(self, pidl, bc, iid):
! print("BTS", iid, IIDToInterfaceName(iid))
def BindToObject(self, pidl, bc, iid):
# We may be passed a set of relative PIDLs here - ie
***************
*** 134,138 ****
klass = ShellFolderObject
else:
! raise RuntimeError, "What is " + repr(typ)
ret = wrap(klass(extra), iid, useDispatcher = (debug>0))
return ret
--- 134,138 ----
klass = ShellFolderObject
else:
! raise RuntimeError("What is " + repr(typ))
ret = wrap(klass(extra), iid, useDispatcher = (debug>0))
return ret
***************
*** 157,161 ****
inout, ret = folder.GetUIObjectOf(hwndOwner, [child_pidl], iid,
inout, iid)
! except pythoncom.com_error, (hr, desc, exc, arg):
raise COMException(hresult=hr)
return inout, ret
--- 157,162 ----
inout, ret = folder.GetUIObjectOf(hwndOwner, [child_pidl], iid,
inout, iid)
! except pythoncom.com_error as xxx_todo_changeme:
! (hr, desc, exc, arg) = xxx_todo_changeme.args
raise COMException(hresult=hr)
return inout, ret
***************
*** 363,367 ****
# IShellView
def CreateViewWindow(self, prev, settings, browser, rect):
! print "FileSystemView.CreateViewWindow", prev, settings, browser, rect
self.cur_foldersettings = settings
self.browser = browser
--- 364,368 ----
# IShellView
def CreateViewWindow(self, prev, settings, browser, rect):
! print("FileSystemView.CreateViewWindow", prev, settings, browser, rect)
self.cur_foldersettings = settings
self.browser = browser
***************
*** 391,395 ****
try:
win32gui.RegisterClass(wc)
! except win32gui.error, details:
# Should only happen when this module is reloaded
if details[0] != winerror.ERROR_CLASS_ALREADY_EXISTS:
--- 392,396 ----
try:
win32gui.RegisterClass(wc)
! except win32gui.error as details:
# Should only happen when this module is reloaded
if details[0] != winerror.ERROR_CLASS_ALREADY_EXISTS:
***************
*** 408,412 ****
self.hwnd_parent, 0, win32gui.dllhandle, None)
win32gui.SetWindowLong(self.hwnd, win32con.GWL_WNDPROC, message_map)
! print "View 's hwnd is", self.hwnd
return self.hwnd
--- 409,413 ----
self.hwnd_parent, 0, win32gui.dllhandle, None)
win32gui.SetWindowLong(self.hwnd, win32con.GWL_WNDPROC, message_map)
! print("View 's hwnd is", self.hwnd)
return self.hwnd
***************
*** 473,477 ****
def UIActivate(self, activate_state):
! print "OnActivate"
def _OnActivate(self, activate_state):
--- 474,478 ----
def UIActivate(self, activate_state):
! print("OnActivate")
def _OnActivate(self, activate_state):
***************
*** 514,518 ****
data = win32gui_struct.UnpackMENUITEMINFO(buf)
submenu = data[3]
! print "Do someting with the file menu!"
def Refresh(self):
--- 515,519 ----
data = win32gui_struct.UnpackMENUITEMINFO(buf)
submenu = data[3]
! print("Do someting with the file menu!")
def Refresh(self):
***************
*** 556,560 ****
# You would need to locate the index of the item in the shell-view
# with that PIDL, then ask the list-view to select it.
! print "Please implement SelectItem for PIDL", pidl
def GetItemObject(self, item_num, iid):
--- 557,561 ----
# You would need to locate the index of the item in the shell-view
# with that PIDL, then ask the list-view to select it.
! print("Please implement SelectItem for PIDL", pidl)
def GetItemObject(self, item_num, iid):
***************
*** 567,578 ****
win32gui.DestroyWindow(self.hwnd)
self.hwnd = None
! print "Destroyed view window"
# Message handlers.
def OnDestroy(self, hwnd, msg, wparam, lparam):
! print "OnDestory"
def OnCommand(self, hwnd, msg, wparam, lparam):
! print "OnCommand"
def OnNotify(self, hwnd, msg, wparam, lparam):
--- 568,579 ----
win32gui.DestroyWindow(self.hwnd)
self.hwnd = None
! print("Destroyed view window")
# Message handlers.
def OnDestroy(self, hwnd, msg, wparam, lparam):
! print("OnDestory")
def OnCommand(self, hwnd, msg, wparam, lparam):
! print("OnCommand")
def OnNotify(self, hwnd, msg, wparam, lparam):
***************
*** 606,610 ****
break
sel.append(self.children[n][-1:])
! print "Selection is", sel
hmenu = win32gui.CreateMenu()
try:
--- 607,611 ----
break
sel.append(self.children[n][-1:])
! print("Selection is", sel)
hmenu = win32gui.CreateMenu()
try:
***************
*** 638,642 ****
cmd = win32gui.GetMenuDefaultItem(hmenu, False, 0)
if cmd == -1:
! print "Oops: _doDefaultActionFor found no default menu"
else:
ci = 0, self.hwnd_parent, cmd-id_cmd_first, None, None, 0, 0, 0
--- 639,643 ----
cmd = win32gui.GetMenuDefaultItem(hmenu, False, 0)
if cmd == -1:
! print("Oops: _doDefaultActionFor found no default menu")
else:
ci = 0, self.hwnd_parent, cmd-id_cmd_first, None, None, 0, 0, 0
***************
*** 649,653 ****
lpVerb="explore",
lpIDList=sel[0])
! print "ShellExecuteEx returned", rv
finally:
win32gui.DestroyMenu(hmenu)
--- 650,654 ----
lpVerb="explore",
lpIDList=sel[0])
! print("ShellExecuteEx returned", rv)
finally:
win32gui.DestroyMenu(hmenu)
***************
*** 668,672 ****
spt = win32api.GetCursorPos()
if not pidls:
! print "Ignoring background click"
return
# Get the IContextMenu for the items.
--- 669,673 ----
spt = win32api.GetCursorPos()
if not pidls:
! print("Ignoring background click")
return
# Get the IContextMenu for the items.
***************
*** 691,695 ****
spt[0], spt[1],
0, self.hwnd, None)
! print "TrackPopupMenu returned", sel
finally:
win32gui.DestroyMenu(hmenu)
--- 692,696 ----
spt[0], spt[1],
0, self.hwnd, None)
! print("TrackPopupMenu returned", sel)
finally:
win32gui.DestroyMenu(hmenu)
***************
*** 721,725 ****
# IShellView
def CreateViewWindow(self, prev, settings, browser, rect):
! print "ScintillaShellView.CreateViewWindow", prev, settings, browser, rect
# Make sure scintilla.dll is loaded. If not, find it on sys.path
# (which it generally is for Pythonwin)
--- 722,726 ----
# IShellView
def CreateViewWindow(self, prev, settings, browser, rect):
! print("ScintillaShellView.CreateViewWindow", prev, settings, browser, rect)
# Make sure scintilla.dll is loaded. If not, find it on sys.path
# (which it generally is for Pythonwin)
***************
*** 735,739 ****
break
else:
! raise RuntimeError, "Can't find scintilla!"
style = win32con.WS_CHILD | win32con.WS_VSCROLL | \
--- 736,740 ----
break
else:
! raise RuntimeError("Can't find scintilla!")
style = win32con.WS_CHILD | win32con.WS_VSCROLL | \
***************
*** 755,759 ****
if self.lineno != None:
self._SendSci(scintillacon.SCI_GOTOLINE, self.lineno)
! print "Scintilla's hwnd is", self.hwnd
def _SetupLexer(self):
--- 756,760 ----
if self.lineno != None:
self._SendSci(scintillacon.SCI_GOTOLINE, self.lineno)
! print("Scintilla's hwnd is", self.hwnd)
def _SetupLexer(self):
***************
*** 795,804 ****
def UIActivate(self, activate_state):
! print "OnActivate"
def DestroyViewWindow(self):
win32gui.DestroyWindow(self.hwnd)
self.hwnd = None
! print "Destroyed scintilla window"
def TranslateAccelerator(self, msg):
--- 796,805 ----
def UIActivate(self, activate_state):
! print("OnActivate")
def DestroyViewWindow(self):
win32gui.DestroyWindow(self.hwnd)
self.hwnd = None
! print("Destroyed scintilla window")
def TranslateAccelerator(self, msg):
***************
*** 826,830 ****
s = struct.pack("i", attr)
_winreg.SetValueEx(key, "Attributes", 0, _winreg.REG_BINARY, s)
! print ShellFolderRoot._reg_desc_, "registration complete."
def DllUnregisterServer():
--- 827,831 ----
s = struct.pack("i", attr)
_winreg.SetValueEx(key, "Attributes", 0, _winreg.REG_BINARY, s)
! print(ShellFolderRoot._reg_desc_, "registration complete.")
def DllUnregisterServer():
***************
*** 835,843 ****
"Explorer\\Desktop\\Namespace\\" + \
ShellFolderRoot._reg_clsid_)
! except WindowsError, details:
import errno
if details.errno != errno.ENOENT:
raise
! print ShellFolderRoot._reg_desc_, "unregistration complete."
if __name__=='__main__':
--- 836,844 ----
"Explorer\\Desktop\\Namespace\\" + \
ShellFolderRoot._reg_clsid_)
! except WindowsError as details:
import errno
if details.errno != errno.ENOENT:
raise
! print(ShellFolderRoot._reg_desc_, "unregistration complete.")
if __name__=='__main__':
Index: icon_handler.py
===================================================================
RCS file: /cvsroot/pywin32/pywin32/com/win32comext/shell/demos/servers/icon_handler.py,v
retrieving revision 1.1
retrieving revision 1.1.4.1
diff -C2 -d -r1.1 -r1.1.4.1
*** icon_handler.py 7 Oct 2003 02:33:00 -0000 1.1
--- icon_handler.py 26 Nov 2008 09:03:30 -0000 1.1.4.1
***************
*** 20,24 ****
ico_files = glob.glob(os.path.join(sys.prefix, "PC", "*.ico"))
if not ico_files:
! print "WARNING: Can't find any icon files"
# Our shell extension.
--- 20,24 ----
ico_files = glob.glob(os.path.join(sys.prefix, "PC", "*.ico"))
if not ico_files:
! print("WARNING: Can't find any icon files")
# Our shell extension.
***************
*** 51,55 ****
subkey = _winreg.CreateKey(key, "IconHandler")
_winreg.SetValueEx(subkey, None, 0, _winreg.REG_SZ, ShellExtension._reg_clsid_)
! print ShellExtension._reg_desc_, "registration complete."
def DllUnregisterServer():
--- 51,55 ----
subkey = _winreg.CreateKey(key, "IconHandler")
_winreg.SetValueEx(subkey, None, 0, _winreg.REG_SZ, ShellExtension._reg_clsid_)
! print(ShellExtension._reg_desc_, "registration complete.")
def DllUnregisterServer():
***************
*** 58,66 ****
key = _winreg.DeleteKey(_winreg.HKEY_CLASSES_ROOT,
"Python.File\\shellex\\IconHandler")
! except WindowsError, details:
import errno
if details.errno != errno.ENOENT:
raise
! print ShellExtension._reg_desc_, "unregistration complete."
if __name__=='__main__':
--- 58,66 ----
key = _winreg.DeleteKey(_winreg.HKEY_CLASSES_ROOT,
"Python.File\\shellex\\IconHandler")
! except WindowsError as details:
import errno
if details.errno != errno.ENOENT:
raise
! print(ShellExtension._reg_desc_, "unregistration complete.")
if __name__=='__main__':
Index: context_menu.py
===================================================================
RCS file: /cvsroot/pywin32/pywin32/com/win32comext/shell/demos/servers/context_menu.py,v
retrieving revision 1.4
retrieving revision 1.4.2.1
diff -C2 -d -r1.4 -r1.4.2.1
*** context_menu.py 7 Feb 2008 05:24:20 -0000 1.4
--- context_menu.py 26 Nov 2008 09:03:30 -0000 1.4.2.1
***************
*** 22,30 ****
def Initialize(self, folder, dataobj, hkey):
! print "Init", folder, dataobj, hkey
self.dataobj = dataobj
def QueryContextMenu(self, hMenu, indexMenu, idCmdFirst, idCmdLast, uFlags):
! print "QCM", hMenu, indexMenu, idCmdFirst, idCmdLast, uFlags
# Query the items clicked on
format_etc = win32con.CF_HDROP, None, 1, -1, pythoncom.TYMED_HGLOBAL
--- 22,30 ----
def Initialize(self, folder, dataobj, hkey):
! print("Init", folder, dataobj, hkey)
self.dataobj = dataobj
def QueryContextMenu(self, hMenu, indexMenu, idCmdFirst, idCmdLast, uFlags):
! print("QCM", hMenu, indexMenu, idCmdFirst, idCmdLast, uFlags)
# Query the items clicked on
format_etc = win32con.CF_HDROP, None, 1, -1, pythoncom.TYMED_HGLOBAL
***************...
[truncated message content] |