[ctypes-commit] ctypes/win32/com client.py,1.7,1.8
Brought to you by:
theller
From: Thomas H. <th...@us...> - 2005-02-16 16:32:33
|
Update of /cvsroot/ctypes/ctypes/win32/com In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5063 Modified Files: client.py Log Message: Remove test code. Index: client.py =================================================================== RCS file: /cvsroot/ctypes/ctypes/win32/com/client.py,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** client.py 16 Feb 2005 16:17:01 -0000 1.7 --- client.py 16 Feb 2005 16:32:22 -0000 1.8 *************** *** 572,651 **** - if __name__ == "__main__": - - # win32com code: - # moniker, i, bindCtx = pythoncom.MkParseDisplayName(Pathname) - # dispatch = moniker.BindToObject(bindCtx, None, pythoncom.IID_IDispatch) - - d = GetObject("winmgmts:") - result = d.ExecQuery("SELECT * FROM Win32_LogicalDisk")# WHERE CAPTION = 'System Idle Process'") - ## print len(result) - ## print result.Count - for i in result: - print i.GetObjectText_() - ## print len(i.Properties_) - - ## print i.Properties_.Item("Handle").Value - - ## for p in i.Properties_: - ## print p.Name, p.Value - - - raise SystemExit - - ################################################################ - - if __name__ == "__main__": - - def test1(): - ## from ctypes.com.client import Dispatch - - ag = Dispatch("Agent.Control") - ag.Connected = 1 - ag.ShowDefaultCharacterProperties() - ag.Characters.Load("Merlin") - c1 = ag.Characters.Item("Merlin") - #ch = ag.Characters("Merlin") - c1.Show() - c1.Speak("Python is cool!") - c1.GestureAt(500, 20) - c1.Think("Although you need ctypes as well ;-)") - import time - time.sleep(10) - c1.Hide() - ag.Connected = 0 - ##ag.Unload() - ## test1() - - def test3(): - ## from win32com.client import DispatchWithEvents - - class Receiver: - - def OnQuit(self, *args): - print "OnQuit", args - windll.user32.PostQuitMessage(0) - - def BeforeNavigate2(self, disp, URL, Flags, TargetFrameName, PostData, Headers, Cancel): - print "BeforeNavigate2", (disp, URL, Flags, TargetFrameName, PostData, Headers, Cancel) - ## return disp, URL, Flags, TargetFrameName, PostData, Headers, Cancel - ## return 1 - - def NewWindow2(self, *args): - print "NewWindow2", args - - def NavigateComplete2(self, *args): - print "NavigateComplete2", args - - def StatusTextChange(self, *args): - print "StatusTextChange", args - - m = DispatchWithEvents("InternetExplorer.Application", Receiver) - m.Visible = True - m.Navigate("http://www.python.org") - - from ctypes.com.server import pump_messages - pump_messages() - - test3() --- 572,574 ---- |