pywin32-checkins Mailing List for Python for Windows Extensions (Page 72)
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-29 04:59:47
|
Update of /cvsroot/pywin32/pywin32/win32/Lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15490/Lib Modified Files: Tag: py3k afxres.py commctrl.py mmsystem.py netbios.py ntsecuritycon.py pywintypes.py rasutil.py regcheck.py regutil.py sspi.py sspicon.py win32con.py win32netcon.py win32traceutil.py Log Message: Changes to build for Python 3.0 Index: sspicon.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/Lib/sspicon.py,v retrieving revision 1.4 retrieving revision 1.4.4.1 diff -C2 -d -r1.4 -r1.4.4.1 *** sspicon.py 12 Feb 2006 14:10:02 -0000 1.4 --- sspicon.py 29 Aug 2008 04:59:25 -0000 1.4.4.1 *************** *** 280,391 **** SEC_E_NO_KERB_KEY = -2146892984 ! ERROR_IPSEC_QM_POLICY_EXISTS = 13000L ! ERROR_IPSEC_QM_POLICY_NOT_FOUND = 13001L ! ERROR_IPSEC_QM_POLICY_IN_USE = 13002L ! ERROR_IPSEC_MM_POLICY_EXISTS = 13003L ! ERROR_IPSEC_MM_POLICY_NOT_FOUND = 13004L ! ERROR_IPSEC_MM_POLICY_IN_USE = 13005L ! ERROR_IPSEC_MM_FILTER_EXISTS = 13006L ! ERROR_IPSEC_MM_FILTER_NOT_FOUND = 13007L ! ERROR_IPSEC_TRANSPORT_FILTER_EXISTS = 13008L ! ERROR_IPSEC_TRANSPORT_FILTER_NOT_FOUND = 13009L ! ERROR_IPSEC_MM_AUTH_EXISTS = 13010L ! ERROR_IPSEC_MM_AUTH_NOT_FOUND = 13011L ! ERROR_IPSEC_MM_AUTH_IN_USE = 13012L ! ERROR_IPSEC_DEFAULT_MM_POLICY_NOT_FOUND = 13013L ! ERROR_IPSEC_DEFAULT_MM_AUTH_NOT_FOUND = 13014L ! ERROR_IPSEC_DEFAULT_QM_POLICY_NOT_FOUND = 13015L ! ERROR_IPSEC_TUNNEL_FILTER_EXISTS = 13016L ! ERROR_IPSEC_TUNNEL_FILTER_NOT_FOUND = 13017L ! ERROR_IPSEC_MM_FILTER_PENDING_DELETION = 13018L ! ERROR_IPSEC_TRANSPORT_FILTER_PENDING_DELETION = 13019L ! ERROR_IPSEC_TUNNEL_FILTER_PENDING_DELETION = 13020L ! ERROR_IPSEC_MM_POLICY_PENDING_DELETION = 13021L ! ERROR_IPSEC_MM_AUTH_PENDING_DELETION = 13022L ! ERROR_IPSEC_QM_POLICY_PENDING_DELETION = 13023L ! WARNING_IPSEC_MM_POLICY_PRUNED = 13024L ! WARNING_IPSEC_QM_POLICY_PRUNED = 13025L ! ERROR_IPSEC_IKE_NEG_STATUS_BEGIN = 13800L ! ERROR_IPSEC_IKE_AUTH_FAIL = 13801L ! ERROR_IPSEC_IKE_ATTRIB_FAIL = 13802L ! ERROR_IPSEC_IKE_NEGOTIATION_PENDING = 13803L ! ERROR_IPSEC_IKE_GENERAL_PROCESSING_ERROR = 13804L ! ERROR_IPSEC_IKE_TIMED_OUT = 13805L ! ERROR_IPSEC_IKE_NO_CERT = 13806L ! ERROR_IPSEC_IKE_SA_DELETED = 13807L ! ERROR_IPSEC_IKE_SA_REAPED = 13808L ! ERROR_IPSEC_IKE_MM_ACQUIRE_DROP = 13809L ! ERROR_IPSEC_IKE_QM_ACQUIRE_DROP = 13810L ! ERROR_IPSEC_IKE_QUEUE_DROP_MM = 13811L ! ERROR_IPSEC_IKE_QUEUE_DROP_NO_MM = 13812L ! ERROR_IPSEC_IKE_DROP_NO_RESPONSE = 13813L ! ERROR_IPSEC_IKE_MM_DELAY_DROP = 13814L ! ERROR_IPSEC_IKE_QM_DELAY_DROP = 13815L ! ERROR_IPSEC_IKE_ERROR = 13816L ! ERROR_IPSEC_IKE_CRL_FAILED = 13817L ! ERROR_IPSEC_IKE_INVALID_KEY_USAGE = 13818L ! ERROR_IPSEC_IKE_INVALID_CERT_TYPE = 13819L ! ERROR_IPSEC_IKE_NO_PRIVATE_KEY = 13820L ! ERROR_IPSEC_IKE_DH_FAIL = 13822L ! ERROR_IPSEC_IKE_INVALID_HEADER = 13824L ! ERROR_IPSEC_IKE_NO_POLICY = 13825L ! ERROR_IPSEC_IKE_INVALID_SIGNATURE = 13826L ! ERROR_IPSEC_IKE_KERBEROS_ERROR = 13827L ! ERROR_IPSEC_IKE_NO_PUBLIC_KEY = 13828L ! ERROR_IPSEC_IKE_PROCESS_ERR = 13829L ! ERROR_IPSEC_IKE_PROCESS_ERR_SA = 13830L ! ERROR_IPSEC_IKE_PROCESS_ERR_PROP = 13831L ! ERROR_IPSEC_IKE_PROCESS_ERR_TRANS = 13832L ! ERROR_IPSEC_IKE_PROCESS_ERR_KE = 13833L ! ERROR_IPSEC_IKE_PROCESS_ERR_ID = 13834L ! ERROR_IPSEC_IKE_PROCESS_ERR_CERT = 13835L ! ERROR_IPSEC_IKE_PROCESS_ERR_CERT_REQ = 13836L ! ERROR_IPSEC_IKE_PROCESS_ERR_HASH = 13837L ! ERROR_IPSEC_IKE_PROCESS_ERR_SIG = 13838L ! ERROR_IPSEC_IKE_PROCESS_ERR_NONCE = 13839L ! ERROR_IPSEC_IKE_PROCESS_ERR_NOTIFY = 13840L ! ERROR_IPSEC_IKE_PROCESS_ERR_DELETE = 13841L ! ERROR_IPSEC_IKE_PROCESS_ERR_VENDOR = 13842L ! ERROR_IPSEC_IKE_INVALID_PAYLOAD = 13843L ! ERROR_IPSEC_IKE_LOAD_SOFT_SA = 13844L ! ERROR_IPSEC_IKE_SOFT_SA_TORN_DOWN = 13845L ! ERROR_IPSEC_IKE_INVALID_COOKIE = 13846L ! ERROR_IPSEC_IKE_NO_PEER_CERT = 13847L ! ERROR_IPSEC_IKE_PEER_CRL_FAILED = 13848L ! ERROR_IPSEC_IKE_POLICY_CHANGE = 13849L ! ERROR_IPSEC_IKE_NO_MM_POLICY = 13850L ! ERROR_IPSEC_IKE_NOTCBPRIV = 13851L ! ERROR_IPSEC_IKE_SECLOADFAIL = 13852L ! ERROR_IPSEC_IKE_FAILSSPINIT = 13853L ! ERROR_IPSEC_IKE_FAILQUERYSSP = 13854L ! ERROR_IPSEC_IKE_SRVACQFAIL = 13855L ! ERROR_IPSEC_IKE_SRVQUERYCRED = 13856L ! ERROR_IPSEC_IKE_GETSPIFAIL = 13857L ! ERROR_IPSEC_IKE_INVALID_FILTER = 13858L ! ERROR_IPSEC_IKE_OUT_OF_MEMORY = 13859L ! ERROR_IPSEC_IKE_ADD_UPDATE_KEY_FAILED = 13860L ! ERROR_IPSEC_IKE_INVALID_POLICY = 13861L ! ERROR_IPSEC_IKE_UNKNOWN_DOI = 13862L ! ERROR_IPSEC_IKE_INVALID_SITUATION = 13863L ! ERROR_IPSEC_IKE_DH_FAILURE = 13864L ! ERROR_IPSEC_IKE_INVALID_GROUP = 13865L ! ERROR_IPSEC_IKE_ENCRYPT = 13866L ! ERROR_IPSEC_IKE_DECRYPT = 13867L ! ERROR_IPSEC_IKE_POLICY_MATCH = 13868L ! ERROR_IPSEC_IKE_UNSUPPORTED_ID = 13869L ! ERROR_IPSEC_IKE_INVALID_HASH = 13870L ! ERROR_IPSEC_IKE_INVALID_HASH_ALG = 13871L ! ERROR_IPSEC_IKE_INVALID_HASH_SIZE = 13872L ! ERROR_IPSEC_IKE_INVALID_ENCRYPT_ALG = 13873L ! ERROR_IPSEC_IKE_INVALID_AUTH_ALG = 13874L ! ERROR_IPSEC_IKE_INVALID_SIG = 13875L ! ERROR_IPSEC_IKE_LOAD_FAILED = 13876L ! ERROR_IPSEC_IKE_RPC_DELETE = 13877L ! ERROR_IPSEC_IKE_BENIGN_REINIT = 13878L ! ERROR_IPSEC_IKE_INVALID_RESPONDER_LIFETIME_NOTIFY = 13879L ! ERROR_IPSEC_IKE_INVALID_CERT_KEYLEN = 13881L ! ERROR_IPSEC_IKE_MM_LIMIT = 13882L ! ERROR_IPSEC_IKE_NEGOTIATION_DISABLED = 13883L ! ERROR_IPSEC_IKE_NEG_STATUS_END = 13884L CRYPT_E_MSG_ERROR = ((-2146889727)) CRYPT_E_UNKNOWN_ALGO = ((-2146889726)) --- 280,391 ---- SEC_E_NO_KERB_KEY = -2146892984 ! ERROR_IPSEC_QM_POLICY_EXISTS = 13000 ! ERROR_IPSEC_QM_POLICY_NOT_FOUND = 13001 ! ERROR_IPSEC_QM_POLICY_IN_USE = 13002 ! ERROR_IPSEC_MM_POLICY_EXISTS = 13003 ! ERROR_IPSEC_MM_POLICY_NOT_FOUND = 13004 ! ERROR_IPSEC_MM_POLICY_IN_USE = 13005 ! ERROR_IPSEC_MM_FILTER_EXISTS = 13006 ! ERROR_IPSEC_MM_FILTER_NOT_FOUND = 13007 ! ERROR_IPSEC_TRANSPORT_FILTER_EXISTS = 13008 ! ERROR_IPSEC_TRANSPORT_FILTER_NOT_FOUND = 13009 ! ERROR_IPSEC_MM_AUTH_EXISTS = 13010 ! ERROR_IPSEC_MM_AUTH_NOT_FOUND = 13011 ! ERROR_IPSEC_MM_AUTH_IN_USE = 13012 ! ERROR_IPSEC_DEFAULT_MM_POLICY_NOT_FOUND = 13013 ! ERROR_IPSEC_DEFAULT_MM_AUTH_NOT_FOUND = 13014 ! ERROR_IPSEC_DEFAULT_QM_POLICY_NOT_FOUND = 13015 ! ERROR_IPSEC_TUNNEL_FILTER_EXISTS = 13016 ! ERROR_IPSEC_TUNNEL_FILTER_NOT_FOUND = 13017 ! ERROR_IPSEC_MM_FILTER_PENDING_DELETION = 13018 ! ERROR_IPSEC_TRANSPORT_FILTER_PENDING_DELETION = 13019 ! ERROR_IPSEC_TUNNEL_FILTER_PENDING_DELETION = 13020 ! ERROR_IPSEC_MM_POLICY_PENDING_DELETION = 13021 ! ERROR_IPSEC_MM_AUTH_PENDING_DELETION = 13022 ! ERROR_IPSEC_QM_POLICY_PENDING_DELETION = 13023 ! WARNING_IPSEC_MM_POLICY_PRUNED = 13024 ! WARNING_IPSEC_QM_POLICY_PRUNED = 13025 ! ERROR_IPSEC_IKE_NEG_STATUS_BEGIN = 13800 ! ERROR_IPSEC_IKE_AUTH_FAIL = 13801 ! ERROR_IPSEC_IKE_ATTRIB_FAIL = 13802 ! ERROR_IPSEC_IKE_NEGOTIATION_PENDING = 13803 ! ERROR_IPSEC_IKE_GENERAL_PROCESSING_ERROR = 13804 ! ERROR_IPSEC_IKE_TIMED_OUT = 13805 ! ERROR_IPSEC_IKE_NO_CERT = 13806 ! ERROR_IPSEC_IKE_SA_DELETED = 13807 ! ERROR_IPSEC_IKE_SA_REAPED = 13808 ! ERROR_IPSEC_IKE_MM_ACQUIRE_DROP = 13809 ! ERROR_IPSEC_IKE_QM_ACQUIRE_DROP = 13810 ! ERROR_IPSEC_IKE_QUEUE_DROP_MM = 13811 ! ERROR_IPSEC_IKE_QUEUE_DROP_NO_MM = 13812 ! ERROR_IPSEC_IKE_DROP_NO_RESPONSE = 13813 ! ERROR_IPSEC_IKE_MM_DELAY_DROP = 13814 ! ERROR_IPSEC_IKE_QM_DELAY_DROP = 13815 ! ERROR_IPSEC_IKE_ERROR = 13816 ! ERROR_IPSEC_IKE_CRL_FAILED = 13817 ! ERROR_IPSEC_IKE_INVALID_KEY_USAGE = 13818 ! ERROR_IPSEC_IKE_INVALID_CERT_TYPE = 13819 ! ERROR_IPSEC_IKE_NO_PRIVATE_KEY = 13820 ! ERROR_IPSEC_IKE_DH_FAIL = 13822 ! ERROR_IPSEC_IKE_INVALID_HEADER = 13824 ! ERROR_IPSEC_IKE_NO_POLICY = 13825 ! ERROR_IPSEC_IKE_INVALID_SIGNATURE = 13826 ! ERROR_IPSEC_IKE_KERBEROS_ERROR = 13827 ! ERROR_IPSEC_IKE_NO_PUBLIC_KEY = 13828 ! ERROR_IPSEC_IKE_PROCESS_ERR = 13829 ! ERROR_IPSEC_IKE_PROCESS_ERR_SA = 13830 ! ERROR_IPSEC_IKE_PROCESS_ERR_PROP = 13831 ! ERROR_IPSEC_IKE_PROCESS_ERR_TRANS = 13832 ! ERROR_IPSEC_IKE_PROCESS_ERR_KE = 13833 ! ERROR_IPSEC_IKE_PROCESS_ERR_ID = 13834 ! ERROR_IPSEC_IKE_PROCESS_ERR_CERT = 13835 ! ERROR_IPSEC_IKE_PROCESS_ERR_CERT_REQ = 13836 ! ERROR_IPSEC_IKE_PROCESS_ERR_HASH = 13837 ! ERROR_IPSEC_IKE_PROCESS_ERR_SIG = 13838 ! ERROR_IPSEC_IKE_PROCESS_ERR_NONCE = 13839 ! ERROR_IPSEC_IKE_PROCESS_ERR_NOTIFY = 13840 ! ERROR_IPSEC_IKE_PROCESS_ERR_DELETE = 13841 ! ERROR_IPSEC_IKE_PROCESS_ERR_VENDOR = 13842 ! ERROR_IPSEC_IKE_INVALID_PAYLOAD = 13843 ! ERROR_IPSEC_IKE_LOAD_SOFT_SA = 13844 ! ERROR_IPSEC_IKE_SOFT_SA_TORN_DOWN = 13845 ! ERROR_IPSEC_IKE_INVALID_COOKIE = 13846 ! ERROR_IPSEC_IKE_NO_PEER_CERT = 13847 ! ERROR_IPSEC_IKE_PEER_CRL_FAILED = 13848 ! ERROR_IPSEC_IKE_POLICY_CHANGE = 13849 ! ERROR_IPSEC_IKE_NO_MM_POLICY = 13850 ! ERROR_IPSEC_IKE_NOTCBPRIV = 13851 ! ERROR_IPSEC_IKE_SECLOADFAIL = 13852 ! ERROR_IPSEC_IKE_FAILSSPINIT = 13853 ! ERROR_IPSEC_IKE_FAILQUERYSSP = 13854 ! ERROR_IPSEC_IKE_SRVACQFAIL = 13855 ! ERROR_IPSEC_IKE_SRVQUERYCRED = 13856 ! ERROR_IPSEC_IKE_GETSPIFAIL = 13857 ! ERROR_IPSEC_IKE_INVALID_FILTER = 13858 ! ERROR_IPSEC_IKE_OUT_OF_MEMORY = 13859 ! ERROR_IPSEC_IKE_ADD_UPDATE_KEY_FAILED = 13860 ! ERROR_IPSEC_IKE_INVALID_POLICY = 13861 ! ERROR_IPSEC_IKE_UNKNOWN_DOI = 13862 ! ERROR_IPSEC_IKE_INVALID_SITUATION = 13863 ! ERROR_IPSEC_IKE_DH_FAILURE = 13864 ! ERROR_IPSEC_IKE_INVALID_GROUP = 13865 ! ERROR_IPSEC_IKE_ENCRYPT = 13866 ! ERROR_IPSEC_IKE_DECRYPT = 13867 ! ERROR_IPSEC_IKE_POLICY_MATCH = 13868 ! ERROR_IPSEC_IKE_UNSUPPORTED_ID = 13869 ! ERROR_IPSEC_IKE_INVALID_HASH = 13870 ! ERROR_IPSEC_IKE_INVALID_HASH_ALG = 13871 ! ERROR_IPSEC_IKE_INVALID_HASH_SIZE = 13872 ! ERROR_IPSEC_IKE_INVALID_ENCRYPT_ALG = 13873 ! ERROR_IPSEC_IKE_INVALID_AUTH_ALG = 13874 ! ERROR_IPSEC_IKE_INVALID_SIG = 13875 ! ERROR_IPSEC_IKE_LOAD_FAILED = 13876 ! ERROR_IPSEC_IKE_RPC_DELETE = 13877 ! ERROR_IPSEC_IKE_BENIGN_REINIT = 13878 ! ERROR_IPSEC_IKE_INVALID_RESPONDER_LIFETIME_NOTIFY = 13879 ! ERROR_IPSEC_IKE_INVALID_CERT_KEYLEN = 13881 ! ERROR_IPSEC_IKE_MM_LIMIT = 13882 ! ERROR_IPSEC_IKE_NEGOTIATION_DISABLED = 13883 ! ERROR_IPSEC_IKE_NEG_STATUS_END = 13884 CRYPT_E_MSG_ERROR = ((-2146889727)) CRYPT_E_UNKNOWN_ALGO = ((-2146889726)) Index: regcheck.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/Lib/regcheck.py,v retrieving revision 1.6 retrieving revision 1.6.2.1 diff -C2 -d -r1.6 -r1.6.2.1 *** regcheck.py 19 May 2008 13:30:38 -0000 1.6 --- regcheck.py 29 Aug 2008 04:59:25 -0000 1.6.2.1 *************** *** 5,11 **** warnings.warn("The regcheck module has been pending deprecation since build 210", category=PendingDeprecationWarning) ! ! import win32con ! import regutil import win32api import os --- 5,10 ---- warnings.warn("The regcheck module has been pending deprecation since build 210", category=PendingDeprecationWarning) ! from . import win32con ! from . import regutil import win32api import os *************** *** 18,22 **** # except SystemError: except (os.error,win32api.error): ! print "Registration of %s - Not registered correctly" % exename def CheckPathString(pathString): --- 17,21 ---- # except SystemError: except (os.error,win32api.error): ! print("Registration of %s - Not registered correctly" % exename) def CheckPathString(pathString): *************** *** 28,43 **** def CheckPythonPaths(verbose): ! if verbose: print "Python Paths:" # Check the core path ! if verbose: print "\tCore Path:", try: appPath = win32api.RegQueryValue(regutil.GetRootKey(), regutil.BuildDefaultPythonKey() + "\\PythonPath") ! except win32api.error, (code, fn, desc): ! print "** does not exist - ", desc problem = CheckPathString(appPath) if problem: ! print problem else: ! if verbose: print appPath key = win32api.RegOpenKey(regutil.GetRootKey(), regutil.BuildDefaultPythonKey() + "\\PythonPath", 0, win32con.KEY_READ) --- 27,43 ---- def CheckPythonPaths(verbose): ! if verbose: print("Python Paths:") # Check the core path ! if verbose: print("\tCore Path:", end=' ') try: appPath = win32api.RegQueryValue(regutil.GetRootKey(), regutil.BuildDefaultPythonKey() + "\\PythonPath") ! except win32api.error as xxx_todo_changeme: ! (code, fn, desc) = xxx_todo_changeme.args ! print("** does not exist - ", desc) problem = CheckPathString(appPath) if problem: ! print(problem) else: ! if verbose: print(appPath) key = win32api.RegOpenKey(regutil.GetRootKey(), regutil.BuildDefaultPythonKey() + "\\PythonPath", 0, win32con.KEY_READ) *************** *** 48,60 **** appName = win32api.RegEnumKey(key, keyNo) appPath = win32api.RegQueryValue(key, appName) ! if verbose: print "\t"+appName+":", if appPath: problem = CheckPathString(appPath) if problem: ! print problem else: ! if verbose: print appPath else: ! if verbose: print "(empty)" keyNo = keyNo + 1 except win32api.error: --- 48,60 ---- appName = win32api.RegEnumKey(key, keyNo) appPath = win32api.RegQueryValue(key, appName) ! if verbose: print("\t"+appName+":", end=' ') if appPath: problem = CheckPathString(appPath) if problem: ! print(problem) else: ! if verbose: print(appPath) else: ! if verbose: print("(empty)") keyNo = keyNo + 1 except win32api.error: *************** *** 64,74 **** def CheckHelpFiles(verbose): ! if verbose: print "Help Files:" try: key = win32api.RegOpenKey(regutil.GetRootKey(), regutil.BuildDefaultPythonKey() + "\\Help", 0, win32con.KEY_READ) ! except win32api.error, (code, fn, details): ! import winerror if code!=winerror.ERROR_FILE_NOT_FOUND: ! raise win32api.error, (code, fn, details) return --- 64,75 ---- def CheckHelpFiles(verbose): ! if verbose: print("Help Files:") try: key = win32api.RegOpenKey(regutil.GetRootKey(), regutil.BuildDefaultPythonKey() + "\\Help", 0, win32con.KEY_READ) ! except win32api.error as xxx_todo_changeme1: ! (code, fn, details) = xxx_todo_changeme1.args ! from . import winerror if code!=winerror.ERROR_FILE_NOT_FOUND: ! raise win32api.error(code, fn, details) return *************** *** 79,94 **** helpDesc = win32api.RegEnumKey(key, keyNo) helpFile = win32api.RegQueryValue(key, helpDesc) ! if verbose: print "\t"+helpDesc+":", # query the os section. try: os.stat(helpFile ) ! if verbose: print helpFile except os.error: ! print "** Help file %s does not exist" % helpFile keyNo = keyNo + 1 ! except win32api.error, (code, fn, desc): ! import winerror if code!=winerror.ERROR_NO_MORE_ITEMS: ! raise win32api.error, (code, fn, desc) break finally: --- 80,96 ---- helpDesc = win32api.RegEnumKey(key, keyNo) helpFile = win32api.RegQueryValue(key, helpDesc) ! if verbose: print("\t"+helpDesc+":", end=' ') # query the os section. try: os.stat(helpFile ) ! if verbose: print(helpFile) except os.error: ! print("** Help file %s does not exist" % helpFile) keyNo = keyNo + 1 ! except win32api.error as xxx_todo_changeme2: ! (code, fn, desc) = xxx_todo_changeme2.args ! from . import winerror if code!=winerror.ERROR_NO_MORE_ITEMS: ! raise win32api.error(code, fn, desc) break finally: *************** *** 100,114 **** try: keyhandle = win32api.RegOpenKey(regutil.GetRootKey(), k) ! print "WARNING: 'Modules' registry entry is deprectated and evil!" ! except win32api.error, (code, fn, details): ! import winerror if code!=winerror.ERROR_FILE_NOT_FOUND: ! raise win32api.error, (code, fn, details) return def CheckRegistry(verbose=0): # check the registered modules ! if verbose and os.environ.has_key('pythonpath'): ! print "Warning - PythonPath in environment - please check it!" # Check out all paths on sys.path --- 102,117 ---- try: keyhandle = win32api.RegOpenKey(regutil.GetRootKey(), k) ! print("WARNING: 'Modules' registry entry is deprectated and evil!") ! except win32api.error as xxx_todo_changeme3: ! (code, fn, details) = xxx_todo_changeme3.args ! from . import winerror if code!=winerror.ERROR_FILE_NOT_FOUND: ! raise win32api.error(code, fn, details) return def CheckRegistry(verbose=0): # check the registered modules ! if verbose and 'pythonpath' in os.environ: ! print("Warning - PythonPath in environment - please check it!") # Check out all paths on sys.path Index: ntsecuritycon.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/Lib/ntsecuritycon.py,v retrieving revision 1.9 retrieving revision 1.9.2.1 diff -C2 -d -r1.9 -r1.9.2.1 *** ntsecuritycon.py 20 Jan 2008 03:43:44 -0000 1.9 --- ntsecuritycon.py 29 Aug 2008 04:59:25 -0000 1.9.2.1 *************** *** 644,681 **** ## from aclui.h # SI_OBJECT_INFO.dwFlags ! SI_EDIT_PERMS = 0x00000000L ! SI_EDIT_OWNER = 0x00000001L ! SI_EDIT_AUDITS = 0x00000002L ! SI_CONTAINER = 0x00000004L ! SI_READONLY = 0x00000008L ! SI_ADVANCED = 0x00000010L ! SI_RESET = 0x00000020L ! SI_OWNER_READONLY = 0x00000040L ! SI_EDIT_PROPERTIES = 0x00000080L ! SI_OWNER_RECURSE = 0x00000100L ! SI_NO_ACL_PROTECT = 0x00000200L ! SI_NO_TREE_APPLY = 0x00000400L ! SI_PAGE_TITLE = 0x00000800L ! SI_SERVER_IS_DC = 0x00001000L ! SI_RESET_DACL_TREE = 0x00004000L ! SI_RESET_SACL_TREE = 0x00008000L ! SI_OBJECT_GUID = 0x00010000L ! SI_EDIT_EFFECTIVE = 0x00020000L ! SI_RESET_DACL = 0x00040000L ! SI_RESET_SACL = 0x00080000L ! SI_RESET_OWNER = 0x00100000L ! SI_NO_ADDITIONAL_PERMISSION = 0x00200000L ! SI_MAY_WRITE = 0x10000000L SI_EDIT_ALL = (SI_EDIT_PERMS | SI_EDIT_OWNER | SI_EDIT_AUDITS) ! SI_AUDITS_ELEVATION_REQUIRED = 0x02000000L ! SI_VIEW_ONLY = 0x00400000L ! SI_OWNER_ELEVATION_REQUIRED = 0x04000000L ! SI_PERMS_ELEVATION_REQUIRED = 0x01000000L # SI_ACCESS.dwFlags ! SI_ACCESS_SPECIFIC = 0x00010000L ! SI_ACCESS_GENERAL = 0x00020000L ! SI_ACCESS_CONTAINER = 0x00040000L ! SI_ACCESS_PROPERTY = 0x00080000L # SI_PAGE_TYPE enum --- 644,681 ---- ## from aclui.h # SI_OBJECT_INFO.dwFlags ! SI_EDIT_PERMS = 0x00000000 ! SI_EDIT_OWNER = 0x00000001 ! SI_EDIT_AUDITS = 0x00000002 ! SI_CONTAINER = 0x00000004 ! SI_READONLY = 0x00000008 ! SI_ADVANCED = 0x00000010 ! SI_RESET = 0x00000020 ! SI_OWNER_READONLY = 0x00000040 ! SI_EDIT_PROPERTIES = 0x00000080 ! SI_OWNER_RECURSE = 0x00000100 ! SI_NO_ACL_PROTECT = 0x00000200 ! SI_NO_TREE_APPLY = 0x00000400 ! SI_PAGE_TITLE = 0x00000800 ! SI_SERVER_IS_DC = 0x00001000 ! SI_RESET_DACL_TREE = 0x00004000 ! SI_RESET_SACL_TREE = 0x00008000 ! SI_OBJECT_GUID = 0x00010000 ! SI_EDIT_EFFECTIVE = 0x00020000 ! SI_RESET_DACL = 0x00040000 ! SI_RESET_SACL = 0x00080000 ! SI_RESET_OWNER = 0x00100000 ! SI_NO_ADDITIONAL_PERMISSION = 0x00200000 ! SI_MAY_WRITE = 0x10000000 SI_EDIT_ALL = (SI_EDIT_PERMS | SI_EDIT_OWNER | SI_EDIT_AUDITS) ! SI_AUDITS_ELEVATION_REQUIRED = 0x02000000 ! SI_VIEW_ONLY = 0x00400000 ! SI_OWNER_ELEVATION_REQUIRED = 0x04000000 ! SI_PERMS_ELEVATION_REQUIRED = 0x01000000 # SI_ACCESS.dwFlags ! SI_ACCESS_SPECIFIC = 0x00010000 ! SI_ACCESS_GENERAL = 0x00020000 ! SI_ACCESS_CONTAINER = 0x00040000 ! SI_ACCESS_PROPERTY = 0x00080000 # SI_PAGE_TYPE enum *************** *** 686,689 **** SI_PAGE_EFFECTIVE =4 ! CFSTR_ACLUI_SID_INFO_LIST = u"CFSTR_ACLUI_SID_INFO_LIST" PSPCB_SI_INITDIALOG = 1025 ## WM_USER+1 --- 686,689 ---- SI_PAGE_EFFECTIVE =4 ! CFSTR_ACLUI_SID_INFO_LIST = "CFSTR_ACLUI_SID_INFO_LIST" PSPCB_SI_INITDIALOG = 1025 ## WM_USER+1 Index: win32con.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/Lib/win32con.py,v retrieving revision 1.23 retrieving revision 1.23.2.1 diff -C2 -d -r1.23 -r1.23.2.1 *** win32con.py 4 May 2008 10:43:37 -0000 1.23 --- win32con.py 29 Aug 2008 04:59:25 -0000 1.23.2.1 *************** *** 456,460 **** MB_SETFOREGROUND = 65536 MB_DEFAULT_DESKTOP_ONLY = 131072 ! MB_TOPMOST = 262144L MB_RIGHT = 524288 MB_RTLREADING = 1048576 --- 456,460 ---- MB_SETFOREGROUND = 65536 MB_DEFAULT_DESKTOP_ONLY = 131072 ! MB_TOPMOST = 262144 MB_RIGHT = 524288 MB_RTLREADING = 1048576 *************** *** 566,570 **** MFS_UNHILITE = MF_UNHILITE MFS_DEFAULT = MF_DEFAULT ! MFS_MASK = 4235L MFS_HOTTRACKDRAWN = 268435456 MFS_CACHEDBMP = 536870912 --- 566,570 ---- MFS_UNHILITE = MF_UNHILITE MFS_DEFAULT = MF_DEFAULT ! MFS_MASK = 4235 MFS_HOTTRACKDRAWN = 268435456 MFS_CACHEDBMP = 536870912 *************** *** 794,798 **** BS_USERBUTTON = 8 BS_AUTORADIOBUTTON = 9 ! BS_OWNERDRAW = 11L BS_LEFTTEXT = 32 BS_TEXT = 0 --- 794,798 ---- BS_USERBUTTON = 8 BS_AUTORADIOBUTTON = 9 ! BS_OWNERDRAW = 11 BS_LEFTTEXT = 32 BS_TEXT = 0 *************** *** 2415,2422 **** IMAGE_SYM_CLASS_SECTION = 104 IMAGE_SYM_CLASS_WEAK_EXTERNAL = 105 ! N_BTMASK = 017 ! N_TMASK = 060 ! N_TMASK1 = 0300 ! N_TMASK2 = 0360 N_BTSHFT = 4 N_TSHIFT = 2 --- 2415,2422 ---- IMAGE_SYM_CLASS_SECTION = 104 IMAGE_SYM_CLASS_WEAK_EXTERNAL = 105 ! N_BTMASK = 15 ! N_TMASK = 48 ! N_TMASK1 = 192 ! N_TMASK2 = 240 N_BTSHFT = 4 N_TSHIFT = 2 *************** *** 2431,2447 **** IMAGE_WEAK_EXTERN_SEARCH_ALIAS = 3 IMAGE_SIZEOF_RELOCATION = 10 ! IMAGE_REL_I386_SECTION = 012 ! IMAGE_REL_I386_SECREL = 013 ! IMAGE_REL_MIPS_REFHALF = 01 ! IMAGE_REL_MIPS_REFWORD = 02 ! IMAGE_REL_MIPS_JMPADDR = 03 ! IMAGE_REL_MIPS_REFHI = 04 ! IMAGE_REL_MIPS_REFLO = 05 ! IMAGE_REL_MIPS_GPREL = 06 ! IMAGE_REL_MIPS_LITERAL = 07 ! IMAGE_REL_MIPS_SECTION = 012 ! IMAGE_REL_MIPS_SECREL = 013 ! IMAGE_REL_MIPS_REFWORDNB = 042 ! IMAGE_REL_MIPS_PAIR = 045 IMAGE_REL_ALPHA_ABSOLUTE = 0 IMAGE_REL_ALPHA_REFLONG = 1 --- 2431,2447 ---- IMAGE_WEAK_EXTERN_SEARCH_ALIAS = 3 IMAGE_SIZEOF_RELOCATION = 10 ! IMAGE_REL_I386_SECTION = 10 ! IMAGE_REL_I386_SECREL = 11 ! IMAGE_REL_MIPS_REFHALF = 1 ! IMAGE_REL_MIPS_REFWORD = 2 ! IMAGE_REL_MIPS_JMPADDR = 3 ! IMAGE_REL_MIPS_REFHI = 4 ! IMAGE_REL_MIPS_REFLO = 5 ! IMAGE_REL_MIPS_GPREL = 6 ! IMAGE_REL_MIPS_LITERAL = 7 ! IMAGE_REL_MIPS_SECTION = 10 ! IMAGE_REL_MIPS_SECREL = 11 ! IMAGE_REL_MIPS_REFWORDNB = 34 ! IMAGE_REL_MIPS_PAIR = 37 IMAGE_REL_ALPHA_ABSOLUTE = 0 IMAGE_REL_ALPHA_REFLONG = 1 Index: pywintypes.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/Lib/pywintypes.py,v retrieving revision 1.13 retrieving revision 1.13.2.1 diff -C2 -d -r1.13 -r1.13.2.1 *** pywintypes.py 11 Mar 2008 04:23:31 -0000 1.13 --- pywintypes.py 29 Aug 2008 04:59:25 -0000 1.13.2.1 *************** *** 1,4 **** # Magic utility that "redirects" to pywintypesxx.dll ! def __import_pywin32_system_module__(modname, globs): # This has been through a number of iterations. The problem: how to --- 1,5 ---- # Magic utility that "redirects" to pywintypesxx.dll ! import imp, sys, os ! sys.modules['pywintypes_loader']=sys.modules['pywintypes'] def __import_pywin32_system_module__(modname, globs): # This has been through a number of iterations. The problem: how to *************** *** 18,22 **** # on pywintypesXX.dll. It then can check if the DLL we are looking for # lib is already loaded. - import imp, sys, os if not sys.platform.startswith("win32"): # These extensions can be built on Linux via the 'mainwin' toolkit. --- 19,22 ---- *************** *** 34,38 **** globs.update(mod.__dict__) return ! raise ImportError, "No dynamic module " + modname # See if this is a debug build. for suffix_item in imp.get_suffixes(): --- 34,38 ---- globs.update(mod.__dict__) return ! raise ImportError("No dynamic module " + modname) # See if this is a debug build. for suffix_item in imp.get_suffixes(): *************** *** 58,63 **** break else: ! raise ImportError, \ ! "Module '%s' isn't in frozen sys.path %s" % (modname, sys.path) else: # First see if it already in our process - if so, we must use that. --- 58,62 ---- break else: ! raise ImportError("Module '%s' isn't in frozen sys.path %s" % (modname, sys.path)) else: # First see if it already in our process - if so, we must use that. *************** *** 96,107 **** if found is None: # give up in disgust. ! raise ImportError, \ ! "No system module '%s' (%s)" % (modname, filename) ! # Python can load the module ! mod = imp.load_module(modname, None, found, ! ('.dll', 'rb', imp.C_EXTENSION)) # and fill our namespace with it. ! globs.update(mod.__dict__) ! __import_pywin32_system_module__("pywintypes", globals()) --- 95,109 ---- if found is None: # give up in disgust. ! raise ImportError("No system module '%s' (%s)" % (modname, filename)) # Python can load the module ! ## print ('__import_pywin32_system_module__ (before):', __import_pywin32_system_module__) ! mod = imp.load_dynamic(modname, found) ! ## print ('mod:', mod) ! ## print ('__import_pywin32_system_module__ (after):', __import_pywin32_system_module__) # and fill our namespace with it. ! # This doesn't work in py3k, where pywintypes actually ends up as the compiled pyd ! # which is loaded, rather than this script ! ## globs.update(mod.__dict__) ! mod.__import_pywin32_system_module__ = __import_pywin32_system_module__ ! __import_pywin32_system_module__("pywintypes", {}) Index: rasutil.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/Lib/rasutil.py,v retrieving revision 1.1 retrieving revision 1.1.4.1 diff -C2 -d -r1.1 -r1.1.4.1 *** rasutil.py 2 Sep 1999 00:19:28 -0000 1.1 --- rasutil.py 29 Aug 2008 04:59:25 -0000 1.1.4.1 *************** *** 33,37 **** def TestCallback( hras, msg, state, error, exterror): ! print "Callback called with ", hras, msg, stateStrings[state], error, exterror def test(rasName = "_ Divert Off"): --- 33,37 ---- def TestCallback( hras, msg, state, error, exterror): ! print("Callback called with ", hras, msg, stateStrings[state], error, exterror) def test(rasName = "_ Divert Off"): Index: commctrl.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/Lib/commctrl.py,v retrieving revision 1.6 retrieving revision 1.6.4.1 diff -C2 -d -r1.6 -r1.6.4.1 *** commctrl.py 12 Apr 2005 03:03:53 -0000 1.6 --- commctrl.py 29 Aug 2008 04:59:25 -0000 1.6.4.1 *************** *** 110,115 **** CDIS_MARKED = 128 CDIS_INDETERMINATE = 256 ! CLR_NONE = 0xFFFFFFFFL ! CLR_DEFAULT = 0xFF000000L ILC_MASK = 1 ILC_COLOR = 0 --- 110,115 ---- CDIS_MARKED = 128 CDIS_INDETERMINATE = 256 ! CLR_NONE = 0xFFFFFFFF ! CLR_DEFAULT = 0xFF000000 ILC_MASK = 1 ILC_COLOR = 0 *************** *** 789,800 **** HOTKEY_CLASSA = "msctls_hotkey32" HOTKEY_CLASS = HOTKEY_CLASSA ! CCS_TOP = 0x00000001L ! CCS_NOMOVEY = 0x00000002L ! CCS_BOTTOM = 0x00000003L ! CCS_NORESIZE = 0x00000004L ! CCS_NOPARENTALIGN = 0x00000008L ! CCS_ADJUSTABLE = 0x00000020L ! CCS_NODIVIDER = 0x00000040L ! CCS_VERT = 0x00000080L CCS_LEFT = (CCS_VERT | CCS_TOP) CCS_RIGHT = (CCS_VERT | CCS_BOTTOM) --- 789,800 ---- HOTKEY_CLASSA = "msctls_hotkey32" HOTKEY_CLASS = HOTKEY_CLASSA ! CCS_TOP = 0x00000001 ! CCS_NOMOVEY = 0x00000002 ! CCS_BOTTOM = 0x00000003 ! CCS_NORESIZE = 0x00000004 ! CCS_NOPARENTALIGN = 0x00000008 ! CCS_ADJUSTABLE = 0x00000020 ! CCS_NODIVIDER = 0x00000040 ! CCS_VERT = 0x00000080 CCS_LEFT = (CCS_VERT | CCS_TOP) CCS_RIGHT = (CCS_VERT | CCS_BOTTOM) *************** *** 1526,1542 **** TME_CANCEL = -2147483648 HOVER_DEFAULT = -1 ! WSB_PROP_CYVSCROLL = 0x00000001L ! WSB_PROP_CXHSCROLL = 0x00000002L ! WSB_PROP_CYHSCROLL = 0x00000004L ! WSB_PROP_CXVSCROLL = 0x00000008L ! WSB_PROP_CXHTHUMB = 0x00000010L ! WSB_PROP_CYVTHUMB = 0x00000020L ! WSB_PROP_VBKGCOLOR = 0x00000040L ! WSB_PROP_HBKGCOLOR = 0x00000080L ! WSB_PROP_VSTYLE = 0x00000100L ! WSB_PROP_HSTYLE = 0x00000200L ! WSB_PROP_WINSTYLE = 0x00000400L ! WSB_PROP_PALETTE = 0x00000800L ! WSB_PROP_MASK = 0x00000FFFL FSB_FLAT_MODE = 2 FSB_ENCARTA_MODE = 1 --- 1526,1542 ---- TME_CANCEL = -2147483648 HOVER_DEFAULT = -1 ! WSB_PROP_CYVSCROLL = 0x00000001 ! WSB_PROP_CXHSCROLL = 0x00000002 ! WSB_PROP_CYHSCROLL = 0x00000004 ! WSB_PROP_CXVSCROLL = 0x00000008 ! WSB_PROP_CXHTHUMB = 0x00000010 ! WSB_PROP_CYVTHUMB = 0x00000020 ! WSB_PROP_VBKGCOLOR = 0x00000040 ! WSB_PROP_HBKGCOLOR = 0x00000080 ! WSB_PROP_VSTYLE = 0x00000100 ! WSB_PROP_HSTYLE = 0x00000200 ! WSB_PROP_WINSTYLE = 0x00000400 ! WSB_PROP_PALETTE = 0x00000800 ! WSB_PROP_MASK = 0x00000FFF FSB_FLAT_MODE = 2 FSB_ENCARTA_MODE = 1 Index: afxres.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/Lib/afxres.py,v retrieving revision 1.2 retrieving revision 1.2.4.1 diff -C2 -d -r1.2 -r1.2.4.1 *** afxres.py 13 Jul 2004 07:46:20 -0000 1.2 --- afxres.py 29 Aug 2008 04:59:25 -0000 1.2.4.1 *************** *** 54,58 **** AFX_IDW_DOCKBAR_BOTTOM = 0xE81E AFX_IDW_DOCKBAR_FLOAT = 0xE81F ! def AFX_CONTROLBAR_MASK(nIDC): return (1L << (nIDC - AFX_IDW_CONTROLBAR_FIRST)) AFX_IDW_PANE_FIRST = 0xE900 --- 54,58 ---- AFX_IDW_DOCKBAR_BOTTOM = 0xE81E AFX_IDW_DOCKBAR_FLOAT = 0xE81F ! def AFX_CONTROLBAR_MASK(nIDC): return (1 << (nIDC - AFX_IDW_CONTROLBAR_FIRST)) AFX_IDW_PANE_FIRST = 0xE900 Index: sspi.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/Lib/sspi.py,v retrieving revision 1.3 retrieving revision 1.3.4.1 diff -C2 -d -r1.3 -r1.3.4.1 *** sspi.py 13 Feb 2006 14:47:20 -0000 1.3 --- sspi.py 29 Aug 2008 04:59:25 -0000 1.3.4.1 *************** *** 229,231 **** data, key = sspiclient.encrypt("hello") assert sspiserver.decrypt(data, key) == "hello" ! print "cool!" --- 229,231 ---- data, key = sspiclient.encrypt("hello") assert sspiserver.decrypt(data, key) == "hello" ! print("cool!") Index: regutil.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/Lib/regutil.py,v retrieving revision 1.3 retrieving revision 1.3.4.1 diff -C2 -d -r1.3 -r1.3.4.1 *** regutil.py 8 Jan 2002 05:41:13 -0000 1.3 --- regutil.py 29 Aug 2008 04:59:25 -0000 1.3.4.1 *************** *** 33,42 **** import types if rootkey is None: rootkey = GetRootKey() ! if type(value)==types.StringType: typeId = win32con.REG_SZ ! elif type(value)==types.IntType: typeId = win32con.REG_DWORD else: ! raise TypeError, "Value must be string or integer - was passed " + str(value) win32api.RegSetValue(rootkey, subKey, typeId ,value) --- 33,44 ---- import types if rootkey is None: rootkey = GetRootKey() ! if isinstance(value, str): typeId = win32con.REG_SZ ! elif isinstance(value, bytes): ! typeId = win32con.REG_BINARY ! elif isinstance(value, int): typeId = win32con.REG_DWORD else: ! raise TypeError("Value must be string or integer - was passed " + str(value)) win32api.RegSetValue(rootkey, subKey, typeId ,value) *************** *** 73,77 **** # Note - Dont work on win32s (but we dont care anymore!) if exeAppPath: ! raise error, "Do not support exeAppPath argument currently" if exeAlias is None: exeAlias = os.path.basename(exeFullPath) --- 75,79 ---- # Note - Dont work on win32s (but we dont care anymore!) if exeAppPath: ! raise error("Do not support exeAppPath argument currently") if exeAlias is None: exeAlias = os.path.basename(exeFullPath) *************** *** 88,95 **** try: win32api.RegDeleteKey(GetRootKey(), GetAppPathsKey() + "\\" + exeAlias) ! except win32api.error, (code, fn, details): ! import winerror if code!=winerror.ERROR_FILE_NOT_FOUND: ! raise win32api.error, (code, fn, desc) return --- 90,98 ---- try: win32api.RegDeleteKey(GetRootKey(), GetAppPathsKey() + "\\" + exeAlias) ! except win32api.error as xxx_todo_changeme: ! (code, fn, details) = xxx_todo_changeme.args ! from . import winerror if code!=winerror.ERROR_FILE_NOT_FOUND: ! raise win32api.error(code, fn, desc) return *************** *** 107,114 **** try: win32api.RegDeleteKey(GetRootKey(), keyStr) ! except win32api.error, (code, fn, details): ! import winerror if code!=winerror.ERROR_FILE_NOT_FOUND: ! raise win32api.error, (code, fn, desc) return --- 110,118 ---- try: win32api.RegDeleteKey(GetRootKey(), keyStr) ! except win32api.error as xxx_todo_changeme1: ! (code, fn, details) = xxx_todo_changeme1.args ! from . import winerror if code!=winerror.ERROR_FILE_NOT_FOUND: ! raise win32api.error(code, fn, desc) return *************** *** 120,127 **** try: return win32api.RegQueryValue(GetRootKey(), keyStr) ! except win32api.error, (code, fn, details): ! import winerror if code!=winerror.ERROR_FILE_NOT_FOUND: ! raise win32api.error, (code, fn, details) return None --- 124,132 ---- try: return win32api.RegQueryValue(GetRootKey(), keyStr) ! except win32api.error as xxx_todo_changeme2: ! (code, fn, details) = xxx_todo_changeme2.args ! from . import winerror if code!=winerror.ERROR_FILE_NOT_FOUND: ! raise win32api.error(code, fn, details) return None *************** *** 139,143 **** os.stat(modPath) except os.error: ! print "Warning: Registering non-existant module %s" % modPath win32api.RegSetValue(GetRootKey(), BuildDefaultPythonKey() + "\\Modules\\%s" % modName, --- 144,148 ---- os.stat(modPath) except os.error: ! print("Warning: Registering non-existant module %s" % modPath) win32api.RegSetValue(GetRootKey(), BuildDefaultPythonKey() + "\\Modules\\%s" % modName, *************** *** 152,159 **** win32api.RegDeleteKey(GetRootKey(), BuildDefaultPythonKey() + "\\Modules\\%s" % modName) ! except win32api.error, (code, fn, desc): ! import winerror if code!=winerror.ERROR_FILE_NOT_FOUND: ! raise win32api.error, (code, fn, desc) def GetRegisteredHelpFile(helpDesc): --- 157,165 ---- win32api.RegDeleteKey(GetRootKey(), BuildDefaultPythonKey() + "\\Modules\\%s" % modName) ! except win32api.error as xxx_todo_changeme3: ! (code, fn, desc) = xxx_todo_changeme3.args ! from . import winerror if code!=winerror.ERROR_FILE_NOT_FOUND: ! raise win32api.error(code, fn, desc) def GetRegisteredHelpFile(helpDesc): *************** *** 185,189 **** if bCheckFile: os.stat(fullHelpFile) except os.error: ! raise ValueError, "Help file does not exist" # Now register with Python itself. win32api.RegSetValue(GetRootKey(), --- 191,195 ---- if bCheckFile: os.stat(fullHelpFile) except os.error: ! raise ValueError("Help file does not exist") # Now register with Python itself. win32api.RegSetValue(GetRootKey(), *************** *** 200,207 **** try: win32api.RegDeleteValue(key, helpFile) ! except win32api.error, (code, fn, desc): ! import winerror if code!=winerror.ERROR_FILE_NOT_FOUND: ! raise win32api.error, (code, fn, desc) finally: win32api.RegCloseKey(key) --- 206,214 ---- try: win32api.RegDeleteValue(key, helpFile) ! except win32api.error as xxx_todo_changeme4: ! (code, fn, desc) = xxx_todo_changeme4.args ! from . import winerror if code!=winerror.ERROR_FILE_NOT_FOUND: ! raise win32api.error(code, fn, desc) finally: win32api.RegCloseKey(key) *************** *** 212,219 **** win32api.RegDeleteKey(GetRootKey(), BuildDefaultPythonKey() + "\\Help\\%s" % helpDesc) ! except win32api.error, (code, fn, desc): ! import winerror if code!=winerror.ERROR_FILE_NOT_FOUND: ! raise win32api.error, (code, fn, desc) def RegisterCoreDLL(coredllName = None): --- 219,227 ---- win32api.RegDeleteKey(GetRootKey(), BuildDefaultPythonKey() + "\\Help\\%s" % helpDesc) ! except win32api.error as xxx_todo_changeme5: ! (code, fn, desc) = xxx_todo_changeme5.args ! from . import winerror if code!=winerror.ERROR_FILE_NOT_FOUND: ! raise win32api.error(code, fn, desc) def RegisterCoreDLL(coredllName = None): *************** *** 230,234 **** os.stat(coredllName) except os.error: ! print "Warning: Registering non-existant core DLL %s" % coredllName hKey = win32api.RegCreateKey(GetRootKey() , BuildDefaultPythonKey()) --- 238,242 ---- os.stat(coredllName) except os.error: ! print("Warning: Registering non-existant core DLL %s" % coredllName) hKey = win32api.RegCreateKey(GetRootKey() , BuildDefaultPythonKey()) Index: netbios.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/Lib/netbios.py,v retrieving revision 1.4 retrieving revision 1.4.4.1 diff -C2 -d -r1.4 -r1.4.4.1 *** netbios.py 22 Mar 2006 10:41:05 -0000 1.4 --- netbios.py 29 Aug 2008 04:59:25 -0000 1.4.4.1 *************** *** 1,5 **** import win32wnet import struct - import string # Constants generated by h2py from nb30.h --- 1,4 ---- *************** *** 194,198 **** class NCBStruct: def __init__(self, items): ! self._format = string.join(map(lambda item: item[0], items), "") self._items = items self._buffer_ = win32wnet.NCBBuffer(struct.calcsize(self._format)) --- 193,197 ---- class NCBStruct: def __init__(self, items): ! self._format = "".join([item[0] for item in items]) self._items = items self._buffer_ = win32wnet.NCBBuffer(struct.calcsize(self._format)) *************** *** 217,235 **** vals.append(None) ! self._buffer_[:] = apply( struct.pack, (self._format,) + tuple(vals) ) def _unpack(self): items = struct.unpack(self._format, self._buffer_) assert len(items)==len(self._items), "unexpected number of items to unpack!" ! for (format, name), val in map(None, self._items, items): self.__dict__[name] = val def __setattr__(self, attr, val): ! if not self.__dict__.has_key(attr) and attr[0]!='_': for format, attr_name in self._items: if attr==attr_name: break else: ! raise AttributeError, attr self.__dict__[attr] = val --- 216,234 ---- vals.append(None) ! self._buffer_[:] = struct.pack(*(self._format,) + tuple(vals)) def _unpack(self): items = struct.unpack(self._format, self._buffer_) assert len(items)==len(self._items), "unexpected number of items to unpack!" ! for (format, name), val in zip(self._items, items): self.__dict__[name] = val def __setattr__(self, attr, val): ! if attr not in self.__dict__ and attr[0]!='_': for format, attr_name in self._items: if attr==attr_name: break else: ! raise AttributeError(attr) self.__dict__[attr] = val *************** *** 266,286 **** ncb.Buffer = la_enum rc = Netbios(ncb) ! if rc != 0: raise RuntimeError, "Unexpected result %d" % (rc,) for i in range(la_enum.length): ncb.Reset() ncb.Command = NCBRESET ! ncb.Lana_num = ord(la_enum.lana[i]) rc = Netbios(ncb) ! if rc != 0: raise RuntimeError, "Unexpected result %d" % (rc,) ncb.Reset() ncb.Command = NCBASTAT ! ncb.Lana_num = ord(la_enum.lana[i]) ! ncb.Callname = "* " adapter = ADAPTER_STATUS() ncb.Buffer = adapter Netbios(ncb) ! print "Adapter address:", for ch in adapter.adapter_address: ! print "%02x" % (ord(ch),) , ! print \ No newline at end of file --- 265,285 ---- ncb.Buffer = la_enum rc = Netbios(ncb) ! if rc != 0: raise RuntimeError("Unexpected result %d" % (rc,)) for i in range(la_enum.length): ncb.Reset() ncb.Command = NCBRESET ! ncb.Lana_num = la_enum.lana[i] rc = Netbios(ncb) ! if rc != 0: raise RuntimeError("Unexpected result %d" % (rc,)) ncb.Reset() ncb.Command = NCBASTAT ! ncb.Lana_num = la_enum.lana[i] ! ncb.Callname = b"* " adapter = ADAPTER_STATUS() ncb.Buffer = adapter Netbios(ncb) ! print("Adapter address:", end=' ') for ch in adapter.adapter_address: ! print("%02x" % (ch,), end=' ') ! print() \ No newline at end of file Index: win32traceutil.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/Lib/win32traceutil.py,v retrieving revision 1.3 retrieving revision 1.3.2.1 diff -C2 -d -r1.3 -r1.3.2.1 *** win32traceutil.py 30 Jun 2008 12:59:11 -0000 1.3 --- win32traceutil.py 29 Aug 2008 04:59:25 -0000 1.3.2.1 *************** *** 33,37 **** pass # Oh well! win32trace.InitRead() ! print "Collecting Python Trace Output..." try: while 1: --- 33,37 ---- pass # Oh well! win32trace.InitRead() ! print ("Collecting Python Trace Output...") try: while 1: *************** *** 39,43 **** sys.stdout.write(win32trace.blockingread(500)) except KeyboardInterrupt: ! print "Ctrl+C" --- 39,43 ---- sys.stdout.write(win32trace.blockingread(500)) except KeyboardInterrupt: ! print ("Ctrl+C") *************** *** 45,49 **** win32trace.InitWrite() try: # Under certain servers, sys.stdout may be invalid. ! print "Redirecting output to win32trace remote collector" except: pass --- 45,49 ---- win32trace.InitWrite() try: # Under certain servers, sys.stdout may be invalid. ! print ("Redirecting output to win32trace remote collector") except: pass Index: win32netcon.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/Lib/win32netcon.py,v retrieving revision 1.6 retrieving revision 1.6.2.1 diff -C2 -d -r1.6 -r1.6.2.1 *** win32netcon.py 4 Jun 2008 08:18:55 -0000 1.6 --- win32netcon.py 29 Aug 2008 04:59:25 -0000 1.6.2.1 *************** *** 311,315 **** DEF_MIN_PWAGE = 0 DEF_FORCE_LOGOFF = -1 ! ONE_DAY = 01*24*3600 GROUP_SPECIALGRP_USERS = "USERS" GROUP_SPECIALGRP_ADMINS = "ADMINS" --- 311,315 ---- DEF_MIN_PWAGE = 0 DEF_FORCE_LOGOFF = -1 ! ONE_DAY = 1*24*3600 GROUP_SPECIALGRP_USERS = "USERS" GROUP_SPECIALGRP_ADMINS = "ADMINS" *************** *** 353,357 **** SV_TYPE_DOMAIN_ENUM = -2147483648 SV_TYPE_ALL = -1 ! SV_NODISC = (-1L) SV_USERSECURITY = 1 SV_SHARESECURITY = 0 --- 353,357 ---- SV_TYPE_DOMAIN_ENUM = -2147483648 SV_TYPE_ALL = -1 ! SV_NODISC = -1 SV_USERSECURITY = 1 SV_SHARESECURITY = 0 *************** *** 651,655 **** NetSetupDomainName = 3 - NetValidateAuthentication = 1 - NetValidatePasswordChange = 2 - NetValidatePasswordReset = 3 --- 651,652 ---- Index: mmsystem.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/Lib/mmsystem.py,v retrieving revision 1.2 retrieving revision 1.2.4.1 diff -C2 -d -r1.2 -r1.2.4.1 *** mmsystem.py 10 Jan 2006 04:29:49 -0000 1.2 --- mmsystem.py 29 Aug 2008 04:59:25 -0000 1.2.4.1 *************** *** 109,119 **** DRV_MCI_FIRST = DRV_RESERVED DRV_MCI_LAST = (DRV_RESERVED + 0xFFF) ! CALLBACK_TYPEMASK = 0x00070000l ! CALLBACK_NULL = 0x00000000l ! CALLBACK_WINDOW = 0x00010000l ! CALLBACK_TASK = 0x00020000l ! CALLBACK_FUNCTION = 0x00030000l CALLBACK_THREAD = (CALLBACK_TASK) ! CALLBACK_EVENT = 0x00050000l SND_SYNC = 0x0000 SND_ASYNC = 0x0001 --- 109,119 ---- DRV_MCI_FIRST = DRV_RESERVED DRV_MCI_LAST = (DRV_RESERVED + 0xFFF) ! CALLBACK_TYPEMASK = 0x00070000 ! CALLBACK_NULL = 0x00000000 ! CALLBACK_WINDOW = 0x00010000 ! CALLBACK_TASK = 0x00020000 ! CALLBACK_FUNCTION = 0x00030000 CALLBACK_THREAD = (CALLBACK_TASK) ! CALLBACK_EVENT = 0x00050000 SND_SYNC = 0x0000 SND_ASYNC = 0x0001 *************** *** 122,130 **** SND_LOOP = 0x0008 SND_NOSTOP = 0x0010 ! SND_NOWAIT = 0x00002000L ! SND_ALIAS = 0x00010000L ! SND_ALIAS_ID = 0x00110000L ! SND_FILENAME = 0x00020000L ! SND_RESOURCE = 0x00040004L SND_PURGE = 0x0040 SND_APPLICATION = 0x0080 --- 122,130 ---- SND_LOOP = 0x0008 SND_NOSTOP = 0x0010 ! SND_NOWAIT = 0x00002000 ! SND_ALIAS = 0x00010000 ! SND_ALIAS_ID = 0x00110000 ! SND_FILENAME = 0x00020000 ! SND_RESOURCE = 0x00040004 SND_PURGE = 0x0040 SND_APPLICATION = 0x0080 *************** *** 141,145 **** WIM_CLOSE = MM_WIM_CLOSE WIM_DATA = MM_WIM_DATA ! WAVE_MAPPER = 0xFFFFFFFFL WAVE_FORMAT_QUERY = 0x0001 WAVE_ALLOWSYNC = 0x0002 --- 141,145 ---- WIM_CLOSE = MM_WIM_CLOSE WIM_DATA = MM_WIM_DATA ! WAVE_MAPPER = 0xFFFFFFFF WAVE_FORMAT_QUERY = 0x0001 WAVE_ALLOWSYNC = 0x0002 *************** *** 195,199 **** MIM_MOREDATA = MM_MIM_MOREDATA MOM_POSITIONCB = MM_MOM_POSITIONCB ! MIDI_IO_STATUS = 0x00000020L MIDI_CACHE_ALL = 1 MIDI_CACHE_BESTFIT = 2 --- 195,199 ---- MIM_MOREDATA = MM_MIM_MOREDATA MOM_POSITIONCB = MM_MOM_POSITIONCB ! MIDI_IO_STATUS = 0x00000020 MIDI_CACHE_ALL = 1 MIDI_CACHE_BESTFIT = 2 *************** *** 213,228 **** MHDR_INQUEUE = 0x00000004 MHDR_ISSTRM = 0x00000008 ! MEVT_F_SHORT = 0x00000000L ! MEVT_F_LONG = 0x80000000L ! MEVT_F_CALLBACK = 0x40000000L def MEVT_EVENTTYPE(x): return ((BYTE)(((x)>>24)&0xFF)) ! def MEVT_EVENTPARM(x): return ((DWORD)((x)&0x00FFFFFFL)) MIDISTRM_ERROR = (-2) ! MIDIPROP_SET = 0x80000000L ! MIDIPROP_GET = 0x40000000L ! MIDIPROP_TIMEDIV = 0x00000001L ! MIDIPROP_TEMPO = 0x00000002L AUXCAPS_CDAUDIO = 1 AUXCAPS_AUXIN = 2 --- 213,228 ---- MHDR_INQUEUE = 0x00000004 MHDR_ISSTRM = 0x00000008 ! MEVT_F_SHORT = 0x00000000 ! MEVT_F_LONG = 0x80000000 ! MEVT_F_CALLBACK = 0x40000000 def MEVT_EVENTTYPE(x): return ((BYTE)(((x)>>24)&0xFF)) ! def MEVT_EVENTPARM(x): return ((DWORD)((x)&0x00FFFFFF)) MIDISTRM_ERROR = (-2) ! MIDIPROP_SET = 0x80000000 ! MIDIPROP_GET = 0x40000000 ! MIDIPROP_TIMEDIV = 0x00000001 ! MIDIPROP_TEMPO = 0x00000002 AUXCAPS_CDAUDIO = 1 AUXCAPS_AUXIN = 2 *************** *** 235,254 **** MIXERR_INVALVALUE = (MIXERR_BASE + 2) MIXERR_LASTERROR = (MIXERR_BASE + 2) ! MIXER_OBJECTF_HANDLE = 0x80000000L ! MIXER_OBJECTF_MIXER = 0x00000000L MIXER_OBJECTF_HMIXER = (MIXER_OBJECTF_HANDLE|MIXER_OBJECTF_MIXER) ! MIXER_OBJECTF_WAVEOUT = 0x10000000L MIXER_OBJECTF_HWAVEOUT = (MIXER_OBJECTF_HANDLE|MIXER_OBJECTF_WAVEOUT) ! MIXER_OBJECTF_WAVEIN = 0x20000000L MIXER_OBJECTF_HWAVEIN = (MIXER_OBJECTF_HANDLE|MIXER_OBJECTF_WAVEIN) ! MIXER_OBJECTF_MIDIOUT = 0x30000000L MIXER_OBJECTF_HMIDIOUT = (MIXER_OBJECTF_HANDLE|MIXER_OBJECTF_MIDIOUT) ! MIXER_OBJECTF_MIDIIN = 0x40000000L MIXER_OBJECTF_HMIDIIN = (MIXER_OBJECTF_HANDLE|MIXER_OBJECTF_MIDIIN) ! MIXER_OBJECTF_AUX = 0x50000000L ! MIXERLINE_LINEF_ACTIVE = 0x00000001L ! MIXERLINE_LINEF_DISCONNECTED = 0x00008000L ! MIXERLINE_LINEF_SOURCE = 0x80000000L ! MIXERLINE_COMPONENTTYPE_DST_FIRST = 0x00000000L MIXERLINE_COMPONENTTYPE_DST_UNDEFINED = (MIXERLINE_COMPONENTTYPE_DST_FIRST + 0) MIXERLINE_COMPONENTTYPE_DST_DIGITAL = (MIXERLINE_COMPONENTTYPE_DST_FIRST + 1) --- 235,254 ---- MIXERR_INVALVALUE = (MIXERR_BASE + 2) MIXERR_LASTERROR = (MIXERR_BASE + 2) ! MIXER_OBJECTF_HANDLE = 0x80000000 ! MIXER_OBJECTF_MIXER = 0x00000000 MIXER_OBJECTF_HMIXER = (MIXER_OBJECTF_HANDLE|MIXER_OBJECTF_MIXER) ! MIXER_OBJECTF_WAVEOUT = 0x10000000 MIXER_OBJECTF_HWAVEOUT = (MIXER_OBJECTF_HANDLE|MIXER_OBJECTF_WAVEOUT) ! MIXER_OBJECTF_WAVEIN = 0x20000000 MIXER_OBJECTF_HWAVEIN = (MIXER_OBJECTF_HANDLE|MIXER_OBJECTF_WAVEIN) ! MIXER_OBJECTF_MIDIOUT = 0x30000000 MIXER_OBJECTF_HMIDIOUT = (MIXER_OBJECTF_HANDLE|MIXER_OBJECTF_MIDIOUT) ! MIXER_OBJECTF_MIDIIN = 0x40000000 MIXER_OBJECTF_HMIDIIN = (MIXER_OBJECTF_HANDLE|MIXER_OBJECTF_MIDIIN) ! MIXER_OBJECTF_AUX = 0x50000000 ! MIXERLINE_LINEF_ACTIVE = 0x00000001 ! MIXERLINE_LINEF_DISCONNECTED = 0x00008000 ! MIXERLINE_LINEF_SOURCE = 0x80000000 ! MIXERLINE_COMPONENTTYPE_DST_FIRST = 0x00000000 MIXERLINE_COMPONENTTYPE_DST_UNDEFINED = (MIXERLINE_COMPONENTTYPE_DST_FIRST + 0) MIXERLINE_COMPONENTTYPE_DST_DIGITAL = (MIXERLINE_COMPONENTTYPE_DST_FIRST + 1) *************** *** 261,265 **** MIXERLINE_COMPONENTTYPE_DST_VOICEIN = (MIXERLINE_COMPONENTTYPE_DST_FIRST + 8) MIXERLINE_COMPONENTTYPE_DST_LAST = (MIXERLINE_COMPONENTTYPE_DST_FIRST + 8) ! MIXERLINE_COMPONENTTYPE_SRC_FIRST = 0x00001000L MIXERLINE_COMPONENTTYPE_SRC_UNDEFINED = (MIXERLINE_COMPONENTTYPE_SRC_FIRST + 0) MIXERLINE_COMPONENTTYPE_SRC_DIGITAL = (MIXERLINE_COMPONENTTYPE_SRC_FIRST + 1) --- 261,265 ---- MIXERLINE_COMPONENTTYPE_DST_VOICEIN = (MIXERLINE_COMPONENTTYPE_DST_FIRST + 8) MIXERLINE_COMPONENTTYPE_DST_LAST = (MIXERLINE_COMPONENTTYPE_DST_FIRST + 8) ! MIXERLINE_COMPONENTTYPE_SRC_FIRST = 0x00001000 MIXERLINE_COMPONENTTYPE_SRC_UNDEFINED = (MIXERLINE_COMPONENTTYPE_SRC_FIRST + 0) MIXERLINE_COMPONENTTYPE_SRC_DIGITAL = (MIXERLINE_COMPONENTTYPE_SRC_FIRST + 1) *************** *** 280,316 **** MIXERLINE_TARGETTYPE_MIDIIN = 4 MIXERLINE_TARGETTYPE_AUX = 5 ! MIXER_GETLINEINFOF_DESTINATION = 0x00000000L ! MIXER_GETLINEINFOF_SOURCE = 0x00000001L ! MIXER_GETLINEINFOF_LINEID = 0x00000002L ! MIXER_GETLINEINFOF_COMPONENTTYPE = 0x00000003L ! MIXER_GETLINEINFOF_TARGETTYPE = 0x00000004L ! MIXER_GETLINEINFOF_QUERYMASK = 0x0000000FL ! MIXERCONTROL_CONTROLF_UNIFORM = 0x00000001L ! MIXERCONTROL_CONTROLF_MULTIPLE = 0x00000002L ! MIXERCONTROL_CONTROLF_DISABLED = 0x80000000L ! MIXERCONTROL_CT_CLASS_MASK = 0xF0000000L ! MIXERCONTROL_CT_CLASS_CUSTOM = 0x00000000L ! MIXERCONTROL_CT_CLASS_METER = 0x10000000L ! MIXERCONTROL_CT_CLASS_SWITCH = 0x20000000L ! MIXERCONTROL_CT_CLASS_NUMBER = 0x30000000L ! MIXERCONTROL_CT_CLASS_SLIDER = 0x40000000L ! MIXERCONTROL_CT_CLASS_FADER = 0x50000000L ! MIXERCONTROL_CT_CLASS_TIME = 0x60000000L ! MIXERCONTROL_CT_CLASS_LIST = 0x70000000L ! MIXERCONTROL_CT_SUBCLASS_MASK = 0x0F000000L ! MIXERCONTROL_CT_SC_SWITCH_BOOLEAN = 0x00000000L ! MIXERCONTROL_CT_SC_SWITCH_BUTTON = 0x01000000L ! MIXERCONTROL_CT_SC_METER_POLLED = 0x00000000L ! MIXERCONTROL_CT_SC_TIME_MICROSECS = 0x00000000L ! MIXERCONTROL_CT_SC_TIME_MILLISECS = 0x01000000L ! MIXERCONTROL_CT_SC_LIST_SINGLE = 0x00000000L ! MIXERCONTROL_CT_SC_LIST_MULTIPLE = 0x01000000L ! MIXERCONTROL_CT_UNITS_MASK = 0x00FF0000L ! MIXERCONTROL_CT_UNITS_CUSTOM = 0x00000000L ! MIXERCONTROL_CT_UNITS_BOOLEAN = 0x00010000L ! MIXERCONTROL_CT_UNITS_SIGNED = 0x00020000L ! MIXERCONTROL_CT_UNITS_UNSIGNED = 0x00030000L ! MIXERCONTROL_CT_UNITS_DECIBELS = 0x00040000L ! MIXERCONTROL_CT_UNITS_PERCENT = 0x00050000L MIXERCONTROL_CONTROLTYPE_CUSTOM = (MIXERCONTROL_CT_CLASS_CUSTOM | MIXERCONTROL_CT_UNITS_CUSTOM) MIXERCONTROL_CONTROLTYPE_BOOLEANMETER = (MIXERCONTROL_CT_CLASS_METER | MIXERCONTROL_CT_SC_METER_POLLED | MIXERCONTROL_CT_UNITS_BOOLEAN) --- 280,316 ---- MIXERLINE_TARGETTYPE_MIDIIN = 4 MIXERLINE_TARGETTYPE_AUX = 5 ! MIXER_GETLINEINFOF_DESTINATION = 0x00000000 ! MIXER_GETLINEINFOF_SOURCE = 0x00000001 ! MIXER_GETLINEINFOF_LINEID = 0x00000002 ! MIXER_GETLINEINFOF_COMPONENTTYPE = 0x00000003 ! MIXER_GETLINEINFOF_TARGETTYPE = 0x00000004 ! MIXER_GETLINEINFOF_QUERYMASK = 0x0000000F ! MIXERCONTROL_CONTROLF_UNIFORM = 0x00000001 ! MIXERCONTROL_CONTROLF_MULTIPLE = 0x00000002 ! MIXERCONTROL_CONTROLF_DISABLED = 0x80000000 ! MIXERCONTROL_CT_CLASS_MASK = 0xF0000000 ! MIXERCONTROL_CT_CLASS_CUSTOM = 0x00000000 ! MIXERCONTROL_CT_CLASS_METER = 0x10000000 ! MIXERCONTROL_CT_CLASS_SWITCH = 0x20000000 ! MIXERCONTROL_CT_CLASS_NUMBER = 0x30000000 ! MIXERCONTROL_CT_CLASS_SLIDER = 0x40000000 ! MIXERCONTROL_CT_CLASS_FADER = 0x50000000 ! MIXERCONTROL_CT_CLASS_TIME = 0x60000000 ! MIXERCONTROL_CT_CLASS_LIST = 0x70000000 ! MIXERCONTROL_CT_SUBCLASS_MASK = 0x0F000000 ! MIXERCONTROL_CT_SC_SWITCH_BOOLEAN = 0x00000000 ! MIXERCONTROL_CT_SC_SWITCH_BUTTON = 0x01000000 ! MIXERCONTROL_CT_SC_METER_POLLED = 0x00000000 ! MIXERCONTROL_CT_SC_TIME_MICROSECS = 0x00000000 ! MIXERCONTROL_CT_SC_TIME_MILLISECS = 0x01000000 ! MIXERCONTROL_CT_SC_LIST_SINGLE = 0x00000000 ! MIXERCONTROL_CT_SC_LIST_MULTIPLE = 0x01000000 ! MIXERCONTROL_CT_UNITS_MASK = 0x00FF0000 ! MIXERCONTROL_CT_UNITS_CUSTOM = 0x00000000 ! MIXERCONTROL_CT_UNITS_BOOLEAN = 0x00010000 ! MIXERCONTROL_CT_UNITS_SIGNED = 0x00020000 ! MIXERCONTROL_CT_UNITS_UNSIGNED = 0x00030000 ! MIXERCONTROL_CT_UNITS_DECIBELS = 0x00040000 ! MIXERCONTROL_CT_UNITS_PERCENT = 0x00050000 MIXERCONTROL_CONTROLTYPE_CUSTOM = (MIXERCONTROL_CT_CLASS_CUSTOM | MIXERCONTROL_CT_UNITS_CUSTOM) MIXERCONTROL_CONTROLTYPE_BOOLEANMETER = (MIXERCONTROL_CT_CLASS_METER | MIXERCONTROL_CT_SC_METER_POLLED | MIXERCONTROL_CT_UNITS_BOOLEAN) *************** *** 343,356 **** MIXERCONTROL_CONTROLTYPE_MICROTIME = (MIXERCONTROL_CT_CLASS_TIME | MIXERCONTROL_CT_SC_TIME_MICROSECS | MIXERCONTROL_CT_UNITS_UNSIGNED) MIXERCONTROL_CONTROLTYPE_MILLITIME = (MIXERCONTROL_CT_CLASS_TIME | MIXERCONTROL_CT_SC_TIME_MILLISECS | MIXERCONTROL_CT_UNITS_UNSIGNED) ! MIXER_GETLINECONTROLSF_ALL = 0x00000000L ! MIXER_GETLINECONTROLSF_ONEBYID = 0x00000001L ! MIXER_GETLINECONTROLSF_ONEBYTYPE = 0x00000002L ! MIXER_GETLINECONTROLSF_QUERYMASK = 0x0000000FL ! MIXER_GETCONTROLDETAILSF_VALUE = 0x00000000L ! MIXER_GETCONTROLDETAILSF_LISTTEXT = 0x00000001L ! MIXER_GETCONTROLDETAILSF_QUERYMASK = 0x0000000FL ! MIXER_SETCONTROLDETAILSF_VALUE = 0x00000000L ! MIXER_SETCONTROLDETAILSF_CUSTOM = 0x00000001L ! MIXER_SETCONTROLDETAILSF_QUERYMASK = 0x0000000FL TIMERR_NOERROR = (0) TIMERR_NOCANDO = (TIMERR_BASE+1) --- 343,356 ---- MIXERCONTROL_CONTROLTYPE_MICROTIME = (MIXERCONTROL_CT_CLASS_TIME | MIXERCONTROL_CT_SC_TIME_MICROSECS | MIXERCONTROL_CT_UNITS_UNSIGNED) MIXERCONTROL_CONTROLTYPE_MILLITIME = (MIXERCONTROL_CT_CLASS_TIME | MIXERCONTROL_CT_SC_TIME_MILLISECS | MIXERCONTROL_CT_UNITS_UNSIGNED) ! MIXER_GETLINECONTROLSF_ALL = 0x00000000 ! MIXER_GETLINECONTROLSF_ONEBYID = 0x00000001 ! MIXER_GETLINECONTROLSF_ONEBYTYPE = 0x00000002 ! MIXER_GETLINECONTROLSF_QUERYMASK = 0x0000000F ! MIXER_GETCONTROLDETAILSF_VALUE = 0x00000000 ! MIXER_GETCONTROLDETAILSF_LISTTEXT = 0x00000001 ! MIXER_GETCONTROLDETAILSF_QUERYMASK = 0x0000000F ! MIXER_SETCONTROLDETAILSF_VALUE = 0x00000000 ! MIXER_SETCONTROLDETAILSF_CUSTOM = 0x00000001 ! MIXER_SETCONTROLDETAILSF_QUERYMASK = 0x0000000F TIMERR_NOERROR = (0) TIMERR_NOCANDO = (TIMERR_BASE+1) *************** *** 373,435 **** JOY_BUTTON3CHG = 0x0400 JOY_BUTTON4CHG = 0x0800 ! JOY_BUTTON5 = 0x00000010l ! JOY_BUTTON6 = 0x00000020l ! JOY_BUTTON7 = 0x00000040l ! JOY_BUTTON8 = 0x00000080l ! JOY_BUTTON9 = 0x00000100l ! JOY_BUTTON10 = 0x00000200l ! JOY_BUTTON11 = 0x00000400l ! JOY_BUTTON12 = 0x00000800l ! JOY_BUTTON13 = 0x00001000l ! JOY_BUTTON14 = 0x00002000l ! JOY_BUTTON15 = 0x00004000l ! JOY_BUTTON16 = 0x00008000l ! JOY_BUTTON17 = 0x00010000l ! JOY_BUTTON18 = 0x00020000l ! JOY_BUTTON19 = 0x00040000l ! JOY_BUTTON20 = 0x00080000l ! JOY_BUTTON21 = 0x00100000l ! JOY_BUTTON22 = 0x00200000l ! JOY_BUTTON23 = 0x00400000l ! JOY_BUTTON24 = 0x00800000l ! JOY_BUTTON25 = 0x01000000l ! JOY_BUTTON26 = 0x02000000l ! JOY_BUTTON27 = 0x04000000l ! JOY_BUTTON28 = 0x08000000l ! JOY_BUTTON29 = 0x10000000l ! JOY_BUTTON30 = 0x20000000l ! JOY_BUTTON31 = 0x40000000l ! JOY_BUTTON32 = 0x80000000l JOY_POVFORWARD = 0 JOY_POVRIGHT = 9000 JOY_POVBACKWARD = 18000 JOY_POVLEFT = 27000 ! JOY_RETURNX = 0x00000001l ! JOY_RETURNY = 0x00000002l ! JOY_RETURNZ = 0x00000004l ! JOY_RETURNR = 0x00000008l ! JOY_RETURNU = 0x00000010l ! JOY_RETURNV = 0x00000020l ! JOY_RETURNPOV = 0x00000040l ! JOY_RETURNBUTTONS = 0x00000080l ! JOY_RETURNRAWDATA = 0x00000100l ! JOY_RETURNPOVCTS = 0x00000200l ! JOY_RETURNCENTERED = 0x00000400l ! JOY_USEDEADZONE = 0x00000800l JOY_RETURNALL = (JOY_RETURNX | JOY_RETURNY | JOY_RETURNZ | \ JOY_RETURNR | JOY_RETURNU | JOY_RETURNV | \ JOY_RETURNPOV | JOY_RETURNBUTTONS) ! JOY_CAL_READALWAYS = 0x00010000l ! JOY_CAL_READXYONLY = 0x00020000l ! JOY_CAL_READ3 = 0x00040000l ! JOY_CAL_READ4 = 0x00080000l ! JOY_CAL_READXONLY = 0x00100000l ! JOY_CAL_READYONLY = 0x00200000l ! JOY_CAL_READ5 = 0x00400000l ! JOY_CAL_READ6 = 0x00800000l ! JOY_CAL_READZONLY = 0x01000000l ! JOY_CAL_READRONLY = 0x02000000l ! JOY_CAL_READUONLY = 0x04000000l ! JOY_CAL_READVONLY = 0x08000000l JOYSTICKID1 = 0 JOYSTICKID2 = 1 --- 373,435 ---- JOY_BUTTON3CHG = 0x0400 JOY_BUTTON4CHG = 0x0800 ! JOY_BUTTON5 = 0x00000010 ! JOY_BUTTON6 = 0x00000020 ! JOY_BUTTON7 = 0x00000040 ! JOY_BUTTON8 = 0x00000080 ! JOY_BUTTON9 = 0x00000100 ! JOY_BUTTON10 = 0x00000200 ! JOY_BUTTON11 = 0x00000400 ! JOY_BUTTON12 = 0x00000800 ! JOY_BUTTON13 = 0x00001000 ! JOY_BUTTON14 = 0x00002000 ! JOY_BUTTON15 = 0x00004000 ! JOY_BUTTON16 = 0x00008000 ! JOY_BUTTON17 = 0x00010000 ! JOY_BUTTON18 = 0x00020000 ! JOY_BUTTON19 = 0x00040000 ! JOY_BUTTON20 = 0x00080000 ! JOY_BUTTON21 = 0x00100000 ! JOY_BUTTON22 = 0x00200000 ! JOY_BUTTON23 = 0x00400000 ! JOY_BUTTON24 = 0x00800000 ! JOY_BUTTON25 = 0x01000000 ! JOY_BUTTON26 = 0x02000000 ! JOY_BUTTON27 = 0x04000000 ! JOY_BUTTON28 = 0x08000000 ! JOY_BUTTON29 = 0x10000000 ! JOY_BUTTON30 = 0x20000000 ! JOY_BUTTON31 = 0x40000000 ! JOY_BUTTON32 = 0x80000000 JOY_POVFORWARD = 0 JOY_POVRIGHT = 9000 JOY_POVBACKWARD = 18000 JOY_POVLEFT = 27000 ! JOY_RETURNX = 0x00000001 ! JOY_RETURNY = 0x00000002 ! JOY_RETURNZ = 0x00000004 ! JOY_RETURNR = 0x00000008 ! JOY_RETURNU = 0x00000010 ! JOY_RETURNV = 0x00000020 ! JOY_RETURNPOV = 0x00000040 ! JOY_RETURNBUTTONS = 0x00000080 ! JOY_RETURNRAWDATA = 0x00000100 ! JOY_RETURNPOVCTS = 0x00000200 ! JOY_RETURNCENTERED = 0x00000400 ! JOY_USEDEADZONE = 0x00000800 JOY_RETURNALL = (JOY_RETURNX | JOY_RETURNY | JOY_RETURNZ | \ JOY_RETURNR | JOY_RETURNU | JOY_RETURNV | \ JOY_RETURNPOV | JOY_RETURNBUTTONS) ! JOY_CAL_READALWAYS = 0x00010000 ! JOY_CAL_READXYONLY = 0x00020000 ! JOY_CAL_READ3 = 0x00040000 ! JOY_CAL_READ4 = 0x00080000 ! JOY_CAL_READXONLY = 0x00100000 ! JOY_CAL_READYONLY = 0x00200000 ! JOY_CAL_READ5 = 0x00400000 ! JOY_CAL_READ6 = 0x00800000 ! JOY_CAL_READZONLY = 0x01000000 ! JOY_CAL_READRONLY = 0x02000000 ! JOY_CAL_READUONLY = 0x04000000 ! JOY_CAL_READVONLY = 0x08000000 JOYSTICKID1 = 0 JOYSTICKID2 = 1 *************** *** 667,730 **** MCI_NOTIFY_ABORTED = 0x0004 MCI_NOTIFY_FAILURE = 0x0008 ! MCI_NOTIFY = 0x00000001L ! MCI_WAIT = 0x00000002L ! MCI_FROM = 0x00000004L ! MCI_TO = 0x00000008L ! MCI_TRACK = 0x00000010L ! MCI_OPEN_SHAREABLE = 0x00000100L ! MCI_OPEN_ELEMENT = 0x00000200L ! MCI_OPEN_ALIAS = 0x00000400L ! MCI_OPEN_ELEMENT_ID = 0x00000800L ! MCI_OPEN_TYPE_ID = 0x00001000L ! MCI_OPEN_TYPE = 0x00002000L ! MCI_SEEK_TO_START = 0x00000100L ! MCI_SEEK_TO_END = 0x00000200L ! MCI_STATUS_ITEM = 0x00000100L ! MCI_STATUS_START = 0x00000200L ! MCI_STATUS_LENGTH = 0x00000001L ! MCI_STATUS_POSITION = 0x00000002L ! MCI_STATUS_NUMBER_OF_TRACKS = 0x00000003L ! MCI_STATUS_MODE = 0x00000004L ! MCI_STATUS_MEDIA_PRESENT = 0x00000005L ! MCI_STATUS_TIME_FORMAT = 0x00000006L ! MCI_STATUS_READY = 0x00000007L ! MCI_STATUS_CURRENT_TRACK = 0x00000008L ! MCI_INFO_PRODUCT = 0x00000100L ! MCI_INFO_FILE = 0x00000200L ! MCI_INFO_MEDIA_UPC = 0x00000400L ! MCI_INFO_MEDIA_IDENTITY = 0x00000800L ! MCI_INFO_NAME = 0x00001000L ! MCI_INFO_COPYRIGHT = 0x00002000L ! MCI_GETDEVCAPS_ITEM = 0x00000100L ! MCI_GETDEVCAPS_CAN_RECORD = 0x00000001L ! MCI_GETDEVCAPS_HAS_AUDIO = 0x00000002L ! MCI_GETDEVCAPS_HAS_VIDEO = 0x00000003L ! MCI_GETDEVCAPS_DEVICE_TYPE = 0x00000004L ! MCI_GETDEVCAPS_USES_FILES = 0x00000005L ! MCI_GETDEVCAPS_COMPOUND_DEVICE = 0x00000006L ! MCI_GETDEVCAPS_CAN_EJECT = 0x00000007L ! MCI_GETDEVCAPS_CAN_PLAY = 0x00000008L ! MCI_GETDEVCAPS_CAN_SAVE = 0x00000009L ! MCI_SYSINFO_QUANTITY = 0x00000100L ! MCI_SYSINFO_OPEN = 0x00000200L ! MCI_SYSINFO_NAME = 0x00000400L ! MCI_SYSINFO_INSTALLNAME = 0x00000800L ! MCI_SET_DOOR_OPEN = 0x00000100L ! MCI_SET_DOOR_CLOSED = 0x00000200L ! MCI_SET_TIME_FORMAT = 0x00000400L ! MCI_SET_AUDIO = 0x00000800L ! MCI_SET_VIDEO = 0x00001000L ! MCI_SET_ON = 0x00002000L ! MCI_SET_OFF = 0x00004000L ! MCI_SET_AUDIO_ALL = 0x00000000L ! MCI_SET_AUDIO_LEFT = 0x00000001L ! MCI_SET_AUDIO_RIGHT = 0x00000002L ! MCI_BREAK_KEY = 0x00000100L ! MCI_BREAK_HWND = 0x00000200L ! MCI_BREAK_OFF = 0x00000400L ! MCI_RECORD_INSERT =... [truncated message content] |
Update of /cvsroot/pywin32/pywin32/win32/Demos/security In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15490/Demos/security Modified Files: Tag: py3k GetTokenInformation.py account_rights.py explicit_entries.py get_policy_info.py list_rights.py localized_names.py lsaregevent.py query_information.py sa_inherit.py security_enums.py set_file_audit.py set_file_owner.py set_policy_info.py setkernelobjectsecurity.py setnamedsecurityinfo.py setsecurityinfo.py Log Message: Changes to build for Python 3.0 Index: set_policy_info.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/Demos/security/set_policy_info.py,v retrieving revision 1.1 retrieving revision 1.1.4.1 diff -C2 -d -r1.1 -r1.1.4.1 *** set_policy_info.py 10 Mar 2003 01:18:15 -0000 1.1 --- set_policy_info.py 29 Aug 2008 04:59:24 -0000 1.1.4.1 *************** *** 3,7 **** event_audit_info=win32security.LsaQueryInformationPolicy(policy_handle,win32security.PolicyAuditEventsInformation) ! print event_audit_info new_audit_info=list(event_audit_info[1]) --- 3,7 ---- event_audit_info=win32security.LsaQueryInformationPolicy(policy_handle,win32security.PolicyAuditEventsInformation) ! print(event_audit_info) new_audit_info=list(event_audit_info[1]) Index: setsecurityinfo.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/Demos/security/setsecurityinfo.py,v retrieving revision 1.1 retrieving revision 1.1.4.1 diff -C2 -d -r1.1 -r1.1.4.1 *** setsecurityinfo.py 26 May 2004 22:50:33 -0000 1.1 --- setsecurityinfo.py 29 Aug 2008 04:59:24 -0000 1.1.4.1 *************** *** 48,61 **** if new_sd.GetSecurityDescriptorDacl().GetAceCount()!=dacl_ace_cnt+1: ! print 'New dacl doesn''t contain extra ace ????' if new_sd.GetSecurityDescriptorSacl().GetAceCount()!=sacl_ace_cnt+1: ! print 'New Sacl doesn''t contain extra ace ????' if win32security.LookupAccountSid('',new_sd.GetSecurityDescriptorOwner())[0]!='Power Users': ! print 'Owner not successfully set to Power Users !!!!!' if win32security.LookupAccountSid('',new_sd.GetSecurityDescriptorGroup())[0]!='Power Users': ! print 'Group not successfully set to Power Users !!!!!' win32security.SetSecurityInfo(ph,win32security.SE_KERNEL_OBJECT,win32security.SACL_SECURITY_INFORMATION, None, None, None, None) new_sd_1=win32security.GetSecurityInfo(ph,win32security.SE_KERNEL_OBJECT,win32security.SACL_SECURITY_INFORMATION) if new_sd_1.GetSecurityDescriptorSacl() is not None: ! print 'Unable to set Sacl to NULL !!!!!!!!' --- 48,61 ---- if new_sd.GetSecurityDescriptorDacl().GetAceCount()!=dacl_ace_cnt+1: ! print('New dacl doesn''t contain extra ace ????') if new_sd.GetSecurityDescriptorSacl().GetAceCount()!=sacl_ace_cnt+1: ! print('New Sacl doesn''t contain extra ace ????') if win32security.LookupAccountSid('',new_sd.GetSecurityDescriptorOwner())[0]!='Power Users': ! print('Owner not successfully set to Power Users !!!!!') if win32security.LookupAccountSid('',new_sd.GetSecurityDescriptorGroup())[0]!='Power Users': ! print('Group not successfully set to Power Users !!!!!') win32security.SetSecurityInfo(ph,win32security.SE_KERNEL_OBJECT,win32security.SACL_SECURITY_INFORMATION, None, None, None, None) new_sd_1=win32security.GetSecurityInfo(ph,win32security.SE_KERNEL_OBJECT,win32security.SACL_SECURITY_INFORMATION) if new_sd_1.GetSecurityDescriptorSacl() is not None: ! print('Unable to set Sacl to NULL !!!!!!!!') Index: set_file_audit.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/Demos/security/set_file_audit.py,v retrieving revision 1.2 retrieving revision 1.2.4.1 diff -C2 -d -r1.2 -r1.2.4.1 *** set_file_audit.py 7 May 2006 21:14:28 -0000 1.2 --- set_file_audit.py 29 Aug 2008 04:59:24 -0000 1.2.4.1 *************** *** 34,38 **** ## Create a file in the dir and add some specific permissions to it fname=win32api.GetTempFileName(dir_name,'sfa')[0] ! print fname file_sd=win32security.GetNamedSecurityInfo(fname, SE_FILE_OBJECT, DACL_SECURITY_INFORMATION|SACL_SECURITY_INFORMATION) file_dacl=file_sd.GetSecurityDescriptorDacl() --- 34,38 ---- ## Create a file in the dir and add some specific permissions to it fname=win32api.GetTempFileName(dir_name,'sfa')[0] ! print(fname) file_sd=win32security.GetNamedSecurityInfo(fname, SE_FILE_OBJECT, DACL_SECURITY_INFORMATION|SACL_SECURITY_INFORMATION) file_dacl=file_sd.GetSecurityDescriptorDacl() Index: setnamedsecurityinfo.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/Demos/security/setnamedsecurityinfo.py,v retrieving revision 1.1 retrieving revision 1.1.4.1 diff -C2 -d -r1.1 -r1.1.4.1 *** setnamedsecurityinfo.py 26 May 2004 22:50:33 -0000 1.1 --- setnamedsecurityinfo.py 29 Aug 2008 04:59:24 -0000 1.1.4.1 *************** *** 1,5 **** import win32security,win32api,win32con, win32process fname, tmp = win32api.GetTempFileName(win32api.GetTempPath(),'tmp') ! print fname ## You need SE_RESTORE_NAME to be able to set the owner of a security descriptor to anybody ## other than yourself or your primary group. Most admin logins don't have it by default, so --- 1,5 ---- import win32security,win32api,win32con, win32process fname, tmp = win32api.GetTempFileName(win32api.GetTempPath(),'tmp') ! print(fname) ## You need SE_RESTORE_NAME to be able to set the owner of a security descriptor to anybody ## other than yourself or your primary group. Most admin logins don't have it by default, so *************** *** 47,60 **** ## could do additional checking to make sure added ACE contains expected info if new_sd.GetSecurityDescriptorDacl().GetAceCount()!=dacl_ace_cnt+1: ! print 'New dacl doesn''t contain extra ace ????' if new_sd.GetSecurityDescriptorSacl().GetAceCount()!=sacl_ace_cnt+1: ! print 'New Sacl doesn''t contain extra ace ????' if win32security.LookupAccountSid('',new_sd.GetSecurityDescriptorOwner())[0]!='Power Users': ! print 'Owner not successfully set to Power Users !!!!!' if win32security.LookupAccountSid('',new_sd.GetSecurityDescriptorGroup())[0]!='Power Users': ! print 'Group not successfully set to Power Users !!!!!' win32security.SetNamedSecurityInfo(fname,win32security.SE_FILE_OBJECT,win32security.SACL_SECURITY_INFORMATION, None, None, None, None) new_sd_1=win32security.GetNamedSecurityInfo(fname,win32security.SE_FILE_OBJECT,win32security.SACL_SECURITY_INFORMATION) if new_sd_1.GetSecurityDescriptorSacl() is not None: ! print 'Unable to set Sacl to NULL !!!!!!!!' --- 47,60 ---- ## could do additional checking to make sure added ACE contains expected info if new_sd.GetSecurityDescriptorDacl().GetAceCount()!=dacl_ace_cnt+1: ! print('New dacl doesn''t contain extra ace ????') if new_sd.GetSecurityDescriptorSacl().GetAceCount()!=sacl_ace_cnt+1: ! print('New Sacl doesn''t contain extra ace ????') if win32security.LookupAccountSid('',new_sd.GetSecurityDescriptorOwner())[0]!='Power Users': ! print('Owner not successfully set to Power Users !!!!!') if win32security.LookupAccountSid('',new_sd.GetSecurityDescriptorGroup())[0]!='Power Users': ! print('Group not successfully set to Power Users !!!!!') win32security.SetNamedSecurityInfo(fname,win32security.SE_FILE_OBJECT,win32security.SACL_SECURITY_INFORMATION, None, None, None, None) new_sd_1=win32security.GetNamedSecurityInfo(fname,win32security.SE_FILE_OBJECT,win32security.SACL_SECURITY_INFORMATION) if new_sd_1.GetSecurityDescriptorSacl() is not None: ! print('Unable to set Sacl to NULL !!!!!!!!') Index: explicit_entries.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/Demos/security/explicit_entries.py,v retrieving revision 1.2 retrieving revision 1.2.4.1 diff -C2 -d -r1.2 -r1.2.4.1 *** explicit_entries.py 23 Oct 2003 00:53:37 -0000 1.2 --- explicit_entries.py 29 Aug 2008 04:59:24 -0000 1.2.4.1 *************** *** 7,11 **** f.write("Hello from Python\n"); f.close() ! print "Testing on file", fname new_privs = ((win32security.LookupPrivilegeValue('',ntsecuritycon.SE_SECURITY_NAME),win32con.SE_PRIVILEGE_ENABLED), --- 7,11 ---- f.write("Hello from Python\n"); f.close() ! print("Testing on file", fname) new_privs = ((win32security.LookupPrivilegeValue('',ntsecuritycon.SE_SECURITY_NAME),win32con.SE_PRIVILEGE_ENABLED), Index: setkernelobjectsecurity.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/Demos/security/setkernelobjectsecurity.py,v retrieving revision 1.1 retrieving revision 1.1.4.1 diff -C2 -d -r1.1 -r1.1.4.1 *** setkernelobjectsecurity.py 26 May 2004 22:50:33 -0000 1.1 --- setkernelobjectsecurity.py 29 Aug 2008 04:59:24 -0000 1.1.4.1 *************** *** 52,62 **** if new_sd.GetSecurityDescriptorDacl().GetAceCount()!=dacl_ace_cnt+1: ! print 'New dacl doesn''t contain extra ace ????' if new_sd.GetSecurityDescriptorSacl().GetAceCount()!=sacl_ace_cnt+1: ! print 'New Sacl doesn''t contain extra ace ????' if win32security.LookupAccountSid('',new_sd.GetSecurityDescriptorOwner())[0]!='Power Users': ! print 'Owner not successfully set to Power Users !!!!!' if win32security.LookupAccountSid('',new_sd.GetSecurityDescriptorGroup())[0]!='Power Users': ! print 'Group not successfully set to Power Users !!!!!' sd.SetSecurityDescriptorSacl(0,None,0) --- 52,62 ---- if new_sd.GetSecurityDescriptorDacl().GetAceCount()!=dacl_ace_cnt+1: ! print('New dacl doesn''t contain extra ace ????') if new_sd.GetSecurityDescriptorSacl().GetAceCount()!=sacl_ace_cnt+1: ! print('New Sacl doesn''t contain extra ace ????') if win32security.LookupAccountSid('',new_sd.GetSecurityDescriptorOwner())[0]!='Power Users': ! print('Owner not successfully set to Power Users !!!!!') if win32security.LookupAccountSid('',new_sd.GetSecurityDescriptorGroup())[0]!='Power Users': ! print('Group not successfully set to Power Users !!!!!') sd.SetSecurityDescriptorSacl(0,None,0) *************** *** 64,67 **** new_sd_1=win32security.GetKernelObjectSecurity(ph,win32security.SACL_SECURITY_INFORMATION) if new_sd_1.GetSecurityDescriptorSacl() is not None: ! print 'Unable to set Sacl to NULL !!!!!!!!' --- 64,67 ---- new_sd_1=win32security.GetKernelObjectSecurity(ph,win32security.SACL_SECURITY_INFORMATION) if new_sd_1.GetSecurityDescriptorSacl() is not None: ! print('Unable to set Sacl to NULL !!!!!!!!') Index: localized_names.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/Demos/security/localized_names.py,v retrieving revision 1.1 retrieving revision 1.1.4.1 diff -C2 -d -r1.1 -r1.1.4.1 *** localized_names.py 19 Sep 2006 00:38:45 -0000 1.1 --- localized_names.py 29 Aug 2008 04:59:24 -0000 1.1.4.1 *************** *** 53,60 **** name = LookupUserGroupFromRid(targetComputer, DOMAIN_USER_RID_ADMIN) ! print "'Administrator' user name = %s" % (name,) name = LookupAliasFromRid(targetComputer, DOMAIN_ALIAS_RID_ADMINS) ! print "'Administrators' local group/alias name = %s" % (name,) if __name__=='__main__': --- 53,60 ---- name = LookupUserGroupFromRid(targetComputer, DOMAIN_USER_RID_ADMIN) ! print("'Administrator' user name = %s" % (name,)) name = LookupAliasFromRid(targetComputer, DOMAIN_ALIAS_RID_ADMINS) ! print("'Administrators' local group/alias name = %s" % (name,)) if __name__=='__main__': Index: GetTokenInformation.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/Demos/security/GetTokenInformation.py,v retrieving revision 1.1 retrieving revision 1.1.2.1 diff -C2 -d -r1.1 -r1.1.2.1 *** GetTokenInformation.py 2 Aug 2007 07:08:18 -0000 1.1 --- GetTokenInformation.py 29 Aug 2008 04:59:24 -0000 1.1.2.1 *************** *** 11,23 **** def dump_token(th): token_type=win32security.GetTokenInformation(th, win32security.TokenType) ! print 'TokenType:', token_type, TOKEN_TYPE.lookup_name(token_type) if token_type==win32security.TokenImpersonation: imp_lvl=win32security.GetTokenInformation(th, win32security.TokenImpersonationLevel) ! print 'TokenImpersonationLevel:', imp_lvl, SECURITY_IMPERSONATION_LEVEL.lookup_name(imp_lvl) ! print 'TokenSessionId:', win32security.GetTokenInformation(th, win32security.TokenSessionId) privs=win32security.GetTokenInformation(th,win32security.TokenPrivileges) ! print 'TokenPrivileges:' for priv_luid, priv_flags in privs: flag_names, unk=TOKEN_PRIVILEGE_ATTRIBUTES.lookup_flags(priv_flags) --- 11,23 ---- def dump_token(th): token_type=win32security.GetTokenInformation(th, win32security.TokenType) ! print('TokenType:', token_type, TOKEN_TYPE.lookup_name(token_type)) if token_type==win32security.TokenImpersonation: imp_lvl=win32security.GetTokenInformation(th, win32security.TokenImpersonationLevel) ! print('TokenImpersonationLevel:', imp_lvl, SECURITY_IMPERSONATION_LEVEL.lookup_name(imp_lvl)) ! print('TokenSessionId:', win32security.GetTokenInformation(th, win32security.TokenSessionId)) privs=win32security.GetTokenInformation(th,win32security.TokenPrivileges) ! print('TokenPrivileges:') for priv_luid, priv_flags in privs: flag_names, unk=TOKEN_PRIVILEGE_ATTRIBUTES.lookup_flags(priv_flags) *************** *** 28,34 **** priv_name=win32security.LookupPrivilegeName('',priv_luid) priv_desc=win32security.LookupPrivilegeDisplayName('',priv_name) ! print '\t', priv_name, priv_desc, priv_flags, flag_desc ! print 'TokenGroups:' groups=win32security.GetTokenInformation(th,win32security.TokenGroups) for group_sid, group_attr in groups: --- 28,34 ---- priv_name=win32security.LookupPrivilegeName('',priv_luid) priv_desc=win32security.LookupPrivilegeDisplayName('',priv_name) ! print('\t', priv_name, priv_desc, priv_flags, flag_desc) ! print('TokenGroups:') groups=win32security.GetTokenInformation(th,win32security.TokenGroups) for group_sid, group_attr in groups: *************** *** 41,64 **** else: sid_desc=win32security.LookupAccountSid('',group_sid) ! print '\t',group_sid, sid_desc, group_attr, flag_desc ## Vista token information types, will throw (87, 'GetTokenInformation', 'The parameter is incorrect.') on earier OS try: is_elevated=win32security.GetTokenInformation(th, win32security.TokenElevation) ! print 'TokenElevation:', is_elevated ! except pywintypes.error, details: ! if details[0] != winerror.ERROR_INVALID_PARAMETER: raise return None ! print 'TokenHasRestrictions:', win32security.GetTokenInformation(th, win32security.TokenHasRestrictions) ! print 'TokenMandatoryPolicy', win32security.GetTokenInformation(th, win32security.TokenMandatoryPolicy) ! print 'TokenVirtualizationAllowed:', win32security.GetTokenInformation(th, win32security.TokenVirtualizationAllowed) ! print 'TokenVirtualizationEnabled:', win32security.GetTokenInformation(th, win32security.TokenVirtualizationEnabled) elevation_type = win32security.GetTokenInformation(th, win32security.TokenElevationType) ! print 'TokenElevationType:', elevation_type, TOKEN_ELEVATION_TYPE.lookup_name(elevation_type) ! if elevation_type<>win32security.TokenElevationTypeDefault: lt=win32security.GetTokenInformation(th, win32security.TokenLinkedToken) ! print 'TokenLinkedToken:', lt else: lt=None --- 41,64 ---- else: sid_desc=win32security.LookupAccountSid('',group_sid) ! print('\t',group_sid, sid_desc, group_attr, flag_desc) ## Vista token information types, will throw (87, 'GetTokenInformation', 'The parameter is incorrect.') on earier OS try: is_elevated=win32security.GetTokenInformation(th, win32security.TokenElevation) ! print('TokenElevation:', is_elevated) ! except pywintypes.error as details: ! if details.args[0] != winerror.ERROR_INVALID_PARAMETER: raise return None ! print('TokenHasRestrictions:', win32security.GetTokenInformation(th, win32security.TokenHasRestrictions)) ! print('TokenMandatoryPolicy', win32security.GetTokenInformation(th, win32security.TokenMandatoryPolicy)) ! print('TokenVirtualizationAllowed:', win32security.GetTokenInformation(th, win32security.TokenVirtualizationAllowed)) ! print('TokenVirtualizationEnabled:', win32security.GetTokenInformation(th, win32security.TokenVirtualizationEnabled)) elevation_type = win32security.GetTokenInformation(th, win32security.TokenElevationType) ! print('TokenElevationType:', elevation_type, TOKEN_ELEVATION_TYPE.lookup_name(elevation_type)) ! if elevation_type!=win32security.TokenElevationTypeDefault: lt=win32security.GetTokenInformation(th, win32security.TokenLinkedToken) ! print('TokenLinkedToken:', lt) else: lt=None *************** *** 70,73 **** lt = dump_token(th) if lt: ! print '\n\nlinked token info:' dump_token(lt) --- 70,73 ---- lt = dump_token(th) if lt: ! print('\n\nlinked token info:') dump_token(lt) Index: query_information.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/Demos/security/query_information.py,v retrieving revision 1.1 retrieving revision 1.1.4.1 diff -C2 -d -r1.1 -r1.1.4.1 *** query_information.py 8 Oct 2004 23:24:05 -0000 1.1 --- query_information.py 29 Aug 2008 04:59:24 -0000 1.1.4.1 *************** *** 7,11 **** tok = win32security.OpenThreadToken(win32api.GetCurrentThread(), TOKEN_QUERY, 1) ! except win32api.error, details: if details[0] != winerror.ERROR_NO_TOKEN: raise --- 7,11 ---- tok = win32security.OpenThreadToken(win32api.GetCurrentThread(), TOKEN_QUERY, 1) ! except win32api.error as details: if details[0] != winerror.ERROR_NO_TOKEN: raise *************** *** 21,25 **** if __name__=='__main__': ! print "Domain name is", GetDomainName() --- 21,25 ---- if __name__=='__main__': ! print("Domain name is", GetDomainName()) Index: lsaregevent.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/Demos/security/lsaregevent.py,v retrieving revision 1.1 retrieving revision 1.1.4.1 diff -C2 -d -r1.1 -r1.1.4.1 *** lsaregevent.py 23 Oct 2003 00:54:19 -0000 1.1 --- lsaregevent.py 29 Aug 2008 04:59:24 -0000 1.1.4.1 *************** *** 2,8 **** evt = win32event.CreateEvent(None,0,0,None) win32security.LsaRegisterPolicyChangeNotification(win32security.PolicyNotifyAuditEventsInformation, evt) ! print "Waiting for you change Audit policy in Management console ..." ret_code=win32event.WaitForSingleObject(evt,1000000000) ## should come back when you change Audit policy in Management console ... ! print ret_code win32security.LsaUnregisterPolicyChangeNotification(win32security.PolicyNotifyAuditEventsInformation, evt) --- 2,8 ---- evt = win32event.CreateEvent(None,0,0,None) win32security.LsaRegisterPolicyChangeNotification(win32security.PolicyNotifyAuditEventsInformation, evt) ! print("Waiting for you change Audit policy in Management console ...") ret_code=win32event.WaitForSingleObject(evt,1000000000) ## should come back when you change Audit policy in Management console ... ! print(ret_code) win32security.LsaUnregisterPolicyChangeNotification(win32security.PolicyNotifyAuditEventsInformation, evt) Index: get_policy_info.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/Demos/security/get_policy_info.py,v retrieving revision 1.1 retrieving revision 1.1.4.1 diff -C2 -d -r1.1 -r1.1.4.1 *** get_policy_info.py 10 Mar 2003 01:18:15 -0000 1.1 --- get_policy_info.py 29 Aug 2008 04:59:24 -0000 1.1.4.1 *************** *** 7,23 **** domain_name,dns_domain_name, dns_forest_name, domain_guid, domain_sid = \ win32security.LsaQueryInformationPolicy(policy_handle,win32security.PolicyDnsDomainInformation) ! print domain_name, dns_domain_name, dns_forest_name, domain_guid, domain_sid event_audit_info=win32security.LsaQueryInformationPolicy(policy_handle,win32security.PolicyAuditEventsInformation) ! print event_audit_info domain_name,sid =win32security.LsaQueryInformationPolicy(policy_handle,win32security.PolicyPrimaryDomainInformation) ! print domain_name, sid domain_name,sid =win32security.LsaQueryInformationPolicy(policy_handle,win32security.PolicyAccountDomainInformation) ! print domain_name, sid server_role = win32security.LsaQueryInformationPolicy(policy_handle,win32security.PolicyLsaServerRoleInformation) ! print 'server role: ',server_role win32security.LsaClose(policy_handle) --- 7,23 ---- domain_name,dns_domain_name, dns_forest_name, domain_guid, domain_sid = \ win32security.LsaQueryInformationPolicy(policy_handle,win32security.PolicyDnsDomainInformation) ! print(domain_name, dns_domain_name, dns_forest_name, domain_guid, domain_sid) event_audit_info=win32security.LsaQueryInformationPolicy(policy_handle,win32security.PolicyAuditEventsInformation) ! print(event_audit_info) domain_name,sid =win32security.LsaQueryInformationPolicy(policy_handle,win32security.PolicyPrimaryDomainInformation) ! print(domain_name, sid) domain_name,sid =win32security.LsaQueryInformationPolicy(policy_handle,win32security.PolicyAccountDomainInformation) ! print(domain_name, sid) server_role = win32security.LsaQueryInformationPolicy(policy_handle,win32security.PolicyLsaServerRoleInformation) ! print('server role: ',server_role) win32security.LsaClose(policy_handle) Index: set_file_owner.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/Demos/security/set_file_owner.py,v retrieving revision 1.1 retrieving revision 1.1.4.1 diff -C2 -d -r1.1 -r1.1.4.1 *** set_file_owner.py 10 Mar 2003 01:18:15 -0000 1.1 --- set_file_owner.py 29 Aug 2008 04:59:24 -0000 1.1.4.1 *************** *** 26,30 **** new_sd=win32security.SECURITY_DESCRIPTOR() ! print "relative, valid, size: ",new_sd.IsSelfRelative(), new_sd.IsValid(), new_sd.GetLength() my_sid = win32security.GetTokenInformation(th,ntsecuritycon.TokenUser)[0] --- 26,30 ---- new_sd=win32security.SECURITY_DESCRIPTOR() ! print("relative, valid, size: ",new_sd.IsSelfRelative(), new_sd.IsValid(), new_sd.GetLength()) my_sid = win32security.GetTokenInformation(th,ntsecuritycon.TokenUser)[0] Index: sa_inherit.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/Demos/security/sa_inherit.py,v retrieving revision 1.1 retrieving revision 1.1.4.1 diff -C2 -d -r1.1 -r1.1.4.1 *** sa_inherit.py 10 Mar 2003 01:18:15 -0000 1.1 --- sa_inherit.py 29 Aug 2008 04:59:24 -0000 1.1.4.1 *************** *** 4,7 **** sa.SetSecurityDescriptorOwner(tmp_sid,0) sid=sa.SECURITY_DESCRIPTOR.GetSecurityDescriptorOwner() ! print win32security.LookupAccountSid('',sid) --- 4,7 ---- sa.SetSecurityDescriptorOwner(tmp_sid,0) sid=sa.SECURITY_DESCRIPTOR.GetSecurityDescriptorOwner() ! print(win32security.LookupAccountSid('',sid)) Index: list_rights.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/Demos/security/list_rights.py,v retrieving revision 1.1 retrieving revision 1.1.4.1 diff -C2 -d -r1.1 -r1.1.4.1 *** list_rights.py 10 Mar 2003 01:18:15 -0000 1.1 --- list_rights.py 29 Aug 2008 04:59:24 -0000 1.1.4.1 *************** *** 1,4 **** import win32security,win32file,win32api,ntsecuritycon,win32con ! from security_enums import TRUSTEE_TYPE,TRUSTEE_FORM,ACE_FLAGS,ACCESS_MODE new_privs = ((win32security.LookupPrivilegeValue('',ntsecuritycon.SE_SECURITY_NAME),win32con.SE_PRIVILEGE_ENABLED), --- 1,4 ---- import win32security,win32file,win32api,ntsecuritycon,win32con ! from .security_enums import TRUSTEE_TYPE,TRUSTEE_FORM,ACE_FLAGS,ACCESS_MODE new_privs = ((win32security.LookupPrivilegeValue('',ntsecuritycon.SE_SECURITY_NAME),win32con.SE_PRIVILEGE_ENABLED), *************** *** 15,19 **** sidlist=win32security.LsaEnumerateAccountsWithUserRight(policy_handle,ntsecuritycon.SE_RESTORE_NAME) for sid in sidlist: ! print win32security.LookupAccountSid('',sid) win32security.LsaClose(policy_handle) --- 15,19 ---- sidlist=win32security.LsaEnumerateAccountsWithUserRight(policy_handle,ntsecuritycon.SE_RESTORE_NAME) for sid in sidlist: ! print(win32security.LookupAccountSid('',sid)) win32security.LsaClose(policy_handle) Index: security_enums.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/Demos/security/security_enums.py,v retrieving revision 1.2 retrieving revision 1.2.2.1 diff -C2 -d -r1.2 -r1.2.2.1 *** security_enums.py 2 Aug 2007 07:04:16 -0000 1.2 --- security_enums.py 29 Aug 2008 04:59:24 -0000 1.2.2.1 *************** *** 15,27 **** const_val=getattr(winnt, const_name) except AttributeError: ! raise AttributeError, 'Constant "%s" not found in win32security, ntsecuritycon, or winnt.' %const_name setattr(self, const_name, const_val) def lookup_name(self, const_val): """Looks up the name of a particular value.""" ! for k,v in self.__dict__.items(): if v==const_val: return k ! raise AttributeError, 'Value %s not found in enum' %const_val def lookup_flags(self, flags): --- 15,27 ---- const_val=getattr(winnt, const_name) except AttributeError: ! raise AttributeError('Constant "%s" not found in win32security, ntsecuritycon, or winnt.' %const_name) setattr(self, const_name, const_val) def lookup_name(self, const_val): """Looks up the name of a particular value.""" ! for k,v in list(self.__dict__.items()): if v==const_val: return k ! raise AttributeError('Value %s not found in enum' %const_val) def lookup_flags(self, flags): *************** *** 29,33 **** flag_names=[] unknown_flags=flags ! for k,v in self.__dict__.items(): if flags & v == v: flag_names.append(k) --- 29,33 ---- flag_names=[] unknown_flags=flags ! for k,v in list(self.__dict__.items()): if flags & v == v: flag_names.append(k) Index: account_rights.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/Demos/security/account_rights.py,v retrieving revision 1.1 retrieving revision 1.1.4.1 diff -C2 -d -r1.1 -r1.1.4.1 *** account_rights.py 10 Mar 2003 01:18:15 -0000 1.1 --- account_rights.py 29 Aug 2008 04:59:24 -0000 1.1.4.1 *************** *** 19,23 **** privlist=win32security.LsaEnumerateAccountRights(policy_handle,tmp_sid) for priv in privlist: ! print priv privs=[ntsecuritycon.SE_DEBUG_NAME,ntsecuritycon.SE_TCB_NAME] --- 19,23 ---- privlist=win32security.LsaEnumerateAccountRights(policy_handle,tmp_sid) for priv in privlist: ! print(priv) privs=[ntsecuritycon.SE_DEBUG_NAME,ntsecuritycon.SE_TCB_NAME] *************** *** 26,30 **** privlist=win32security.LsaEnumerateAccountRights(policy_handle,tmp_sid) for priv in privlist: ! print priv win32security.LsaClose(policy_handle) --- 26,30 ---- privlist=win32security.LsaEnumerateAccountRights(policy_handle,tmp_sid) for priv in privlist: ! print(priv) win32security.LsaClose(policy_handle) |
From: Roger U. <ru...@us...> - 2008-08-29 04:59:46
|
Update of /cvsroot/pywin32/pywin32/win32/Demos/security/sspi In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15490/Demos/security/sspi Modified Files: Tag: py3k fetch_url.py simple_auth.py socket_server.py validate_password.py Log Message: Changes to build for Python 3.0 Index: simple_auth.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/Demos/security/sspi/simple_auth.py,v retrieving revision 1.2 retrieving revision 1.2.4.1 diff -C2 -d -r1.2 -r1.2.4.1 *** simple_auth.py 13 Feb 2006 14:54:43 -0000 1.2 --- simple_auth.py 29 Aug 2008 04:59:25 -0000 1.2.4.1 *************** *** 7,11 **** def lookup_ret_code(err): ! for k,v in sspicon.__dict__.items(): if k[0:6] in ('SEC_I_','SEC_E_') and v==err: return k --- 7,11 ---- def lookup_ret_code(err): ! for k,v in list(sspicon.__dict__.items()): if k[0:6] in ('SEC_I_','SEC_E_') and v==err: return k *************** *** 42,48 **** # always be the same. sspiserver.ctxt.ImpersonateSecurityContext() ! print 'Impersonated user: ',win32api.GetUserNameEx(win32api.NameSamCompatible) sspiserver.ctxt.RevertSecurityContext() ! print 'Reverted to self: ',win32api.GetUserName() pkg_size_info=sspiclient.ctxt.QueryContextAttributes(sspicon.SECPKG_ATTR_SIZES) --- 42,48 ---- # always be the same. sspiserver.ctxt.ImpersonateSecurityContext() ! print('Impersonated user: ',win32api.GetUserNameEx(win32api.NameSamCompatible)) sspiserver.ctxt.RevertSecurityContext() ! print('Reverted to self: ',win32api.GetUserName()) pkg_size_info=sspiclient.ctxt.QueryContextAttributes(sspicon.SECPKG_ATTR_SIZES) *************** *** 65,71 **** encbuf[0].Buffer=msg sspiclient.ctxt.EncryptMessage(0,encbuf,1) ! print 'Encrypted data:',repr(encbuf[0].Buffer) sspiserver.ctxt.DecryptMessage(encbuf,1) ! print 'Unencrypted data:',encbuf[0].Buffer --- 65,71 ---- encbuf[0].Buffer=msg sspiclient.ctxt.EncryptMessage(0,encbuf,1) ! print('Encrypted data:',repr(encbuf[0].Buffer)) sspiserver.ctxt.DecryptMessage(encbuf,1) ! print('Unencrypted data:',encbuf[0].Buffer) Index: validate_password.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/Demos/security/sspi/validate_password.py,v retrieving revision 1.3 retrieving revision 1.3.4.1 diff -C2 -d -r1.3 -r1.3.4.1 *** validate_password.py 24 May 2005 13:26:48 -0000 1.3 --- validate_password.py 29 Aug 2008 04:59:25 -0000 1.3.4.1 *************** *** 21,25 **** if __name__=='__main__': if len(sys.argv) not in [2,3,4]: ! print "Usage: %s username [password [domain]]" % (__file__,) sys.exit(1) --- 21,25 ---- if __name__=='__main__': if len(sys.argv) not in [2,3,4]: ! print("Usage: %s username [password [domain]]" % (__file__,)) sys.exit(1) *************** *** 33,38 **** try: validate(sys.argv[1], password, domain) ! print "Validated OK" ! except win32security.error, details: hr, func, msg = details ! print "Validation failed: %s (%d)" % (msg, hr) --- 33,38 ---- try: validate(sys.argv[1], password, domain) ! print("Validated OK") ! except win32security.error as details: hr, func, msg = details ! print("Validation failed: %s (%d)" % (msg, hr)) Index: socket_server.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/Demos/security/sspi/socket_server.py,v retrieving revision 1.2 retrieving revision 1.2.4.1 diff -C2 -d -r1.2 -r1.2.4.1 *** socket_server.py 7 Mar 2005 11:16:18 -0000 1.2 --- socket_server.py 29 Aug 2008 04:59:25 -0000 1.2.4.1 *************** *** 23,29 **** import sys import struct ! import SocketServer import win32api ! import httplib import traceback --- 23,29 ---- import sys import struct ! import socketserver import win32api ! import http.client import traceback *************** *** 38,42 **** try: return win32api.GetUserName() ! except win32api.error, details: # Seeing 'access denied' errors here for non-local users (presumably # without permission to login locally). Get the fully-qualified --- 38,42 ---- try: return win32api.GetUserName() ! except win32api.error as details: # Seeing 'access denied' errors here for non-local users (presumably # without permission to login locally). Get the fully-qualified *************** *** 59,65 **** return s.recv(cb) ! class SSPISocketServer(SocketServer.TCPServer): def __init__(self, *args, **kw): ! SocketServer.TCPServer.__init__(self, *args, **kw) self.sa = sspi.ServerAuth(options.package) --- 59,65 ---- return s.recv(cb) ! class SSPISocketServer(socketserver.TCPServer): def __init__(self, *args, **kw): ! socketserver.TCPServer.__init__(self, *args, **kw) self.sa = sspi.ServerAuth(options.package) *************** *** 73,78 **** try: err, sec_buffer = self.sa.authorize(data) ! except sspi.error, details: ! print "FAILED to authorize client:", details return False --- 73,78 ---- try: err, sec_buffer = self.sa.authorize(data) ! except sspi.error as details: ! print("FAILED to authorize client:", details) return False *************** *** 84,91 **** def process_request(self, request, client_address): # An example using the connection once it is established. ! print "The server is running as user", GetUserName() self.sa.ctxt.ImpersonateSecurityContext() try: ! print "Having conversation with client as user", GetUserName() while 1: # we need to grab 2 bits of data - the encrypted data, and the --- 84,91 ---- def process_request(self, request, client_address): # An example using the connection once it is established. ! print("The server is running as user", GetUserName()) self.sa.ctxt.ImpersonateSecurityContext() try: ! print("Having conversation with client as user", GetUserName()) while 1: # we need to grab 2 bits of data - the encrypted data, and the *************** *** 96,112 **** break data = self.sa.decrypt(data, key) ! print "Client sent:", repr(data) finally: self.sa.ctxt.RevertSecurityContext() self.close_request(request) ! print "The server is back to user", GetUserName() def serve(): s = SSPISocketServer(("localhost", options.port), None) ! print "Running test server..." s.serve_forever() def sspi_client(): ! c = httplib.HTTPConnection("localhost", options.port) c.connect() # Do the auth dance. --- 96,112 ---- break data = self.sa.decrypt(data, key) ! print("Client sent:", repr(data)) finally: self.sa.ctxt.RevertSecurityContext() self.close_request(request) ! print("The server is back to user", GetUserName()) def serve(): s = SSPISocketServer(("localhost", options.port), None) ! print("Running test server...") s.serve_forever() def sspi_client(): ! c = http.client.HTTPConnection("localhost", options.port) c.connect() # Do the auth dance. *************** *** 119,123 **** break data = _get_msg(c.sock) ! print "Auth dance complete - sending a few encryted messages" # Assume out data is sensitive - encrypt the message. for data in "Hello from the client".split(): --- 119,123 ---- break data = _get_msg(c.sock) ! print("Auth dance complete - sending a few encryted messages") # Assume out data is sensitive - encrypt the message. for data in "Hello from the client".split(): *************** *** 126,130 **** _send_msg(c.sock, key) c.sock.close() ! print "Client completed." if __name__=='__main__': --- 126,130 ---- _send_msg(c.sock, key) c.sock.close() ! print("Client completed.") if __name__=='__main__': *************** *** 176,178 **** finally: if options.wait: ! raw_input("Press enter to continue") --- 176,178 ---- finally: if options.wait: ! input("Press enter to continue") Index: fetch_url.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/Demos/security/sspi/fetch_url.py,v retrieving revision 1.1 retrieving revision 1.1.4.1 diff -C2 -d -r1.1 -r1.1.4.1 *** fetch_url.py 6 Mar 2005 23:27:00 -0000 1.1 --- fetch_url.py 29 Aug 2008 04:59:25 -0000 1.1.4.1 *************** *** 9,15 **** import sys ! import urllib ! import httplib ! import urlparse from base64 import encodestring, decodestring --- 9,15 ---- import sys ! import urllib.request, urllib.parse, urllib.error ! import http.client ! import urllib.parse from base64 import encodestring, decodestring *************** *** 21,30 **** def open_url(host, url): ! h = httplib.HTTPConnection(host) # h.set_debuglevel(9) h.putrequest('GET', url) h.endheaders() resp = h.getresponse() ! print "Initial response is", resp.status, resp.reason body = resp.read() if resp.status == 302: # object moved --- 21,30 ---- def open_url(host, url): ! h = http.client.HTTPConnection(host) # h.set_debuglevel(9) h.putrequest('GET', url) h.endheaders() resp = h.getresponse() ! print("Initial response is", resp.status, resp.reason) body = resp.read() if resp.status == 302: # object moved *************** *** 34,44 **** h.endheaders() resp = h.getresponse() ! print "After redirect response is", resp.status, resp.reason if options.show_headers: ! print "Initial response headers:" ! for name, val in resp.msg.items(): ! print " %s: %s" % (name, val) if options.show_body: ! print body if resp.status == 401: # 401: Unauthorized - here is where the real work starts --- 34,44 ---- h.endheaders() resp = h.getresponse() ! print("After redirect response is", resp.status, resp.reason) if options.show_headers: ! print("Initial response headers:") ! for name, val in list(resp.msg.items()): ! print(" %s: %s" % (name, val)) if options.show_body: ! print(body) if resp.status == 401: # 401: Unauthorized - here is where the real work starts *************** *** 60,66 **** resp = h.getresponse() if options.show_headers: ! print "Token dance headers:" ! for name, val in resp.msg.items(): ! print " %s: %s" % (name, val) if err==0: --- 60,66 ---- resp = h.getresponse() if options.show_headers: ! print("Token dance headers:") ! for name, val in list(resp.msg.items()): ! print(" %s: %s" % (name, val)) if err==0: *************** *** 68,77 **** else: if resp.status != 401: ! print "Eeek - got response", resp.status cl = resp.msg.get("content-length") if cl: ! print repr(resp.read(int(cl))) else: ! print "no content!" assert resp.status == 401, resp.status --- 68,77 ---- else: if resp.status != 401: ! print("Eeek - got response", resp.status) cl = resp.msg.get("content-length") if cl: ! print(repr(resp.read(int(cl)))) else: ! print("no content!") assert resp.status == 401, resp.status *************** *** 84,118 **** break else: ! print "Could not find scheme '%s' in schemes %r" % (auth_scheme, schemes) break resp.read() ! print "Final response status is", resp.status, resp.reason if resp.status == 200: # Worked! # Check we can read it again without re-authenticating. if resp.will_close: ! print "EEEK - response will close, but NTLM is per connection - it must stay open" body = resp.read() if options.show_body: ! print "Final response body:" ! print body h.putrequest('GET', url) h.endheaders() resp = h.getresponse() ! print "Second fetch response is", resp.status, resp.reason if options.show_headers: ! print "Second response headers:" ! for name, val in resp.msg.items(): ! print " %s: %s" % (name, val) resp.read(int(resp.msg.get("content-length", 0))) elif resp.status == 500: ! print "Error text" ! print resp.read() else: if options.show_body: cl = resp.msg.get("content-length") ! print resp.read(int(cl)) if __name__=='__main__': --- 84,118 ---- break else: ! print("Could not find scheme '%s' in schemes %r" % (auth_scheme, schemes)) break resp.read() ! print("Final response status is", resp.status, resp.reason) if resp.status == 200: # Worked! # Check we can read it again without re-authenticating. if resp.will_close: ! print("EEEK - response will close, but NTLM is per connection - it must stay open") body = resp.read() if options.show_body: ! print("Final response body:") ! print(body) h.putrequest('GET', url) h.endheaders() resp = h.getresponse() ! print("Second fetch response is", resp.status, resp.reason) if options.show_headers: ! print("Second response headers:") ! for name, val in list(resp.msg.items()): ! print(" %s: %s" % (name, val)) resp.read(int(resp.msg.get("content-length", 0))) elif resp.status == 500: ! print("Error text") ! print(resp.read()) else: if options.show_body: cl = resp.msg.get("content-length") ! print(resp.read(int(cl))) if __name__=='__main__': *************** *** 136,146 **** options, args = parser.parse_args() if not args: ! print "Run with --help for usage details" args = ["http://localhost/localstart.asp"] for url in args: ! scheme, netloc, path, params, query, fragment = urlparse.urlparse(url) if (scheme != "http") or params or query or fragment: parser.error("Scheme must be http, URL must be simple") ! print "Opening '%s' from '%s'" % (path, netloc) r = open_url(netloc, path) --- 136,146 ---- options, args = parser.parse_args() if not args: ! print("Run with --help for usage details") args = ["http://localhost/localstart.asp"] for url in args: ! scheme, netloc, path, params, query, fragment = urllib.parse.urlparse(url) if (scheme != "http") or params or query or fragment: parser.error("Scheme must be http, URL must be simple") ! print("Opening '%s' from '%s'" % (path, netloc)) r = open_url(netloc, path) |
From: Roger U. <ru...@us...> - 2008-08-29 04:59:46
|
Update of /cvsroot/pywin32/pywin32/win32/Demos/service In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15490/Demos/service Modified Files: Tag: py3k pipeTestService.py pipeTestServiceClient.py Log Message: Changes to build for Python 3.0 Index: pipeTestServiceClient.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/Demos/service/pipeTestServiceClient.py,v retrieving revision 1.3 retrieving revision 1.3.4.1 diff -C2 -d -r1.3 -r1.3.4.1 *** pipeTestServiceClient.py 12 Mar 2003 12:44:01 -0000 1.3 --- pipeTestServiceClient.py 29 Aug 2008 04:59:25 -0000 1.3.4.1 *************** *** 37,86 **** retryCount = retryCount + 1 try: ! return apply(fn, args) ! except win32api.error, (rc, fnerr, msg): if rc==winerror.ERROR_PIPE_BUSY: win32api.Sleep(5000) continue else: ! raise win32api.error, (rc, fnerr, msg) ! raise RuntimeError, "Could not make a connection to the server" def testClient(server,msg): if verbose: ! print "Sending", msg data = CallPipe(CallNamedPipe, ("\\\\%s\\pipe\\PyPipeTest" % server, msg, 256, NMPWAIT_WAIT_FOREVER)) if verbose: ! print "Server sent back '%s'" % data ! print "Sent and received a message!" def testLargeMessage(server, size = 4096): if verbose: ! print "Sending message of size %d" % (size) msg = "*" * size data = CallPipe(CallNamedPipe, ("\\\\%s\\pipe\\PyPipeTest" % server, msg, 512, NMPWAIT_WAIT_FOREVER)) if len(data)-size: ! print "Sizes are all wrong - send %d, got back %d" % (size, len(data)) def stressThread(server, numMessages, wait): try: try: ! for i in xrange(numMessages): r = CallPipe(CallNamedPipe, ("\\\\%s\\pipe\\PyPipeTest" % server, "#" * 512, 1024, NMPWAIT_WAIT_FOREVER)) except: traceback.print_exc() ! print "Failed after %d messages" % i finally: SetEvent(wait) def stressTestClient(server, numThreads, numMessages): ! import thread thread_waits = [] ! for t_num in xrange(numThreads): # Note I could just wait on thread handles (after calling DuplicateHandle) # See the service itself for an example of waiting for the clients... wait = CreateEvent(None, 0, 0, None) thread_waits.append(wait) ! thread.start_new_thread(stressThread, (server,numMessages, wait)) # Wait for all threads to finish. WaitForMultipleObjects(thread_waits, 1, INFINITE) --- 37,87 ---- retryCount = retryCount + 1 try: ! return fn(*args) ! except win32api.error as xxx_todo_changeme: ! (rc, fnerr, msg) = xxx_todo_changeme.args if rc==winerror.ERROR_PIPE_BUSY: win32api.Sleep(5000) continue else: ! raise win32api.error(rc, fnerr, msg) ! raise RuntimeError("Could not make a connection to the server") def testClient(server,msg): if verbose: ! print("Sending", msg) data = CallPipe(CallNamedPipe, ("\\\\%s\\pipe\\PyPipeTest" % server, msg, 256, NMPWAIT_WAIT_FOREVER)) if verbose: ! print("Server sent back '%s'" % data) ! print("Sent and received a message!") def testLargeMessage(server, size = 4096): if verbose: ! print("Sending message of size %d" % (size)) msg = "*" * size data = CallPipe(CallNamedPipe, ("\\\\%s\\pipe\\PyPipeTest" % server, msg, 512, NMPWAIT_WAIT_FOREVER)) if len(data)-size: ! print("Sizes are all wrong - send %d, got back %d" % (size, len(data))) def stressThread(server, numMessages, wait): try: try: ! for i in range(numMessages): r = CallPipe(CallNamedPipe, ("\\\\%s\\pipe\\PyPipeTest" % server, "#" * 512, 1024, NMPWAIT_WAIT_FOREVER)) except: traceback.print_exc() ! print("Failed after %d messages" % i) finally: SetEvent(wait) def stressTestClient(server, numThreads, numMessages): ! import _thread thread_waits = [] ! for t_num in range(numThreads): # Note I could just wait on thread handles (after calling DuplicateHandle) # See the service itself for an example of waiting for the clients... wait = CreateEvent(None, 0, 0, None) thread_waits.append(wait) ! _thread.start_new_thread(stressThread, (server,numMessages, wait)) # Wait for all threads to finish. WaitForMultipleObjects(thread_waits, 1, INFINITE) *************** *** 106,119 **** testLargeMessage(server) msg = string.join(args) ! except getopt.error, msg: ! print msg my_name = os.path.split(sys.argv[0])[1] ! print "Usage: %s [-v] [-s server] [-t thread_count=0] [-m msg_count=500] msg ..." % my_name ! print " -v = verbose" ! print " Specifying a value for -t will stress test using that many threads." return testClient(server, msg) if thread_count > 0: ! print "Spawning %d threads each sending %d messages..." % (thread_count, msg_count) stressTestClient(server, thread_count, msg_count) --- 107,120 ---- testLargeMessage(server) msg = string.join(args) ! except getopt.error as msg: ! print(msg) my_name = os.path.split(sys.argv[0])[1] ! print("Usage: %s [-v] [-s server] [-t thread_count=0] [-m msg_count=500] msg ..." % my_name) ! print(" -v = verbose") ! print(" Specifying a value for -t will stress test using that many threads.") return testClient(server, msg) if thread_count > 0: ! print("Spawning %d threads each sending %d messages..." % (thread_count, msg_count)) stressTestClient(server, thread_count, msg_count) Index: pipeTestService.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/Demos/service/pipeTestService.py,v retrieving revision 1.6 retrieving revision 1.6.4.1 diff -C2 -d -r1.6 -r1.6.4.1 *** pipeTestService.py 31 Jan 2005 04:11:59 -0000 1.6 --- pipeTestService.py 29 Aug 2008 04:59:25 -0000 1.6.4.1 *************** *** 25,33 **** import traceback ! import thread def ApplyIgnoreError(fn, args): try: ! return apply(fn, args) except error: # Ignore win32api errors. return None --- 25,33 ---- import traceback ! import _thread def ApplyIgnoreError(fn, args): try: ! return fn(*args) except error: # Ignore win32api errors. return None *************** *** 74,78 **** hr, thisd = ReadFile(pipeHandle, 256) d = d + thisd ! print "Read", d ok = 1 except error: --- 74,78 ---- hr, thisd = ReadFile(pipeHandle, 256) d = d + thisd ! print("Read", d) ok = 1 except error: *************** *** 126,131 **** try: hr = ConnectNamedPipe(pipeHandle, self.overlapped) ! except error, details: ! print "Error connecting pipe!", details CloseHandle(pipeHandle) break --- 126,131 ---- try: hr = ConnectNamedPipe(pipeHandle, self.overlapped) ! except error as details: ! print("Error connecting pipe!", details) CloseHandle(pipeHandle) break *************** *** 139,143 **** else: # Pipe event - spawn thread to deal with it. ! thread.start_new_thread(self.ProcessClient, (pipeHandle,)) num_connections = num_connections + 1 --- 139,143 ---- else: # Pipe event - spawn thread to deal with it. ! _thread.start_new_thread(self.ProcessClient, (pipeHandle,)) num_connections = num_connections + 1 *************** *** 148,152 **** while self.thread_handles: self.ReportServiceStatus(win32service.SERVICE_STOP_PENDING, 5000) ! print "Waiting for %d threads to finish..." % (len(self.thread_handles)) WaitForMultipleObjects(self.thread_handles, 1, 3000) # Write another event log record. --- 148,152 ---- while self.thread_handles: self.ReportServiceStatus(win32service.SERVICE_STOP_PENDING, 5000) ! print("Waiting for %d threads to finish..." % (len(self.thread_handles))) WaitForMultipleObjects(self.thread_handles, 1, 3000) # Write another event log record. |
From: Roger U. <ru...@us...> - 2008-08-29 04:59:45
|
Update of /cvsroot/pywin32/pywin32/win32/Demos/win32wnet In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15490/Demos/win32wnet Modified Files: Tag: py3k testwnet.py Log Message: Changes to build for Python 3.0 Index: testwnet.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/Demos/win32wnet/testwnet.py,v retrieving revision 1.2 retrieving revision 1.2.4.1 diff -C2 -d -r1.2 -r1.2.4.1 *** testwnet.py 9 Feb 2001 07:25:57 -0000 1.2 --- testwnet.py 29 Aug 2008 04:59:25 -0000 1.2.4.1 *************** *** 1,5 **** import win32wnet import sys ! from winnetwk import * import os --- 1,5 ---- import win32wnet import sys ! from .winnetwk import * import os *************** *** 15,34 **** try: if item.dwDisplayType == RESOURCEDISPLAYTYPE_SHARE: ! print indent + "Have share with name:", item.lpRemoteName possible_shares.append(item) elif item.dwDisplayType == RESOURCEDISPLAYTYPE_GENERIC: ! print indent + "Have generic resource with name:", item.lpRemoteName else: # Try generic! ! print indent + "Enumerating " + item.lpRemoteName, k = win32wnet.WNetOpenEnum(RESOURCE_GLOBALNET, RESOURCETYPE_ANY,0,item) ! print _doDumpHandle(k, level + 1) win32wnet.WNetCloseEnum(k) # could do k.Close(), but this is a good test! ! except win32wnet.error, details: ! print indent + "Couldn't enumerate this resource: " + details[2] def TestOpenEnum(): ! print "Enumerating all resources on the network - this may take some time..." handle = win32wnet.WNetOpenEnum(RESOURCE_GLOBALNET,RESOURCETYPE_ANY,0,None) --- 15,34 ---- try: if item.dwDisplayType == RESOURCEDISPLAYTYPE_SHARE: ! print(indent + "Have share with name:", item.lpRemoteName) possible_shares.append(item) elif item.dwDisplayType == RESOURCEDISPLAYTYPE_GENERIC: ! print(indent + "Have generic resource with name:", item.lpRemoteName) else: # Try generic! ! print(indent + "Enumerating " + item.lpRemoteName, end=' ') k = win32wnet.WNetOpenEnum(RESOURCE_GLOBALNET, RESOURCETYPE_ANY,0,item) ! print() _doDumpHandle(k, level + 1) win32wnet.WNetCloseEnum(k) # could do k.Close(), but this is a good test! ! except win32wnet.error as details: ! print(indent + "Couldn't enumerate this resource: " + details[2]) def TestOpenEnum(): ! print("Enumerating all resources on the network - this may take some time...") handle = win32wnet.WNetOpenEnum(RESOURCE_GLOBALNET,RESOURCETYPE_ANY,0,None) *************** *** 37,53 **** finally: handle.Close() ! print "Finished dumping all resources." def TestConnection(): if len(possible_shares)==0: ! print "Couldn't find any potential shares to connect to" return localName = "Z:" # need better way! for share in possible_shares: ! print "Attempting connection of", localName, "to", share.lpRemoteName try: win32wnet.WNetAddConnection2(share.dwType, localName, share.lpRemoteName) ! except win32wnet.error, details: ! print "Couldn't connect: " + details[2] continue # Have a connection. --- 37,53 ---- finally: handle.Close() ! print("Finished dumping all resources.") def TestConnection(): if len(possible_shares)==0: ! print("Couldn't find any potential shares to connect to") return localName = "Z:" # need better way! for share in possible_shares: ! print("Attempting connection of", localName, "to", share.lpRemoteName) try: win32wnet.WNetAddConnection2(share.dwType, localName, share.lpRemoteName) ! except win32wnet.error as details: ! print("Couldn't connect: " + details[2]) continue # Have a connection. *************** *** 55,62 **** fname = os.path.join(localName + "\\", os.listdir(localName + "\\")[0]) try: ! print "Universal name of '%s' is '%s'" % (fname, win32wnet.WNetGetUniversalName(fname)) ! except win32wnet.error, details: ! print "Couldn't get universal name of '%s': %s" % (fname, details[2]) ! print "User name for this connection is", win32wnet.WNetGetUser(localName) finally: win32wnet.WNetCancelConnection2(localName, 0, 0) --- 55,62 ---- fname = os.path.join(localName + "\\", os.listdir(localName + "\\")[0]) try: ! print("Universal name of '%s' is '%s'" % (fname, win32wnet.WNetGetUniversalName(fname))) ! except win32wnet.error as details: ! print("Couldn't get universal name of '%s': %s" % (fname, details[2])) ! print("User name for this connection is", win32wnet.WNetGetUser(localName)) finally: win32wnet.WNetCancelConnection2(localName, 0, 0) *************** *** 66,72 **** def TestGetUser(): u = win32wnet.WNetGetUser() ! print "Current global user is", `u` if u != win32wnet.WNetGetUser(None): ! raise RuntimeError, "Default value didnt seem to work!" TestGetUser() --- 66,72 ---- def TestGetUser(): u = win32wnet.WNetGetUser() ! print("Current global user is", repr(u)) if u != win32wnet.WNetGetUser(None): ! raise RuntimeError("Default value didnt seem to work!") TestGetUser() |
From: Roger U. <ru...@us...> - 2008-08-29 04:59:45
|
Update of /cvsroot/pywin32/pywin32/win32/Demos/dde In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15490/Demos/dde Modified Files: Tag: py3k ddeclient.py ddeserver.py Log Message: Changes to build for Python 3.0 Index: ddeclient.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/Demos/dde/ddeclient.py,v retrieving revision 1.1 retrieving revision 1.1.4.1 diff -C2 -d -r1.1 -r1.1.4.1 *** ddeclient.py 2 Sep 1999 00:19:24 -0000 1.1 --- ddeclient.py 29 Aug 2008 04:59:24 -0000 1.1.4.1 *************** *** 1,4 **** # 'Request' example added jjk 11/20/98 ! import win32ui import dde --- 1,4 ---- # 'Request' example added jjk 11/20/98 ! import site ## Py3k bug 3279 import win32ui import dde *************** *** 16,19 **** s = 'abcdefghi' sl = conversation.Request(s) ! print 'length of "%s" is %s'%(s,sl) --- 16,19 ---- s = 'abcdefghi' sl = conversation.Request(s) ! print('length of "%s" is %s'%(s,sl)) Index: ddeserver.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/Demos/dde/ddeserver.py,v retrieving revision 1.1 retrieving revision 1.1.4.1 diff -C2 -d -r1.1 -r1.1.4.1 *** ddeserver.py 2 Sep 1999 00:19:24 -0000 1.1 --- ddeserver.py 29 Aug 2008 04:59:24 -0000 1.1.4.1 *************** *** 1,4 **** --- 1,6 ---- # 'Request' example added jjk 11/20/98 + import site ## still not fixed in 3.0b3 + import win32ui from pywin.mfc import object *************** *** 10,14 **** def Exec(self, cmd): ! print "System Topic asked to exec", cmd class MyOtherTopic(object.Object): --- 12,16 ---- def Exec(self, cmd): ! print("System Topic asked to exec", cmd) class MyOtherTopic(object.Object): *************** *** 17,21 **** def Exec(self, cmd): ! print "Other Topic asked to exec", cmd class MyRequestTopic(object.Object): --- 19,23 ---- def Exec(self, cmd): ! print("Other Topic asked to exec", cmd) class MyRequestTopic(object.Object): *************** *** 26,30 **** def Request(self, aString): ! print "Request Topic asked to compute length of:", aString return(str(len(aString))) --- 28,32 ---- def Request(self, aString): ! print("Request Topic asked to compute length of:", aString) return(str(len(aString))) |
From: Roger U. <ru...@us...> - 2008-08-29 04:59:45
|
Update of /cvsroot/pywin32/pywin32/win32/Demos/pipes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15490/Demos/pipes Modified Files: Tag: py3k runproc.py Log Message: Changes to build for Python 3.0 Index: runproc.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/Demos/pipes/runproc.py,v retrieving revision 1.1 retrieving revision 1.1.4.1 diff -C2 -d -r1.1 -r1.1.4.1 *** runproc.py 2 Sep 1999 00:19:25 -0000 1.1 --- runproc.py 29 Aug 2008 04:59:24 -0000 1.1.4.1 *************** *** 96,103 **** self.stdout = os.fdopen(msvcrt.open_osfhandle(self.hStdout_r, 0), "rb") ! print "Read on stdout: ", repr(self.stdout.read()) self.stderr = os.fdopen(msvcrt.open_osfhandle(self.hStderr_r, 0), "rb") ! print "Read on stderr: ", repr(self.stderr.read()) --- 96,103 ---- self.stdout = os.fdopen(msvcrt.open_osfhandle(self.hStdout_r, 0), "rb") ! print("Read on stdout: ", repr(self.stdout.read())) self.stderr = os.fdopen(msvcrt.open_osfhandle(self.hStderr_r, 0), "rb") ! print("Read on stderr: ", repr(self.stderr.read())) |
Update of /cvsroot/pywin32/pywin32/win32/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15490/src Modified Files: Tag: py3k PyACL.cpp PyDEVMODE.cpp PyHANDLE.cpp PyIID.cpp PyLARGE_INTEGER.cpp PyOVERLAPPED.cpp PySECURITY_ATTRIBUTES.cpp PySECURITY_DESCRIPTOR.cpp PySID.cpp PySecurityObjects.h PyTime.cpp PyUnicode.cpp PyWAVEFORMATEX.cpp PyWinObjects.h PyWinTypes.h PyWinTypesmodule.cpp PythonService.cpp _win32sysloader.cpp dbi.cpp dbi.def mmapfilemodule.cpp odbc.cpp stddde.h timermodule.cpp win2krasmodule.cpp win32api_display.cpp win32api_display.h win32apimodule.cpp win32clipboardmodule.cpp win32consolemodule.cpp win32credmodule.cpp win32dynamicdialog.cpp win32dynamicdialog.h win32event.i win32evtlog.i win32file.i win32file_comm.cpp win32gui.i win32helpmodule.cpp win32job.i win32lzmodule.cpp win32pdhmodule.cpp win32pipe.i win32process.i win32profilemodule.cpp win32rasmodule.cpp win32security.i win32security_sspi.cpp win32service.i win32trace.cpp win32transactionmodule.cpp win32tsmodule.cpp Log Message: Changes to build for Python 3.0 Index: win32process.i =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32process.i,v retrieving revision 1.33 retrieving revision 1.33.2.1 diff -C2 -d -r1.33 -r1.33.2.1 *** win32process.i 24 May 2008 00:29:55 -0000 1.33 --- win32process.i 29 Aug 2008 04:59:27 -0000 1.33.2.1 *************** *** 85,93 **** static void deallocFunc(PyObject *ob); ! static PyObject *getattr(PyObject *self, char *name); ! static int setattr(PyObject *self, char *name, PyObject *v); ! #pragma warning( disable : 4251 ) ! static struct memberlist memberlist[]; ! #pragma warning( default : 4251 ) protected: --- 85,91 ---- static void deallocFunc(PyObject *ob); ! static PyObject *getattro(PyObject *self, PyObject *obname); ! static int setattro(PyObject *self, PyObject *obname, PyObject *v); ! static struct PyMemberDef members[]; protected: *************** *** 103,128 **** PyTypeObject PySTARTUPINFOType = { ! PyObject_HEAD_INIT(&PyType_Type) ! 0, "PySTARTUPINFO", sizeof(PySTARTUPINFO), 0, PySTARTUPINFO::deallocFunc, /* tp_dealloc */ ! 0, /* tp_print */ ! PySTARTUPINFO::getattr, /* tp_getattr */ ! PySTARTUPINFO::setattr, /* tp_setattr */ 0, /* tp_compare */ 0, /* tp_repr */ 0, /* tp_as_number */ ! 0, /* tp_as_sequence */ 0, /* tp_as_mapping */ ! 0, 0, /* tp_call */ ! 0, /* tp_str */ }; #define OFF(e) offsetof(PySTARTUPINFO, e) ! /*static*/ struct memberlist PySTARTUPINFO::memberlist[] = { {"dwX", T_INT, OFF(m_startupinfo.dwX)}, // @prop integer|dwX|Specifies the x offset, in pixels, of the upper left corner of a window if a new window is created. The offset is from the upper left corner of the screen. {"dwY", T_INT, OFF(m_startupinfo.dwY)}, // @prop integer|dwY|Specifies the y offset, in pixels, of the upper left corner of a window if a new window is created. The offset is from the upper left corner of the screen. --- 101,147 ---- PyTypeObject PySTARTUPINFOType = { ! PYWIN_OBJECT_HEAD "PySTARTUPINFO", sizeof(PySTARTUPINFO), 0, PySTARTUPINFO::deallocFunc, /* tp_dealloc */ ! 0, /* tp_print */ ! 0, /* tp_getattr */ ! 0, /* tp_setattr */ 0, /* tp_compare */ 0, /* tp_repr */ 0, /* tp_as_number */ ! 0, /* tp_as_sequence */ 0, /* tp_as_mapping */ ! 0, /* tp_hash */ 0, /* tp_call */ ! 0, /* tp_str */ ! PySTARTUPINFO::getattro, /* tp_getattr */ ! PySTARTUPINFO::setattro, /* tp_setattr */ ! 0, /*tp_as_buffer*/ ! Py_TPFLAGS_DEFAULT, /* tp_flags */ ! "A Python object, representing a STARTUPINFO structure", /* tp_doc */ ! 0, /* tp_traverse */ ! 0, /* tp_clear */ ! 0, /* tp_richcompare */ ! 0, /* tp_weaklistoffset */ ! 0, /* tp_iter */ ! 0, /* tp_iternext */ ! 0, /* tp_methods */ ! PySTARTUPINFO::members, /* tp_members */ ! 0, /* tp_getset */ ! 0, /* tp_base */ ! 0, /* tp_dict */ ! 0, /* tp_descr_get */ ! 0, /* tp_descr_set */ ! 0, /* tp_dictoffset */ ! 0, /* tp_init */ ! 0, /* tp_alloc */ ! 0, /* tp_new */ }; #define OFF(e) offsetof(PySTARTUPINFO, e) ! /*static*/ struct PyMemberDef PySTARTUPINFO::members[] = { {"dwX", T_INT, OFF(m_startupinfo.dwX)}, // @prop integer|dwX|Specifies the x offset, in pixels, of the upper left corner of a window if a new window is created. The offset is from the upper left corner of the screen. {"dwY", T_INT, OFF(m_startupinfo.dwY)}, // @prop integer|dwY|Specifies the y offset, in pixels, of the upper left corner of a window if a new window is created. The offset is from the upper left corner of the screen. *************** *** 154,159 **** memcpy(&m_startupinfo, pSI, sizeof(m_startupinfo)); m_obStdIn = m_obStdOut = m_obStdErr = NULL; ! m_obDesktop = pSI->lpDesktop ? PyWinObject_FromTCHAR(pSI->lpDesktop) : NULL; ! m_obTitle = pSI->lpTitle ? PyWinObject_FromTCHAR(pSI->lpTitle) : NULL; } --- 173,180 ---- memcpy(&m_startupinfo, pSI, sizeof(m_startupinfo)); m_obStdIn = m_obStdOut = m_obStdErr = NULL; ! if (pSI->lpDesktop) ! m_startupinfo.lpDesktop = PyWin_CopyString(pSI->lpDesktop); ! if (pSI->lpTitle) ! m_startupinfo.lpTitle = PyWin_CopyString(pSI->lpTitle); } *************** *** 163,168 **** Py_XDECREF(m_obStdOut); Py_XDECREF(m_obStdErr); ! Py_XDECREF(m_obDesktop); ! Py_XDECREF(m_obTitle); } --- 184,189 ---- Py_XDECREF(m_obStdOut); Py_XDECREF(m_obStdErr); ! PyWinObject_FreeTCHAR(m_startupinfo.lpDesktop); ! PyWinObject_FreeTCHAR(m_startupinfo.lpTitle); } *************** *** 176,182 **** } ! PyObject *PySTARTUPINFO::getattr(PyObject *self, char *name) { PySTARTUPINFO *pO = (PySTARTUPINFO *)self; // @prop integer/<o PyHANDLE>|hStdInput| // @prop integer/<o PyHANDLE>|hStdOutput| --- 197,206 ---- } ! PyObject *PySTARTUPINFO::getattro(PyObject *self, PyObject *obname) { PySTARTUPINFO *pO = (PySTARTUPINFO *)self; + char *name=PYWIN_ATTR_CONVERT(obname); + if (name == NULL) + return NULL; // @prop integer/<o PyHANDLE>|hStdInput| // @prop integer/<o PyHANDLE>|hStdOutput| *************** *** 189,204 **** return gethandle(pO->m_obStdErr, pO->m_startupinfo.hStdError); // @prop string/None|lpDesktop| ! if (strcmp("lpDesktop", name)==0) { ! PyObject *rc = pO->m_obDesktop ? pO->m_obDesktop : Py_None; ! Py_INCREF(rc); ! return rc; ! } // @prop string/None|lpTitle| ! if (strcmp("lpTitle", name)==0) { ! PyObject *rc = pO->m_obTitle ? pO->m_obTitle : Py_None; ! Py_INCREF(rc); ! return rc; ! } ! return PyMember_Get((char *)self, memberlist, name); } --- 213,222 ---- return gethandle(pO->m_obStdErr, pO->m_startupinfo.hStdError); // @prop string/None|lpDesktop| ! if (strcmp("lpDesktop", name)==0) ! return PyWinObject_FromTCHAR(pO->m_startupinfo.lpDesktop); // @prop string/None|lpTitle| ! if (strcmp("lpTitle", name)==0) ! return PyWinObject_FromTCHAR(pO->m_startupinfo.lpTitle); ! return PyObject_GenericGetAttr(self, obname); } *************** *** 219,223 **** } ! int PySTARTUPINFO::setattr(PyObject *self, char *name, PyObject *v) { if (v == NULL) { --- 237,241 ---- } ! int PySTARTUPINFO::setattro(PyObject *self, PyObject *obname, PyObject *v) { if (v == NULL) { *************** *** 226,229 **** --- 244,250 ---- } PySTARTUPINFO *pO = (PySTARTUPINFO *)self; + char *name=PYWIN_ATTR_CONVERT(obname); + if (name == NULL) + return -1; if (strcmp("hStdInput", name)==0) return sethandle( &pO->m_obStdIn, &pO->m_startupinfo.hStdInput, v); *************** *** 236,257 **** if (strcmp("lpDesktop", name)==0) { ! if (PyWinObject_AsTCHAR(v, &pO->m_startupinfo.lpDesktop, TRUE)) { ! Py_XDECREF(pO->m_obDesktop); ! pO->m_obDesktop = v; ! Py_INCREF(v); ! return 0; ! } else return -1; ! } if (strcmp("lpTitle", name)==0) { ! if (PyWinObject_AsTCHAR(v, &pO->m_startupinfo.lpTitle, TRUE)) { ! Py_XDECREF(pO->m_obTitle); ! pO->m_obTitle = v; ! Py_INCREF(v); ! return 0; ! } else return -1; ! } ! return PyMember_Set((char *)self, memberlist, name, v); } --- 257,277 ---- if (strcmp("lpDesktop", name)==0) { ! TCHAR *val; ! if (!PyWinObject_AsTCHAR(v, &val, TRUE)) return -1; ! PyWinObject_FreeTCHAR(pO->m_startupinfo.lpDesktop); ! pO->m_startupinfo.lpDesktop = val; ! return 0; ! } ! if (strcmp("lpTitle", name)==0) { ! TCHAR *val; ! if (!PyWinObject_AsTCHAR(v, &val, TRUE)) return -1; ! PyWinObject_FreeTCHAR(pO->m_startupinfo.lpTitle); ! pO->m_startupinfo.lpTitle=val; ! return 0; ! } ! return PyObject_GenericSetAttr(self, obname, v); } *************** *** 1532,1535 **** --- 1552,1561 ---- %init %{ + + #if (PY_VERSION_HEX >= 0x03000000) + if (PyType_Ready(&PySTARTUPINFOType) == -1) + return NULL; + #endif + FARPROC fp=NULL; HMODULE hmodule=NULL; *************** *** 1538,1546 **** hmodule=LoadLibrary(_T("Psapi.dll")); if (hmodule!=NULL){ ! pfnEnumProcesses = (EnumProcessesfunc)GetProcAddress(hmodule, _T("EnumProcesses")); ! pfnEnumProcessModules = (EnumProcessModulesfunc)GetProcAddress(hmodule, _T("EnumProcessModules")); ! pfnGetModuleFileNameEx = (GetModuleFileNameExfunc)GetProcAddress(hmodule, _T("GetModuleFileNameExW")); #ifndef MS_WINCE ! pfnGetProcessMemoryInfo = (GetProcessMemoryInfofunc)GetProcAddress(hmodule, _T("GetProcessMemoryInfo")); #endif } --- 1564,1572 ---- hmodule=LoadLibrary(_T("Psapi.dll")); if (hmodule!=NULL){ ! pfnEnumProcesses = (EnumProcessesfunc)GetProcAddress(hmodule, "EnumProcesses"); ! pfnEnumProcessModules = (EnumProcessModulesfunc)GetProcAddress(hmodule, "EnumProcessModules"); ! pfnGetModuleFileNameEx = (GetModuleFileNameExfunc)GetProcAddress(hmodule, "GetModuleFileNameExW"); #ifndef MS_WINCE ! pfnGetProcessMemoryInfo = (GetProcessMemoryInfofunc)GetProcAddress(hmodule, "GetProcessMemoryInfo"); #endif } Index: win32trace.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32trace.cpp,v retrieving revision 1.14 retrieving revision 1.14.2.1 diff -C2 -d -r1.14 -r1.14.2.1 *** win32trace.cpp 18 May 2007 11:22:17 -0000 1.14 --- win32trace.cpp 29 Aug 2008 04:59:28 -0000 1.14.2.1 *************** *** 41,48 **** const size_t BUFFER_SIZE = 0x20000; // Includes size integer. ! const char *MAP_OBJECT_NAME = "Global\\PythonTraceOutputMapping"; ! const char *MUTEX_OBJECT_NAME = "Global\\PythonTraceOutputMutex"; ! const char *EVENT_OBJECT_NAME = "Global\\PythonTraceOutputEvent"; ! const char *EVENT_EMPTY_OBJECT_NAME = "Global\\PythonTraceOutputEmptyEvent"; // Global\\ etc goodness: --- 41,48 ---- const size_t BUFFER_SIZE = 0x20000; // Includes size integer. ! const TCHAR *MAP_OBJECT_NAME = _T("Global\\PythonTraceOutputMapping"); ! const TCHAR *MUTEX_OBJECT_NAME = _T("Global\\PythonTraceOutputMutex"); ! const TCHAR *EVENT_OBJECT_NAME = _T("Global\\PythonTraceOutputEvent"); ! const TCHAR *EVENT_EMPTY_OBJECT_NAME = _T("Global\\PythonTraceOutputEmptyEvent"); // Global\\ etc goodness: *************** *** 72,79 **** BOOL use_global_namespace = FALSE; ! static const char *FixupObjectName(const char *global_name) { if (!use_global_namespace) ! return strchr(global_name, '\\')+1; // global prefix is ok. return global_name; --- 72,79 ---- BOOL use_global_namespace = FALSE; ! static const TCHAR *FixupObjectName(const TCHAR *global_name) { if (!use_global_namespace) ! return _tcschr(global_name, '\\')+1; // global prefix is ok. return global_name; *************** *** 175,179 **** static PyMethodDef PyTraceObject_methods[] = { ! {"blockingread", PyTraceObject_blockingread, METH_VARARGS}, // @pytmeth blockingread {"read", PyTraceObject_read, METH_VARARGS }, // @pymeth read| {"write", PyTraceObject_write, METH_VARARGS }, // @pymeth write| --- 175,179 ---- static PyMethodDef PyTraceObject_methods[] = { ! {"blockingread", PyTraceObject_blockingread, METH_VARARGS}, // @pymeth blockingread {"read", PyTraceObject_read, METH_VARARGS }, // @pymeth read| {"write", PyTraceObject_write, METH_VARARGS }, // @pymeth write| *************** *** 192,197 **** static PyTypeObject PyTraceObjectType = { ! PyObject_HEAD_INIT(&PyType_Type) ! 0, "PyTraceObject", sizeof(PyTraceObject), --- 192,196 ---- static PyTypeObject PyTraceObjectType = { ! PYWIN_OBJECT_HEAD "PyTraceObject", sizeof(PyTraceObject), *************** *** 604,619 **** }; ! extern "C" __declspec(dllexport) void ! initwin32trace(void) { ! PyWinGlobals_Ensure(); ! PyObject *dict; ! PyObject* pModMe = Py_InitModule("win32trace", win32trace_functions); ! if (!pModMe) return; ! dict = PyModule_GetDict(pModMe); ! if (!dict) return; ! Py_INCREF(PyWinExc_ApiError); ! PyDict_SetItemString(dict, "error", PyWinExc_ApiError); // Allocate memory for the security descriptor. --- 603,645 ---- }; ! extern "C" __declspec(dllexport) ! #if (PY_VERSION_HEX < 0x03000000) ! void initwin32trace(void) ! #else ! PyObject *PyInit_win32trace(void) ! #endif { ! PyObject *dict, *module; ! PyWinGlobals_Ensure(); ! #if (PY_VERSION_HEX < 0x03000000) ! #define RETURN_ERROR return; ! module = Py_InitModule("win32trace", win32trace_functions); ! if (!module) ! return; ! dict = PyModule_GetDict(module); ! if (!dict) ! return; ! #else ! #define RETURN_ERROR return NULL; ! static PyModuleDef win32trace_def = { ! PyModuleDef_HEAD_INIT, ! "win32trace", ! "Interface to the Windows Console functions for dealing with character-mode applications.", ! -1, ! win32trace_functions ! }; ! module = PyModule_Create(&win32trace_def); ! if (!module) ! return NULL; ! dict = PyModule_GetDict(module); ! if (!dict) ! return NULL; ! #endif ! ! if (PyType_Ready(&PyTraceObjectType) == -1) ! RETURN_ERROR; ! if (PyDict_SetItemString(dict, "error", PyWinExc_ApiError) == -1) ! RETURN_ERROR; // Allocate memory for the security descriptor. *************** *** 670,674 **** if (hMutex==NULL) { PyWin_SetAPIError("CreateMutex"); ! return ; } assert (hEvent==NULL); --- 696,700 ---- if (hMutex==NULL) { PyWin_SetAPIError("CreateMutex"); ! RETURN_ERROR ; } assert (hEvent==NULL); *************** *** 676,680 **** if (hEvent==NULL) { PyWin_SetAPIError("CreateEvent"); ! return ; } assert (hEventEmpty==NULL); --- 702,706 ---- if (hEvent==NULL) { PyWin_SetAPIError("CreateEvent"); ! RETURN_ERROR; } assert (hEventEmpty==NULL); *************** *** 682,686 **** if (hEventEmpty==NULL) { PyWin_SetAPIError("CreateEvent"); ! return ; } } --- 708,715 ---- if (hEventEmpty==NULL) { PyWin_SetAPIError("CreateEvent"); ! RETURN_ERROR ; } + #if (PY_VERSION_HEX >= 0x03000000) + return module; + #endif } Index: PySECURITY_DESCRIPTOR.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/PySECURITY_DESCRIPTOR.cpp,v retrieving revision 1.19 retrieving revision 1.19.2.1 diff -C2 -d -r1.19 -r1.19.2.1 *** PySECURITY_DESCRIPTOR.cpp 24 May 2007 06:01:05 -0000 1.19 --- PySECURITY_DESCRIPTOR.cpp 29 Aug 2008 04:59:25 -0000 1.19.2.1 *************** *** 102,109 **** if (!PyArg_ParseTuple(args, "O:SECURITY_DESCRIPTOR", &obsd)) return NULL; ! if (PyObject_AsReadBuffer(obsd, (const void **)&psd, &buf_len)==-1){ ! PyErr_SetString(PyExc_TypeError,"Object has no data buffer"); return NULL; - } if (!IsValidSecurityDescriptor(psd)){ PyErr_SetString(PyExc_ValueError,"Data is not a valid security descriptor"); --- 102,107 ---- if (!PyArg_ParseTuple(args, "O:SECURITY_DESCRIPTOR", &obsd)) return NULL; ! if (PyObject_AsReadBuffer(obsd, (const void **)&psd, &buf_len)==-1) return NULL; if (!IsValidSecurityDescriptor(psd)){ PyErr_SetString(PyExc_ValueError,"Data is not a valid security descriptor"); *************** *** 680,684 **** // @object PySECURITY_DESCRIPTOR|A Python object, representing a SECURITY_DESCRIPTOR structure ! static struct PyMethodDef PySECURITY_DESCRIPTOR_methods[] = { {"Initialize", PySECURITY_DESCRIPTOR::Initialize, 1}, // @pymeth Initialize|Initializes the object. {"GetSecurityDescriptorOwner", PySECURITY_DESCRIPTOR::GetSecurityDescriptorOwner, 1}, // @pymeth GetSecurityDescriptorOwner|Return the owner of the security descriptor. SID is returned. --- 678,682 ---- // @object PySECURITY_DESCRIPTOR|A Python object, representing a SECURITY_DESCRIPTOR structure ! struct PyMethodDef PySECURITY_DESCRIPTOR::methods[] = { {"Initialize", PySECURITY_DESCRIPTOR::Initialize, 1}, // @pymeth Initialize|Initializes the object. {"GetSecurityDescriptorOwner", PySECURITY_DESCRIPTOR::GetSecurityDescriptorOwner, 1}, // @pymeth GetSecurityDescriptorOwner|Return the owner of the security descriptor. SID is returned. *************** *** 699,702 **** --- 697,721 ---- }; + // Buffer interface in Python 3.0 has changed + #if (PY_VERSION_HEX < 0x03000000) + /*static*/ Py_ssize_t PySECURITY_DESCRIPTOR::getreadbuf(PyObject *self, Py_ssize_t index, void **ptr) + { + if ( index != 0 ) { + PyErr_SetString(PyExc_SystemError, + "accessing non-existent SID segment"); + return -1; + } + PySECURITY_DESCRIPTOR *pysd = (PySECURITY_DESCRIPTOR *)self; + *ptr = pysd->m_psd; + return GetSecurityDescriptorLength(pysd->m_psd); + } + + /*static*/ Py_ssize_t PySECURITY_DESCRIPTOR::getsegcount(PyObject *self, Py_ssize_t *lenp) + { + if ( lenp ) + *lenp = GetSecurityDescriptorLength(((PySECURITY_DESCRIPTOR *)self)->m_psd); + return 1; + } + static PyBufferProcs PySECURITY_DESCRIPTOR_as_buffer = { PySECURITY_DESCRIPTOR::getreadbuf, *************** *** 706,739 **** }; PYWINTYPES_EXPORT PyTypeObject PySECURITY_DESCRIPTORType = { ! PyObject_HEAD_INIT(&PyType_Type) ! 0, "PySECURITY_DESCRIPTOR", sizeof(PySECURITY_DESCRIPTOR), 0, PySECURITY_DESCRIPTOR::deallocFunc, /* tp_dealloc */ ! 0, /* tp_print */ ! PySECURITY_DESCRIPTOR::getattr, /* tp_getattr */ ! PySECURITY_DESCRIPTOR::setattr, /* tp_setattr */ ! 0, /* tp_compare */ 0, /* tp_repr */ 0, /* tp_as_number */ ! 0, /* tp_as_sequence */ 0, /* tp_as_mapping */ ! 0, 0, /* tp_call */ ! 0, /* tp_str */ ! 0, /*tp_getattro*/ ! 0, /*tp_setattro*/ // @comm Note the PySECURITY_DESCRIPTOR object supports the buffer interface. Thus buffer(sd) can be used to obtain the raw bytes. &PySECURITY_DESCRIPTOR_as_buffer, /*tp_as_buffer*/ }; - #define OFF(e) offsetof(PySECURITY_DESCRIPTOR, e) - - /*static*/ struct memberlist PySECURITY_DESCRIPTOR::memberlist[] = { - {NULL} /* Sentinel */ - }; PySECURITY_DESCRIPTOR::PySECURITY_DESCRIPTOR(Py_ssize_t cb /*= 0*/) --- 725,785 ---- }; + #else // New buffer interface for Python 3.0 + /*static*/ int PySECURITY_DESCRIPTOR::getbufferinfo(PyObject *self, Py_buffer *view, int flags) + { + PySECURITY_DESCRIPTOR *pysd = (PySECURITY_DESCRIPTOR *)self; + return PyBuffer_FillInfo(view, self, pysd->m_psd, + GetSecurityDescriptorLength(pysd->m_psd), 1, flags); + } + + static PyBufferProcs PySECURITY_DESCRIPTOR_as_buffer = { + PySECURITY_DESCRIPTOR::getbufferinfo, + NULL // Don't need to release any memory from Py_buffer struct + }; + #endif // PY_VERSION_HEX < 0x03000000 + PYWINTYPES_EXPORT PyTypeObject PySECURITY_DESCRIPTORType = { ! PYWIN_OBJECT_HEAD "PySECURITY_DESCRIPTOR", sizeof(PySECURITY_DESCRIPTOR), 0, PySECURITY_DESCRIPTOR::deallocFunc, /* tp_dealloc */ ! 0, /* tp_print */ ! 0, /* tp_getattr */ ! 0, /* tp_setattr */ ! 0, /* tp_compare */ 0, /* tp_repr */ 0, /* tp_as_number */ ! 0, /* tp_as_sequence */ 0, /* tp_as_mapping */ ! 0, /* tp_hash */ 0, /* tp_call */ ! 0, /* tp_str */ ! PyObject_GenericGetAttr, /* tp_getattro */ ! PyObject_GenericSetAttr, /* tp_setattro */ // @comm Note the PySECURITY_DESCRIPTOR object supports the buffer interface. Thus buffer(sd) can be used to obtain the raw bytes. &PySECURITY_DESCRIPTOR_as_buffer, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ + 0, /* tp_doc */ + 0, /* tp_traverse */ + 0, /* tp_clear */ + 0, /* tp_richcompare */ + 0, /* tp_weaklistoffset */ + 0, /* tp_iter */ + 0, /* tp_iternext */ + PySECURITY_DESCRIPTOR::methods, /* tp_methods */ + 0, /* tp_members */ + 0, /* tp_getset */ + 0, /* tp_base */ + 0, /* tp_dict */ + 0, /* tp_descr_get */ + 0, /* tp_descr_set */ + 0, /* tp_dictoffset */ + 0, /* tp_init */ + 0, /* tp_alloc */ + 0, /* tp_new */ }; PySECURITY_DESCRIPTOR::PySECURITY_DESCRIPTOR(Py_ssize_t cb /*= 0*/) *************** *** 762,809 **** } - PyObject *PySECURITY_DESCRIPTOR::getattr(PyObject *self, char *name) - { - PyObject *res; - - res = Py_FindMethod(PySECURITY_DESCRIPTOR_methods, self, name); - if (res != NULL) - return res; - PyErr_Clear(); - return PyMember_Get((char *)self, memberlist, name); - } - - int PySECURITY_DESCRIPTOR::setattr(PyObject *self, char *name, PyObject *v) - { - if (v == NULL) { - PyErr_SetString(PyExc_AttributeError, "can't delete SECURITY_DESCRIPTOR attributes"); - return -1; - } - return PyMember_Set((char *)self, memberlist, name, v); - } - /*static*/ void PySECURITY_DESCRIPTOR::deallocFunc(PyObject *ob) { delete (PySECURITY_DESCRIPTOR *)ob; } - - /*static*/ Py_ssize_t PySECURITY_DESCRIPTOR::getreadbuf(PyObject *self, Py_ssize_t index, void **ptr) - { - if ( index != 0 ) { - PyErr_SetString(PyExc_SystemError, - "accessing non-existent SID segment"); - return -1; - } - PySECURITY_DESCRIPTOR *pysd = (PySECURITY_DESCRIPTOR *)self; - *ptr = pysd->m_psd; - return GetSecurityDescriptorLength(pysd->m_psd); - } - - /*static*/ Py_ssize_t PySECURITY_DESCRIPTOR::getsegcount(PyObject *self, Py_ssize_t *lenp) - { - if ( lenp ) - *lenp = GetSecurityDescriptorLength(((PySECURITY_DESCRIPTOR *)self)->m_psd); - return 1; - } - #else /* NO_PYWINTYPES_SECURITY */ --- 808,815 ---- Index: win32apimodule.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32apimodule.cpp,v retrieving revision 1.89 retrieving revision 1.89.2.1 diff -C2 -d -r1.89 -r1.89.2.1 *** win32apimodule.cpp 10 Aug 2008 13:13:21 -0000 1.89 --- win32apimodule.cpp 29 Aug 2008 04:59:26 -0000 1.89.2.1 *************** *** 12,16 **** ******************************************************************/ - // #define UNICODE #include "PyWinTypes.h" #include "PyWinObjects.h" --- 12,15 ---- *************** *** 22,25 **** --- 21,25 ---- #define SECURITY_WIN32 // required by below #include "security.h" // for GetUserNameEx + #include "PowrProf.h" // Identical to PyW32_BEGIN_ALLOW_THREADS except no script "{" !!! *************** *** 3789,3793 **** DWORD nSubKeys, nValues; FILETIME ft; - PyObject *l; // @pyparm <o PyHKEY>/int|key||An already open key, or or any one of the following win32con --- 3789,3792 ---- *************** *** 3805,3813 **** )!=ERROR_SUCCESS) return ReturnAPIError("RegQueryInfoKey", rc); ! if (!(l=PyLong_FromTwoInts(ft.dwHighDateTime, ft.dwLowDateTime))) ! return NULL; ! PyObject *ret = Py_BuildValue("iiO",nSubKeys,nValues,l); ! Py_DECREF(l); ! return ret; } --- 3804,3808 ---- )!=ERROR_SUCCESS) return ReturnAPIError("RegQueryInfoKey", rc); ! return Py_BuildValue("iiN",nSubKeys,nValues, PyWinObject_FromFILETIME(ft)); } *************** *** 5456,5460 **** ret = PyInt_AsLong(obRet); // Exception instance to be raised. ! } else if (PyInstance_Check(obRet)) { *ppExcType = obRet; Py_INCREF(obRet); --- 5451,5455 ---- ret = PyInt_AsLong(obRet); // Exception instance to be raised. ! } else if (PyObject_IsSubclass(obRet, PyExc_Exception)) { *ppExcType = obRet; Py_INCREF(obRet); *************** *** 5512,5516 **** if (stateCur == NULL) stateCur = stateSave; PyThreadState_Swap(stateCur); ! if (PyInstance_Check(exc_type)) { if (exc_value != NULL) PyErr_SetString(PyExc_TypeError, "instance exception returned from exception handler may not have a separate value"); --- 5507,5511 ---- if (stateCur == NULL) stateCur = stateSave; PyThreadState_Swap(stateCur); ! if (PyObject_IsSubclass(exc_type, PyExc_Exception)) { if (exc_value != NULL) PyErr_SetString(PyExc_TypeError, "instance exception returned from exception handler may not have a separate value"); *************** *** 5518,5522 **** // Normalize to class, instance exc_value = exc_type; ! exc_type = (PyObject*) ((PyInstanceObject*)exc_type)->in_class; Py_INCREF(exc_type); PyErr_SetObject(exc_type, exc_value); --- 5513,5517 ---- // Normalize to class, instance exc_value = exc_type; ! exc_type = (PyObject *)exc_value->ob_type; Py_INCREF(exc_type); PyErr_SetObject(exc_type, exc_value); *************** *** 5956,5959 **** --- 5951,6008 ---- } + PyObject *PyWinObject_FromBATTERY_REPORTING_SCALE(PBATTERY_REPORTING_SCALE pbrs) + { + return Py_BuildValue("{s:N, s:N}", + "Granularity", PyLong_FromUnsignedLong(pbrs->Granularity), + "Capacity", PyLong_FromUnsignedLong(pbrs->Capacity)); + } + + /* + // @pymethod dict|win32api|GetPwrCapabilities|Retrieves system's power capabilities + // @pyseeapi GetPwrCapabilities + // @comm Requires Win2k or later. + // @rdesc Returns a dict representing a SYSTEM_POWER_CAPABILITIES struct + PyObject *PyGetPwrCapabilities(PyObject *self, PyObject *args) + { + SYSTEM_POWER_CAPABILITIES spc; + if (!GetPwrCapabilities(&spc)) + return PyWin_SetAPIError("GetPwrCapabilities"); + return Py_BuildValue( + "{s:N, s:N, s:N, s:N, s:N, s:N, s:N, s:N, s:N, s:N, s:N, s:N, s:N, s:N, s:N," + " s:N, s:N, s:N, s:O, s:N, s:O, s:N, s:N, s:O, s:N, s:N, s:N, s:N, s:N}", + "PowerButtonPresent", PyBool_FromLong(spc.PowerButtonPresent), + "SleepButtonPresent", PyBool_FromLong(spc.SleepButtonPresent), + "LidPresent", PyBool_FromLong(spc.LidPresent), + "SystemS1", PyBool_FromLong(spc.SystemS1), + "SystemS2", PyBool_FromLong(spc.SystemS2), + "SystemS3", PyBool_FromLong(spc.SystemS3), + "SystemS4", PyBool_FromLong(spc.SystemS4), + "SystemS5", PyBool_FromLong(spc.SystemS5), + "HiberFilePresent", PyBool_FromLong(spc.HiberFilePresent), + "FullWake", PyBool_FromLong(spc.FullWake), + "VideoDimPresent", PyBool_FromLong(spc.VideoDimPresent), + "ApmPresent", PyBool_FromLong(spc.ApmPresent), + "UpsPresent", PyBool_FromLong(spc.UpsPresent), + "ThermalControl", PyBool_FromLong(spc.ThermalControl), + "ProcessorThrottle", PyBool_FromLong(spc.ProcessorThrottle), + "ProcessorMinThrottle", PyInt_FromLong(spc.ProcessorMinThrottle), + "ProcessorMaxThrottle", PyInt_FromLong(spc.ProcessorMaxThrottle), + "FastSystemS4", PyBool_FromLong(spc.FastSystemS4), + "spare2", Py_None, // reserved + "DiskSpinDown", PyBool_FromLong(spc.DiskSpinDown), + "spare3", Py_None, // reserved + "SystemBatteriesPresent", PyBool_FromLong(spc.SystemBatteriesPresent), + "BatteriesAreShortTerm", PyBool_FromLong(spc.BatteriesAreShortTerm), + "BatteryScale", Py_BuildValue("NNN", + PyWinObject_FromBATTERY_REPORTING_SCALE(&spc.BatteryScale[0]), + PyWinObject_FromBATTERY_REPORTING_SCALE(&spc.BatteryScale[1]), + PyWinObject_FromBATTERY_REPORTING_SCALE(&spc.BatteryScale[2])), + "AcOnLineWake", PyInt_FromLong(spc.AcOnLineWake), + "SoftLidWake", PyInt_FromLong(spc.SoftLidWake), + "RtcWake", PyInt_FromLong(spc.RtcWake), + "MinDeviceWakeState", PyInt_FromLong(spc.MinDeviceWakeState), + "DefaultLowLatencyWake", PyInt_FromLong(spc.DefaultLowLatencyWake)); + } + */ /* List of functions exported by this module */ *************** *** 6054,6057 **** --- 6103,6109 ---- {"GetModuleFileNameW", PyGetModuleFileNameW,1}, // @pymeth GetModuleFileNameW|Retrieves the unicode filename of the specified module. {"GetModuleHandle", PyGetModuleHandle,1}, // @pymeth GetModuleHandle|Returns the handle of an already loaded DLL. + + // {"GetPwrCapabilities", PyGetPwrCapabilities, METH_NOARGS}, // @pymeth GetPwrCapabilities|Retrieves system's power capabilities + {"GetProfileSection", PyGetProfileSection,1}, // @pymeth GetProfileSection|Returns a list of entries in an INI file. {"GetProcAddress", PyGetProcAddress,1}, // @pymeth GetProcAddress|Returns the address of the specified exported dynamic-link library (DLL) function. *************** *** 6190,6204 **** }; ! extern "C" __declspec(dllexport) void ! initwin32api(void) { ! PyObject *dict, *module; ! PyWinGlobals_Ensure(); ! module = Py_InitModule("win32api", win32api_functions); ! if (!module) /* Eeek - some serious error! */ ! return; ! dict = PyModule_GetDict(module); ! if (!dict) return; /* Another serious error!*/ ! Py_INCREF(PyWinExc_ApiError); PyDict_SetItemString(dict, "error", PyWinExc_ApiError); PyDict_SetItemString(dict,"STD_INPUT_HANDLE", --- 6242,6280 ---- }; ! extern "C" __declspec(dllexport) ! #if (PY_VERSION_HEX < 0x03000000) ! void initwin32api(void) ! #else ! PyObject *PyInit_win32api(void) ! #endif { ! PyObject *dict, *module; ! PyWinGlobals_Ensure(); ! ! #if (PY_VERSION_HEX < 0x03000000) ! #define RETURN_ERROR return; ! module = Py_InitModule("win32api", win32api_functions); ! if (!module) ! return; ! dict = PyModule_GetDict(module); ! if (!dict) ! return; ! #else ! #define RETURN_ERROR return NULL; ! static PyModuleDef win32api_def = { ! PyModuleDef_HEAD_INIT, ! "win32api", ! "Wraps general API functions that are not subsumed in the more specific modules", ! -1, ! win32api_functions ! }; ! module = PyModule_Create(&win32api_def); ! if (!module) ! return NULL; ! dict = PyModule_GetDict(module); ! if (!dict) ! return NULL; ! #endif ! PyDict_SetItemString(dict, "error", PyWinExc_ApiError); PyDict_SetItemString(dict,"STD_INPUT_HANDLE", *************** *** 6208,6212 **** PyDict_SetItemString(dict,"STD_ERROR_HANDLE", PyInt_FromLong(STD_ERROR_HANDLE)); ! PyDict_SetItemString(dict, "PyDISPLAY_DEVICEType", (PyObject *)&PyDISPLAY_DEVICEType); PyModule_AddIntConstant(module, "NameUnknown", NameUnknown); PyModule_AddIntConstant(module, "NameFullyQualifiedDN", NameFullyQualifiedDN); --- 6284,6293 ---- PyDict_SetItemString(dict,"STD_ERROR_HANDLE", PyInt_FromLong(STD_ERROR_HANDLE)); ! ! if (PyType_Ready(&PyDISPLAY_DEVICEType) == -1 ! || PyDict_SetItemString(dict, "PyDISPLAY_DEVICEType", (PyObject *)&PyDISPLAY_DEVICEType) == -1) ! RETURN_ERROR; ! ! PyModule_AddIntConstant(module, "NameUnknown", NameUnknown); PyModule_AddIntConstant(module, "NameFullyQualifiedDN", NameFullyQualifiedDN); *************** *** 6313,6315 **** --- 6394,6399 ---- } + #if (PY_VERSION_HEX >= 0x03000000) + return module; + #endif } Index: win32evtlog.i =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32evtlog.i,v retrieving revision 1.6 retrieving revision 1.6.2.1 diff -C2 -d -r1.6 -r1.6.2.1 *** win32evtlog.i 15 Aug 2007 09:39:48 -0000 1.6 --- win32evtlog.i 29 Aug 2008 04:59:26 -0000 1.6.2.1 *************** *** 19,28 **** static void deallocFunc(PyObject *ob); ! ! static PyObject *getattr(PyObject *self, char *name); ! static int setattr(PyObject *self, char *name, PyObject *v); ! //#pragma warning( disable : 4251 ) ! static struct memberlist memberlist[]; ! //#pragma warning( default : 4251 ) protected: --- 19,23 ---- static void deallocFunc(PyObject *ob); ! static struct PyMemberDef members[]; protected: *************** *** 54,79 **** PyTypeObject PyEventLogRecordType = { ! PyObject_HEAD_INIT(&PyType_Type) ! 0, "PyEventLogRecord", sizeof(PyEventLogRecord), 0, PyEventLogRecord::deallocFunc, /* tp_dealloc */ ! 0, /* tp_print */ ! PyEventLogRecord::getattr, /* tp_getattr */ ! PyEventLogRecord::setattr, /* tp_setattr */ ! 0, /* tp_compare */ 0, /* tp_repr */ 0, /* tp_as_number */ ! 0, /* tp_as_sequence */ 0, /* tp_as_mapping */ ! 0, 0, /* tp_call */ ! 0, /* tp_str */ }; #define OFF(e) offsetof(PyEventLogRecord, e) ! /*static*/ struct memberlist PyEventLogRecord::memberlist[] = { {"Reserved", T_INT, OFF(Reserved)}, // @prop integer|Reserved| {"RecordNumber", T_INT, OFF(RecordNumber)}, // @prop integer|RecordNumber| --- 49,95 ---- PyTypeObject PyEventLogRecordType = { ! PYWIN_OBJECT_HEAD "PyEventLogRecord", sizeof(PyEventLogRecord), 0, PyEventLogRecord::deallocFunc, /* tp_dealloc */ ! 0, /* tp_print */ ! 0, /* tp_getattr */ ! 0, /* tp_setattr */ ! 0, /* tp_compare */ 0, /* tp_repr */ 0, /* tp_as_number */ ! 0, /* tp_as_sequence */ 0, /* tp_as_mapping */ ! 0, /* tp_hash */ 0, /* tp_call */ ! 0, /* tp_str */ ! PyObject_GenericGetAttr, /* tp_getattro */ ! PyObject_GenericSetAttr, /* tp_setattro */ ! 0, /*tp_as_buffer*/ ! Py_TPFLAGS_DEFAULT, /* tp_flags */ ! 0, /* tp_doc */ ! 0, /* tp_traverse */ ! 0, /* tp_clear */ ! 0, /* tp_richcompare */ ! 0, /* tp_weaklistoffset */ ! 0, /* tp_iter */ ! 0, /* tp_iternext */ ! 0, /* tp_methods */ ! PyEventLogRecord::members, /* tp_members */ ! 0, /* tp_getset */ ! 0, /* tp_base */ ! 0, /* tp_dict */ ! 0, /* tp_descr_get */ ! 0, /* tp_descr_set */ ! 0, /* tp_dictoffset */ ! 0, /* tp_init */ ! 0, /* tp_alloc */ ! 0, /* tp_new */ }; #define OFF(e) offsetof(PyEventLogRecord, e) ! /*static*/ struct PyMemberDef PyEventLogRecord::members[] = { {"Reserved", T_INT, OFF(Reserved)}, // @prop integer|Reserved| {"RecordNumber", T_INT, OFF(RecordNumber)}, // @prop integer|RecordNumber| *************** *** 154,171 **** } - PyObject *PyEventLogRecord::getattr(PyObject *self, char *name) - { - return PyMember_Get((char *)self, memberlist, name); - } - - int PyEventLogRecord::setattr(PyObject *self, char *name, PyObject *v) - { - if (v == NULL) { - PyErr_SetString(PyExc_AttributeError, "can't delete EventLogRecord attributes"); - return -1; - } - return PyMember_Set((char *)self, memberlist, name, v); - } - /*static*/ void PyEventLogRecord::deallocFunc(PyObject *ob) { --- 170,173 ---- Index: win32api_display.h =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32api_display.h,v retrieving revision 1.3 retrieving revision 1.3.2.1 diff -C2 -d -r1.3 -r1.3.2.1 *** win32api_display.h 6 Feb 2008 18:42:51 -0000 1.3 --- win32api_display.h 29 Aug 2008 04:59:26 -0000 1.3.2.1 *************** *** 43,55 **** { public: - #ifdef _MSC_VER - #pragma warning( disable : 4251 ) - #endif // _MSC_VER static struct PyMemberDef members[]; static struct PyMethodDef methods[]; - #ifdef _MSC_VER - #pragma warning( default : 4251 ) - #endif // _MSC_VER - static void deallocFunc(PyObject *ob); PyDISPLAY_DEVICE(PDISPLAY_DEVICE); --- 43,48 ---- Index: win32consolemodule.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32consolemodule.cpp,v retrieving revision 1.13 retrieving revision 1.13.2.1 diff -C2 -d -r1.13 -r1.13.2.1 *** win32consolemodule.cpp 25 Jul 2008 01:18:10 -0000 1.13 --- win32consolemodule.cpp 29 Aug 2008 04:59:26 -0000 1.13.2.1 *************** *** 149,154 **** static PyTypeObject PySMALL_RECTType = { ! PyObject_HEAD_INIT(&PyType_Type) ! 0, "PySMALL_RECT", sizeof(PySMALL_RECT), --- 149,153 ---- static PyTypeObject PySMALL_RECTType = { ! PYWIN_OBJECT_HEAD "PySMALL_RECT", sizeof(PySMALL_RECT), *************** *** 169,173 **** PyObject_GenericSetAttr, // tp_setattro 0, // tp_as_buffer; ! 0, // tp_flags; "Wrapper for a SMALL_RECT struct. Create using PySMALL_RECTType(Left, Top, Right, Bottom)", // tp_doc 0, // traverseproc tp_traverse; --- 168,172 ---- PyObject_GenericSetAttr, // tp_setattro 0, // tp_as_buffer; ! Py_TPFLAGS_DEFAULT, // tp_flags; "Wrapper for a SMALL_RECT struct. Create using PySMALL_RECTType(Left, Top, Right, Bottom)", // tp_doc 0, // traverseproc tp_traverse; *************** *** 212,216 **** --- 211,219 ---- return NULL; } + #if (PY_VERSION_HEX < 0x03000000) return PyString_FromStringAndSize(buf,chars_printed); + #else + return PyUnicode_FromString(buf); + #endif } *************** *** 299,304 **** static PyTypeObject PyCOORDType = { ! PyObject_HEAD_INIT(&PyType_Type) ! 0, "PyCOORD", sizeof(PyCOORD), --- 302,306 ---- static PyTypeObject PyCOORDType = { ! PYWIN_OBJECT_HEAD "PyCOORD", sizeof(PyCOORD), *************** *** 319,323 **** PyObject_GenericSetAttr, // tp_setattro 0, // tp_as_buffer; ! 0, // tp_flags; "Wrapper for a COORD struct. Create using PyCOORDType(X,Y)", // tp_doc 0, // traverseproc tp_traverse; --- 321,325 ---- PyObject_GenericSetAttr, // tp_setattro 0, // tp_as_buffer; ! Py_TPFLAGS_DEFAULT, // tp_flags; "Wrapper for a COORD struct. Create using PyCOORDType(X,Y)", // tp_doc 0, // traverseproc tp_traverse; *************** *** 361,365 **** --- 363,371 ---- return NULL; } + #if (PY_VERSION_HEX < 0x03000000) return PyString_FromStringAndSize(buf,chars_printed); + #else + return PyUnicode_FromString(buf); + #endif } *************** *** 486,490 **** { INPUT_RECORD *pir=&((PyINPUT_RECORD *)self)->input_record; ! char *name=PyString_AsString(obname); if (name==NULL) return NULL; --- 492,496 ---- { INPUT_RECORD *pir=&((PyINPUT_RECORD *)self)->input_record; ! char *name=PYWIN_ATTR_CONVERT(obname); if (name==NULL) return NULL; *************** *** 535,539 **** INPUT_RECORD *pir=&((PyINPUT_RECORD *)self)->input_record; char *name; ! name=PyString_AsString(obname); if (name==NULL) return -1; --- 541,545 ---- INPUT_RECORD *pir=&((PyINPUT_RECORD *)self)->input_record; char *name; ! name=PYWIN_ATTR_CONVERT(obname); if (name==NULL) return -1; *************** *** 555,558 **** --- 561,565 ---- return -1; } + #if (PY_VERSION_HEX < 0x02030000) *dest_ptr=PyLong_AsUnsignedLong(obvalue); *************** *** 608,613 **** static PyTypeObject PyINPUT_RECORDType = { ! PyObject_HEAD_INIT(&PyType_Type) ! 0, "PyINPUT_RECORD", sizeof(PyINPUT_RECORD), --- 615,619 ---- static PyTypeObject PyINPUT_RECORDType = { ! PYWIN_OBJECT_HEAD "PyINPUT_RECORD", sizeof(PyINPUT_RECORD), *************** *** 628,632 **** PyINPUT_RECORD::tp_setattro, // tp_setattro 0, // tp_as_buffer; ! 0, // tp_flags; "Wrapper for a INPUT_RECORD struct. Create using PyINPUT_RECORDType(EventType)", // tp_doc 0, // traverseproc tp_traverse; --- 634,638 ---- PyINPUT_RECORD::tp_setattro, // tp_setattro 0, // tp_as_buffer; ! Py_TPFLAGS_DEFAULT, // tp_flags; "Wrapper for a INPUT_RECORD struct. Create using PyINPUT_RECORDType(EventType)", // tp_doc 0, // traverseproc tp_traverse; *************** *** 749,753 **** --- 755,763 ---- return NULL; } + #if (PY_VERSION_HEX < 0x03000000) return PyString_FromStringAndSize(buf,chars_printed); + #else + return PyUnicode_FromString(buf); + #endif } *************** *** 1516,1521 **** PyTypeObject PyConsoleScreenBufferType = { ! PyObject_HEAD_INIT(&PyType_Type) ! 0, "PyConsoleScreenBuffer", sizeof(PyConsoleScreenBuffer), --- 1526,1530 ---- PyTypeObject PyConsoleScreenBufferType = { ! PYWIN_OBJECT_HEAD "PyConsoleScreenBuffer", sizeof(PyConsoleScreenBuffer), *************** *** 1536,1540 **** PyObject_GenericSetAttr, // tp_setattro 0, // tp_as_buffer ! 0, // tp_flags "Handle to a console screen buffer.\nCreate using CreateConsoleScreenBuffer or PyConsoleScreenBufferType(Handle)", // tp_doc 0, // tp_traverse --- 1545,1549 ---- PyObject_GenericSetAttr, // tp_setattro 0, // tp_as_buffer ! Py_TPFLAGS_DEFAULT, // tp_flags "Handle to a console screen buffer.\nCreate using CreateConsoleScreenBuffer or PyConsoleScreenBufferType(Handle)", // tp_doc 0, // tp_traverse *************** *** 2056,2065 **** ! extern "C" __declspec(dllexport) void ! initwin32console(void) { ! PyObject *dict, *mod; PyWinGlobals_Ensure(); ! mod = Py_InitModule("win32console", win32console_functions); // load function pointers --- 2065,2106 ---- ! extern "C" __declspec(dllexport) ! #if (PY_VERSION_HEX < 0x03000000) ! void initwin32console(void) ! #else ! PyObject *PyInit_win32console(void) ! #endif { ! PyObject *dict, *module; PyWinGlobals_Ensure(); ! ! #if (PY_VERSION_HEX < 0x03000000) ! #define RETURN_ERROR return; ! module = Py_InitModule("win32console", win32console_functions); ! if (!module) ! return; ! dict = PyModule_GetDict(module); ! if (!dict) ! return; ! #else ! ! #define RETURN_ERROR return NULL; ! static PyModuleDef win32console_def = { ! PyModuleDef_HEAD_INIT, ! "win32console", ! "Interface to the Windows Console functions for dealing with character-mode applications.", ! -1, ! win32console_functions ! }; ! module = PyModule_Create(&win32console_def); ! if (!module) ! return NULL; ! dict = PyModule_GetDict(module); ! if (!dict) ! return NULL; ! #endif ! ! Py_INCREF(PyWinExc_ApiError); ! PyDict_SetItemString(dict, "error", PyWinExc_ApiError); // load function pointers *************** *** 2085,2153 **** } - dict = PyModule_GetDict(mod); - Py_INCREF(PyWinExc_ApiError); - PyDict_SetItemString(dict, "error", PyWinExc_ApiError); - PyDict_SetItemString(dict, "PyConsoleScreenBufferType", (PyObject *)&PyConsoleScreenBufferType); - PyDict_SetItemString(dict, "PySMALL_RECTType", (PyObject *)&PySMALL_RECTType); - PyDict_SetItemString(dict, "PyCOORDType", (PyObject *)&PyCOORDType); - PyDict_SetItemString(dict, "PyINPUT_RECORDType", (PyObject *)&PyINPUT_RECORDType); - PyModule_AddIntConstant(mod, "CONSOLE_TEXTMODE_BUFFER", CONSOLE_TEXTMODE_BUFFER); - PyModule_AddIntConstant(mod, "CONSOLE_FULLSCREEN", CONSOLE_FULLSCREEN); - PyModule_AddIntConstant(mod, "CONSOLE_FULLSCREEN_HARDWARE", CONSOLE_FULLSCREEN_HARDWARE); - PyModule_AddIntConstant(mod, "ATTACH_PARENT_PROCESS", ATTACH_PARENT_PROCESS); ! PyModule_AddIntConstant(mod, "ENABLE_LINE_INPUT", ENABLE_LINE_INPUT); ! PyModule_AddIntConstant(mod, "ENABLE_ECHO_INPUT", ENABLE_ECHO_INPUT); ! PyModule_AddIntConstant(mod, "ENABLE_PROCESSED_INPUT", ENABLE_PROCESSED_INPUT); ! PyModule_AddIntConstant(mod, "ENABLE_WINDOW_INPUT", ENABLE_WINDOW_INPUT); ! PyModule_AddIntConstant(mod, "ENABLE_MOUSE_INPUT", ENABLE_MOUSE_INPUT); ! PyModule_AddIntConstant(mod, "ENABLE_PROCESSED_OUTPUT", ENABLE_PROCESSED_OUTPUT); ! PyModule_AddIntConstant(mod, "ENABLE_WRAP_AT_EOL_OUTPUT", ENABLE_WRAP_AT_EOL_OUTPUT); // text attribute flags - ?????? COMMON_* flags don't seem to do anything ?????? ! PyModule_AddIntConstant(mod, "FOREGROUND_BLUE", FOREGROUND_BLUE); ! PyModule_AddIntConstant(mod, "FOREGROUND_GREEN", FOREGROUND_GREEN); ! PyModule_AddIntConstant(mod, "FOREGROUND_RED", FOREGROUND_RED); ! PyModule_AddIntConstant(mod, "FOREGROUND_INTENSITY", FOREGROUND_INTENSITY); ! PyModule_AddIntConstant(mod, "BACKGROUND_BLUE", BACKGROUND_BLUE); ! PyModule_AddIntConstant(mod, "BACKGROUND_GREEN", BACKGROUND_GREEN); ! PyModule_AddIntConstant(mod, "BACKGROUND_RED", BACKGROUND_RED); ! PyModule_AddIntConstant(mod, "BACKGROUND_INTENSITY", BACKGROUND_INTENSITY); ! PyModule_AddIntConstant(mod, "COMMON_LVB_LEADING_BYTE", COMMON_LVB_LEADING_BYTE); ! PyModule_AddIntConstant(mod, "COMMON_LVB_TRAILING_BYTE", COMMON_LVB_TRAILING_BYTE); ! PyModule_AddIntConstant(mod, "COMMON_LVB_GRID_HORIZONTAL", COMMON_LVB_GRID_HORIZONTAL); ! PyModule_AddIntConstant(mod, "COMMON_LVB_GRID_LVERTICAL", COMMON_LVB_GRID_LVERTICAL); ! PyModule_AddIntConstant(mod, "COMMON_LVB_GRID_RVERTICAL", COMMON_LVB_GRID_RVERTICAL); ! PyModule_AddIntConstant(mod, "COMMON_LVB_REVERSE_VIDEO", COMMON_LVB_REVERSE_VIDEO); ! PyModule_AddIntConstant(mod, "COMMON_LVB_UNDERSCORE", COMMON_LVB_UNDERSCORE); // selection flags for GetConsoleSelectionInfo ! PyModule_AddIntConstant(mod, "CONSOLE_NO_SELECTION", CONSOLE_NO_SELECTION); ! PyModule_AddIntConstant(mod, "CONSOLE_SELECTION_IN_PROGRESS", CONSOLE_SELECTION_IN_PROGRESS); ! PyModule_AddIntConstant(mod, "CONSOLE_SELECTION_NOT_EMPTY", CONSOLE_SELECTION_NOT_EMPTY); ! PyModule_AddIntConstant(mod, "CONSOLE_MOUSE_SELECTION", CONSOLE_MOUSE_SELECTION); ! PyModule_AddIntConstant(mod, "CONSOLE_MOUSE_DOWN", CONSOLE_MOUSE_DOWN); ! PyModule_AddIntConstant(mod, "LOCALE_USER_DEFAULT", LOCALE_USER_DEFAULT); // event types for INPUT_RECORD ! PyModule_AddIntConstant(mod, "KEY_EVENT", KEY_EVENT); ! PyModule_AddIntConstant(mod, "MOUSE_EVENT", MOUSE_EVENT); ! PyModule_AddIntConstant(mod, "WINDOW_BUFFER_SIZE_EVENT", WINDOW_BUFFER_SIZE_EVENT); ! PyModule_AddIntConstant(mod, "MENU_EVENT", MENU_EVENT); ! PyModule_AddIntConstant(mod, "FOCUS_EVENT", FOCUS_EVENT); // Control events for GenerateConsoleCtrlEvent ! PyModule_AddIntConstant(mod, "CTRL_C_EVENT", CTRL_C_EVENT); ! PyModule_AddIntConstant(mod, "CTRL_BREAK_EVENT", CTRL_BREAK_EVENT); // std handles ! PyModule_AddIntConstant(mod, "STD_INPUT_HANDLE", STD_INPUT_HANDLE); ! PyModule_AddIntConstant(mod, "STD_OUTPUT_HANDLE", STD_OUTPUT_HANDLE); ! PyModule_AddIntConstant(mod, "STD_ERROR_HANDLE", STD_ERROR_HANDLE); // flags used with SetConsoleDisplayMode // ?????? these aren't in my SDK headers ! PyModule_AddIntConstant(mod, "CONSOLE_FULLSCREEN_MODE", 1); ! PyModule_AddIntConstant(mod, "CONSOLE_WINDOWED_MODE", 2); } --- 2126,2212 ---- } ! if (PyType_Ready(&PyConsoleScreenBufferType)==-1) ! RETURN_ERROR; ! if (PyDict_SetItemString(dict, "PyConsoleScreenBufferType", (PyObject *)&PyConsoleScreenBufferType) == -1) ! RETURN_ERROR; ! ! if (PyType_Ready(&PySMALL_RECTType)==-1) ! RETURN_ERROR; ! if (PyDict_SetItemString(dict, "PySMALL_RECTType", (PyObject *)&PySMALL_RECTType) == -1) ! RETURN_ERROR; ! ! if (PyType_Ready(&PyCOORDType)==-1) ! RETURN_ERROR; ! if (PyDict_SetItemString(dict, "PyCOORDType", (PyObject *)&PyCOORDType) == -1) ! RETURN_ERROR; ! ! if (PyType_Ready(&PyINPUT_RECORDType)==-1) ! RETURN_ERROR; ! if (PyDict_SetItemString(dict, "PyINPUT_RECORDType", (PyObject *)&PyINPUT_RECORDType) == -1) ! RETURN_ERROR; ! ! PyModule_AddIntConstant(module, "CONSOLE_TEXTMODE_BUFFER", CONSOLE_TEXTMODE_BUFFER); ! PyModule_AddIntConstant(module, "CONSOLE_FULLSCREEN", CONSOLE_FULLSCREEN); ! PyModule_AddIntConstant(module, "CONSOLE_FULLSCREEN_HARDWARE", CONSOLE_FULLSCREEN_HARDWARE); ! PyModule_AddIntConstant(module, "ATTACH_PARENT_PROCESS", ATTACH_PARENT_PROCESS); ! ! PyModule_AddIntConstant(module, "ENABLE_LINE_INPUT", ENABLE_LINE_INPUT); ! PyModule_AddIntConstant(module, "ENABLE_ECHO_INPUT", ENABLE_ECHO_INPUT); ! PyModule_AddIntConstant(module, "ENABLE_PROCESSED_INPUT", ENABLE_PROCESSED_INPUT); ! PyModule_AddIntConstant(module, "ENABLE_WINDOW_INPUT", ENABLE_WINDOW_INPUT); ! PyModule_AddIntConstant(module, "ENABLE_MOUSE_INPUT", ENABLE_MOUSE_INPUT); ! PyModule_AddIntConstant(module, "ENABLE_PROCESSED_OUTPUT", ENABLE_PROCESSED_OUTPUT); ! PyModule_AddIntConstant(module, "ENABLE_WRAP_AT_EOL_OUTPUT", ENABLE_WRAP_AT_EOL_OUTPUT); // text attribute flags - ?????? COMMON_* flags don't seem to do anything ?????? ! PyModule_AddIntConstant(module, "FOREGROUND_BLUE", FOREGROUND_BLUE); ! PyModule_AddIntConstant(module, "FOREGROUND_GREEN", FOREGROUND_GREEN); ! PyModule_AddIntConstant(module, "FOREGROUND_RED", FOREGROUND_RED); ! PyModule_AddIntConstant(module, "FOREGROUND_INTENSITY", FOREGROUND_INTENSITY); ! PyModule_AddIntConstant(module, "BACKGROUND_BLUE", BACKGROUND_BLUE); ! PyModule_AddIntConstant(module, "BACKGROUND_GREEN", BACKGROUND_GREEN); ! PyModule_AddIntConstant(module, "BACKGROUND_RED", BACKGROUND_RED); ! PyModule_AddIntConstant(module, "BACKGROUND_INTENSITY", BACKGROUND_INTENSITY); ! PyModule_AddIntConstant(module, "COMMON_LVB_LEADING_BYTE", COMMON_LVB_LEADING_BYTE); ! PyModule_AddIntConstant(module, "COMMON_LVB_TRAILING_BYTE", COMMON_LVB_TRAILING_BYTE); ! PyModule_AddIntConstant(module, "COMMON_LVB_GRID_HORIZONTAL", COMMON_LVB_GRID_HORIZONTAL); ! PyModule_AddIntConstant(module, "COMMON_LVB_GRID_LVERTICAL", COMMON_LVB_GRID_LVERTICAL); ! PyModule_AddIntConstant(module, "COMMON_LVB_GRID_RVERTICAL", COMMON_LVB_GRID_RVERTICAL); ! PyModule_AddIntConstant(module, "COMMON_LVB_REVERSE_VIDEO", COMMON_LVB_REVERSE_VIDEO); ! PyModule_AddIntConstant(module, "COMMON_LVB_UNDERSCORE", COMMON_LVB_UNDERSCORE); // selection flags for GetConsoleSelectionInfo ! PyModule_AddIntConstant(module, "CONSOLE_NO_SELECTION", CONSOLE_NO_SELECTION); ! PyModule_AddIntConstant(module, "CONSOLE_SELECTION_IN_PROGRESS", CONSOLE_SELECTION_IN_PROGRESS); ! PyModule_AddIntConstant(module, "CONSOLE_SELECTION_NOT_EMPTY", CONSOLE_SELECTION_NOT_EMPTY); ! PyModule_AddIntConstant(module, "CONSOLE_MOUSE_SELECTION", CONSOLE_MOUSE_SELECTION); ! PyModule_AddIntConstant(module, "CONSOLE_MOUSE_DOWN", CONSOLE_MOUSE_DOWN); ! PyModule_AddIntConstant(module, "LOCALE_USER_DEFAULT", LOCALE_USER_DEFAULT); // event types for INPUT_RECORD ! PyModule_AddIntConstant(module, "KEY_EVENT", KEY_EVENT); ! PyModule_AddIntConstant(module, "MOUSE_EVENT", MOUSE_EVENT); ! PyModule_AddIntConstant(module, "WINDOW_BUFFER_SIZE_EVENT", WINDOW_BUFFER_SIZE_EVENT); ! PyModule_AddIntConstant(module, "MENU_EVENT", MENU_EVENT); ! PyModule_AddIntConstant(module, "FOCUS_EVENT", FOCUS_EVENT); // Control events for GenerateConsoleCtrlEvent ! PyModule_AddIntConstant(module, "CTRL_C_EVENT", CTRL_C_EVENT); ! PyModule_AddIntConstant(module, "CTRL_BREAK_EVENT", CTRL_BREAK_EVENT); // std handles ! PyModule_AddIntConstant(module, "STD_INPUT_HANDLE", STD_INPUT_HANDLE); ! PyModule_AddIntConstant(module, "STD_OUTPUT_HANDLE", STD_OUTPUT_HANDLE); ! PyModule_AddIntConstant(module, "STD_ERROR_HANDLE", STD_ERROR_HANDLE); // flags used with SetConsoleDisplayMode // ?????? these aren't in my SDK headers ! PyModule_AddIntConstant(module, "CONSOLE_FULLSCREEN_MODE", 1); ! PyModule_AddIntConstant(module, "CONSOLE_WINDOWED_MODE", 2); ! ! #if (PY_VERSION_HEX >= 0x03000000) ! return module; ! #endif } Index: win32transactionmodule.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32transactionmodule.cpp,v retrieving revision 1.3 retrieving revision 1.3.2.1 diff -C2 -d -r1.3 -r1.3.2.1 *** win32transactionmodule.cpp 3 Jun 2007 14:53:07 -0000 1.3 --- win32transactionmodule.cpp 29 Aug 2008 04:59:28 -0000 1.3.2.1 *************** *** 244,253 **** }; ! extern "C" __declspec(dllexport) void ! initwin32transaction(void) { ! PyObject *dict, *mod; PyWinGlobals_Ensure(); ! mod = Py_InitModule("win32transaction", win32transaction_functions); // Load dll and function pointers to avoid dependency on newer libraries and headers --- 244,281 ---- }; ! extern "C" __declspec(dllexport) ! #if (PY_VERSION_HEX < 0x03000000) ! void initwin32transaction(void) ! #else ! PyObject *PyInit_win32transaction(void) ! #endif { ! PyObject *dict, *module; PyWinGlobals_Ensure(); ! ! #if (PY_VERSION_HEX < 0x03000000) ! module = Py_InitModule("win32transaction", win32transaction_functions); ! if (!module) ! return; ! dict = PyModule_GetDict(module); ! if (!dict) ! return; ! ! #else ! static PyModuleDef win32transaction_def = { ! PyModuleDef_HEAD_INIT, ! "win32transaction", ! "Module wrapping Kernal Transaction Manager functions, as used with" ! " transacted NTFS and transacted registry functions.", ! -1, ! win32transaction_functions ! }; ! module = PyModule_Create(&win32transaction_def); ! if (!module) ! return NULL; ! dict = PyModule_GetDict(module); ! if (!dict) ! return NULL; ! #endif // Load dll and function pointers to avoid dependency on newer libraries and headers *************** *** 273,279 **** } - dict = PyModule_GetDict(mod); Py_INCREF(PyWinExc_ApiError); PyDict_SetItemString(dict, "error", PyWinExc_ApiError); } --- 301,309 ---- } Py_INCREF(PyWinExc_ApiError); PyDict_SetItemString(dict, "error", PyWinExc_ApiError); + #if (PY_VERSION_HEX >= 0x03000000) + return module; + #endif } Index: win32profilemodule.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32profilemodule.cpp,v retrieving revision 1.3 retrieving revision 1.3.2.1 diff -C2 -d -r1.3 -r1.3.2.1 *** win32profilemodule.cpp 15 Aug 2007 08:04:37 -0000 1.3 --- win32profilemodule.cpp 29 Aug 2008 04:59:27 -0000 1.3.2.1 *************** *** 463,478 **** ! ! extern "C" __declspec(dllexport) void ! initwin32profile(void) { PyObject *dict, *module; PyWinGlobals_Ensure(); module = Py_InitModule("win32profile", win32profile_functions); ! if (module==NULL) return; dict = PyModule_GetDict(module); ! if (dict==NULL) return; // PROFILEINFO flags --- 463,498 ---- ! extern "C" __declspec(dllexport) ! #if (PY_VERSION_HEX < 0x03000000) ! void initwin32profile(void) ! #else ! PyObject *PyInit_win32profile(void) ! #endif { PyObject *dict, *module; PyWinGlobals_Ensure(); + + #if (PY_VERSION_HEX < 0x03000000) module = Py_InitModule("win32profile", win32profile_functions); ! if (!module) return; dict = PyModule_GetDict(module); ! if (!dict) return; + #else + static PyModuleDef win32profile_def = { + PyModuleDef_HEAD_INIT, + "win32profile", + "Interface to the Terminal Services Api.", + -1, + win32profile_functions + }; + module = PyModule_Create(&win32profile_def); + if (!module) + return NULL; + dict = PyModule_GetDict(module); + if (!dict) + return NULL; + #endif // PROFILEINFO flags *************** *** 500,503 **** pfnUnloadUserProfile=(UnloadUserProfilefunc)GetProcAddress(hmodule,"UnloadUserProfile"); } } - --- 520,526 ---- pfnUnloadUserProfile=(UnloadUserProfilefunc)GetProcAddress(hmodule,"UnloadUserProfile"); } + + #if (PY_VERSION_HEX >= 0x03000000) + return module; + #endif } Index: win32security.i =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32security.i,v retrieving revision 1.47 retrieving revision 1.47.2.1 diff -C2 -d -r1.47 -r1.47.2.1 *** win32security.i 29 Nov 2007 06:46:12 -0000 1.47 --- win32security.i 29 Aug 2008 04:59:28 -0000 1.47.2.1 *************** *** 830,834 **** pfnDsFreeNameResult=(DsFreeNameResultfunc)loadapifunc("DsFreeNameResultW", ntdsapi_dll); pfnDsGetDcName=(DsGetDcNamefunc)loadapifunc("DsGetDcNameW", netapi32_dll); ! // old names, these should not be used PyDict_SetItemString(d, "SecBufferType", (PyObject *)&PySecBufferType); --- 830,846 ---- pfnDsFreeNameResult=(DsFreeNameResultfunc)loadapifunc("DsFreeNameResultW", ntdsapi_dll); pfnDsGetDcName=(DsGetDcNamefunc)loadapifunc("DsGetDcNameW", netapi32_dll); ! ! // Py3k requires that *all* types have to be initialized ! #if (PY_VERSION_HEX >= 0x03000000) ! if (PyType_Ready(&PySecBufferType) == -1) ! return NULL; ! if (PyType_Ready(&PySecBufferDescType) == -1) ! return NULL; ! if (PyType_Ready(&PyCtxtHandleType) == -1) ! return NULL; ! if (PyType_Ready(&PyCredHandleType) == -1) ! return NULL; ! #endif ! // old names, these should not be used PyDict_SetItemString(d, "SecBufferType", (PyObject *)&PySecBufferType); Index: win32pipe.i =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32pipe.i,v retrieving revision 1.18 retrieving revision 1.18.2.1 diff -C2 -d -r1.18 -r1.18.2.1 *** win32pipe.i 7 Jun 2008 07:23:54 -0000 1.18 --- win32pipe.i 29 Aug 2008 04:59:27 -0000 1.18.2.1 *************** *** 20,126 **** static GetNamedPipeClientProcessIdfunc pfnGetNamedPipeClientSessionId = NULL; static GetNamedPipeClientProcessIdfunc pfnGetNamedPipeServerSessionId = NULL; - - - // Global used to determine if Win9x win32pipe hack is necessary. - bool g_fUsingWin9x; - CHAR g_szModulePath[_MAX_PATH + 2]; - HINSTANCE g_hInstance = NULL; - - ///////////////////////////////////////////////////////////////////////////// - // DLL Entry Point - - #ifndef BUILD_FREEZE - // Doesnt work for freeze - but in that case, g_hInstance - // remaims NULL, so GetModuleFileName(NULL) will be used - // and still give the answer we are after. - extern "C" - BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID /*lpReserved*/) - { - if (dwReason == DLL_PROCESS_ATTACH) - g_hInstance = hInstance; - return TRUE; - } - #endif // BUILD_FREEZE - - static BOOL LoadModulePath(void) - { - DWORD cbModuleFilename; - CHAR *psz = NULL; - - // Note: GetModuleFileName will write nSize + 1 characters - // to get the null terminator. - cbModuleFilename = GetModuleFileName( - g_hInstance, - g_szModulePath, - sizeof(g_szModulePath) - 1); - if (0 == cbModuleFilename) - { - // hr = HRESULT_FROM_WIN32(GetLastError()); - // ErrorTrace(hr); - return FALSE; - } - - if ((sizeof(g_szModulePath) - 1) == cbModuleFilename) - { - // Note: This should never happen - // hr = HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER); - // ErrorTrace(hr); - return FALSE; - } - - // Start from the end of the string and insert a '\0' after the first '\\' you find. - psz = g_szModulePath + strlen(g_szModulePath) - 1; - while (psz > g_szModulePath && *psz != '\\') - { - psz--; - } - - if (*psz == '\\') - { - psz++; - *psz = '\0'; - } - else - { - // Something wierd happened. :( - return FALSE; - } - return TRUE; - } - - %} %init %{ // All errors raised by this module are of this type. - Py_INCREF(PyWinExc_ApiError); PyDict_SetItemString(d, "error", PyWinExc_ApiError); ! // Setup g_fUsingWin9x and module path correctly... ! { ! LoadModulePath(); ! ! OSVERSIONINFO osvi; ! ! memset(&osvi, 0, sizeof(osvi)); ! osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); ! ! if (!GetVersionEx(&osvi)) ! { ! PyWin_SetAPIError("GetVersionEx"); ! } ! ! if (osvi.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS) ! { ! g_fUsingWin9x = TRUE; ! } ! else ! { ! g_fUsingWin9x = FALSE; ! } ! } ! HMODULE hmod=GetModuleHandle("Kernel32.dll"); if (!hmod) ! hmod=LoadLibrary("Kernel32.dll"); if (hmod){ pfnGetNamedPipeClientProcessId = (GetNamedPipeClientProcessIdfunc)GetProcAddress(hmod, "GetNamedPipeClientProcessId"); --- 20,32 ---- static GetNamedPipeClientProcessIdfunc pfnGetNamedPipeClientSessionId = NULL; static GetNamedPipeClientProcessIdfunc pfnGetNamedPipeServerSessionId = NULL; %} %init %{ // All errors raised by this module are of this type. PyDict_SetItemString(d, "error", PyWinExc_ApiError); ! HMODULE hmod=GetModuleHandle(_T("Kernel32.dll")); if (!hmod) ! hmod=LoadLibrary(_T("Kernel32.dll")); if (hmod){ pfnGetNamedPipeClientProcessId = (GetNamedPipeClientProcessIdfunc)GetProcAddress(hmod, "GetNamedPipeClientProcessId"); *************** *** 131,153 **** %} - %{ - extern PyObject *PyPopen(PyObject *self, PyObject *args); - extern PyObject *PyPopen2(PyObject *self, PyObject *args); - extern PyObject *PyPopen3(PyObject *self, PyObject *args); - extern PyObject *PyPopen4(PyObject *self, PyObject *args); - - %} - // @pymeth popen|Version of popen that works in a GUI - %native(popen) PyPopen; - - // @pymeth popen2|Variation on popen - returns 2 pipes - %native(popen2) Py... [truncated message content] |
From: Roger U. <ru...@us...> - 2008-08-29 04:59:19
|
Update of /cvsroot/pywin32/pywin32/win32/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15490/test Modified Files: Tag: py3k test_clipboard.py test_win32api.py test_win32file.py Log Message: Changes to build for Python 3.0 Index: test_win32file.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/test/test_win32file.py,v retrieving revision 1.13 retrieving revision 1.13.2.1 diff -C2 -d -r1.13 -r1.13.2.1 *** test_win32file.py 28 May 2008 04:32:22 -0000 1.13 --- test_win32file.py 29 Aug 2008 04:59:28 -0000 1.13.2.1 *************** *** 5,9 **** import os import tempfile - import sets import threading import time --- 5,8 ---- *************** *** 20,24 **** os.unlink(filename) handle = win32file.CreateFile(filename, win32file.GENERIC_WRITE, 0, None, win32con.CREATE_NEW, 0, None) ! test_data = "Hello\0there" try: win32file.WriteFile(handle, test_data) --- 19,23 ---- os.unlink(filename) handle = win32file.CreateFile(filename, win32file.GENERIC_WRITE, 0, None, win32con.CREATE_NEW, 0, None) ! test_data = b"Hello\0there" try: win32file.WriteFile(handle, test_data) *************** *** 45,49 **** # Write a known number of bytes to the file. ! data = "z" * 1025 win32file.WriteFile(h, data) --- 44,48 ---- # Write a known number of bytes to the file. ! data = b"z" * 1025 win32file.WriteFile(h, data) *************** *** 59,70 **** # Now truncate the file at 1/2 its existing size. ! newSize = len(data)/2 win32file.SetFilePointer(h, newSize, win32file.FILE_BEGIN) win32file.SetEndOfFile(h) ! self.failUnless(win32file.GetFileSize(h) == newSize, "Truncated file does not have the expected size!") # GetFileAttributesEx/GetFileAttributesExW tests. ! self.failUnless(win32file.GetFileAttributesEx(testName) == win32file.GetFileAttributesExW(testName), ! "ERROR: Expected GetFileAttributesEx and GetFileAttributesExW to return the same data") attr, ct, at, wt, size = win32file.GetFileAttributesEx(testName) --- 58,71 ---- # Now truncate the file at 1/2 its existing size. ! newSize = len(data)//2 win32file.SetFilePointer(h, newSize, win32file.FILE_BEGIN) win32file.SetEndOfFile(h) ! self.failUnless(win32file.GetFileSize(h) == newSize, ! "Truncated file does not have the expected size! (%s)" %newSize) # GetFileAttributesEx/GetFileAttributesExW tests. ! print (win32file.GetFileAttributesEx(testName), win32file.GetFileAttributesExW(testName)) ! self.failUnlessEqual(win32file.GetFileAttributesEx(testName), win32file.GetFileAttributesExW(testName)) ! ## "ERROR: Expected GetFileAttributesEx and GetFileAttributesExW to return the same data") attr, ct, at, wt, size = win32file.GetFileAttributesEx(testName) *************** *** 93,97 **** try: #Write some data ! data = 'Some data' (res, written) = win32file.WriteFile(f, data) --- 94,98 ---- try: #Write some data ! data = b'Some data' (res, written) = win32file.WriteFile(f, data) *************** *** 127,131 **** # Create the file and write shit-loads of data to it. h = win32file.CreateFile( testName, desiredAccess, 0, None, win32file.CREATE_ALWAYS, 0, 0) ! chunk_data = "z" * 0x8000 num_loops = 512 expected_size = num_loops * len(chunk_data) --- 128,132 ---- # Create the file and write shit-loads of data to it. h = win32file.CreateFile( testName, desiredAccess, 0, None, win32file.CREATE_ALWAYS, 0, 0) ! chunk_data = b"z" * 0x8000 num_loops = 512 expected_size = num_loops * len(chunk_data) *************** *** 175,180 **** try: win32file.CloseHandle(hv) ! raise RuntimeError, "Expected close to fail!" ! except win32file.error, (hr, func, msg): self.failUnlessEqual(hr, winerror.ERROR_INVALID_HANDLE) --- 176,182 ---- try: win32file.CloseHandle(hv) ! raise RuntimeError("Expected close to fail!") ! except win32file.error as details: ! hr, func, msg = details.args self.failUnlessEqual(hr, winerror.ERROR_INVALID_HANDLE) *************** *** 235,239 **** time.sleep(0.1) # let thread do its thing. try: ! win32pipe.CallNamedPipe(r"\\.\pipe\pywin32_test_pipe", "Hello there", BUFSIZE, 0) except win32pipe.error: # Testing for overlapped death causes this --- 237,241 ---- time.sleep(0.1) # let thread do its thing. try: ! win32pipe.CallNamedPipe(r"\\.\pipe\pywin32_test_pipe", b"Hello there", BUFSIZE, 0) except win32pipe.error: # Testing for overlapped death causes this *************** *** 292,299 **** t.start() running.wait(2) ! if not running.isSet(): self.fail("AcceptEx Worker thread failed to start") s = socket.create_connection(('127.0.0.1', port), 10) ! win32file.WSASend(s, "hello", None) overlapped = pywintypes.OVERLAPPED() overlapped.hEvent = win32event.CreateEvent(None, 0, 0, None) --- 294,301 ---- t.start() running.wait(2) ! if not running.is_set(): self.fail("AcceptEx Worker thread failed to start") s = socket.create_connection(('127.0.0.1', port), 10) ! win32file.WSASend(s, b"hello", None) overlapped = pywintypes.OVERLAPPED() overlapped.hEvent = win32event.CreateEvent(None, 0, 0, None) *************** *** 306,310 **** nbytes = win32file.GetOverlappedResult(s.fileno(), overlapped, True) got = buffer[:nbytes] ! self.failUnlessEqual(got, "hello") # thread should have stopped stopped.wait(2) --- 308,312 ---- nbytes = win32file.GetOverlappedResult(s.fileno(), overlapped, True) got = buffer[:nbytes] ! self.failUnlessEqual(got, b"hello") # thread should have stopped stopped.wait(2) *************** *** 316,322 **** dir = os.path.join(os.getcwd(), "*") files = win32file.FindFilesW(dir) ! set1 = sets.Set() set1.update(files) ! set2 = sets.Set() for file in win32file.FindFilesIterator(dir): set2.add(file) --- 318,324 ---- dir = os.path.join(os.getcwd(), "*") files = win32file.FindFilesW(dir) ! set1 = set() set1.update(files) ! set2 = set() for file in win32file.FindFilesIterator(dir): set2.add(file) *************** *** 395,406 **** while 1: try: ! print "waiting", dh changes = win32file.ReadDirectoryChangesW(dh, 8192, False, #sub-tree flags) ! print "got", changes ! except 'xx': ! xx changes.extend(changes) --- 397,408 ---- while 1: try: ! print ("waiting", dh) changes = win32file.ReadDirectoryChangesW(dh, 8192, False, #sub-tree flags) ! print ("got", changes) ! except: ! traceback.print_exc() changes.extend(changes) *************** *** 433,437 **** return else: ! print "ERROR: Watcher thread timed-out!" return # kill the thread! --- 435,439 ---- return else: ! print ("ERROR: Watcher thread timed-out!") return # kill the thread! *************** *** 447,457 **** shutil.rmtree(dn) except OSError: ! print "FAILED to remove directory", dn for t in self.watcher_threads: # closing dir handle should have killed threads! t.join(5) ! if t.isAlive(): ! print "FAILED to wait for thread termination" def stablize(self): --- 449,459 ---- shutil.rmtree(dn) except OSError: ! print ("FAILED to remove directory", dn) for t in self.watcher_threads: # closing dir handle should have killed threads! t.join(5) ! if t.is_alive(): ! print ("FAILED to wait for thread termination") def stablize(self): *************** *** 482,486 **** fname = tempfile.mktemp("win32file_test") f = open(fname, "wb") ! f.write("hello") f.close() f = None --- 484,488 ---- fname = tempfile.mktemp("win32file_test") f = open(fname, "wb") ! f.write(b"hello") f.close() f = None *************** *** 488,495 **** try: win32file.EncryptFile(fname) ! except win32file.error, details: ! if details[0] != winerror.ERROR_ACCESS_DENIED: raise ! print "It appears this is not NTFS - cant encrypt/decrypt" win32file.DecryptFile(fname) finally: --- 490,497 ---- try: win32file.EncryptFile(fname) ! except win32file.error as details: ! if details.args[0] != winerror.ERROR_ACCESS_DENIED: raise ! print ("It appears this is not NTFS - cant encrypt/decrypt") win32file.DecryptFile(fname) finally: Index: test_clipboard.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/test/test_clipboard.py,v retrieving revision 1.6 retrieving revision 1.6.2.1 diff -C2 -d -r1.6 -r1.6.2.1 *** test_clipboard.py 1 Jun 2007 13:36:53 -0000 1.6 --- test_clipboard.py 29 Aug 2008 04:59:28 -0000 1.6.2.1 *************** *** 78,82 **** CloseClipboard() def test_mem(self): ! val = "test" SetClipboardData(win32con.CF_TEXT, val) # Get the raw data - this will include the '\0' --- 78,82 ---- CloseClipboard() def test_mem(self): ! val = b"test" SetClipboardData(win32con.CF_TEXT, val) # Get the raw data - this will include the '\0' *************** *** 85,89 **** def test_bad_mem(self): if sys.getwindowsversion()[0] > 5: ! print "skipping test_bad_mem - fails on Vista (x64 at least - not sure about x32...)" return self.failUnlessRaises(pywintypes.error, GetGlobalMemory, 0) --- 85,89 ---- def test_bad_mem(self): if sys.getwindowsversion()[0] > 5: ! print ("skipping test_bad_mem - fails on Vista (x64 at least - not sure about x32...)") return self.failUnlessRaises(pywintypes.error, GetGlobalMemory, 0) *************** *** 91,96 **** self.failUnlessRaises(pywintypes.error, GetGlobalMemory, -1) def test_custom_mem(self): ! test_data = "hello\x00\xff" ! test_buffer = array.array("c", test_data) cf = RegisterClipboardFormat(custom_format_name) self.failUnlessEqual(custom_format_name, GetClipboardFormatName(cf)) --- 91,96 ---- self.failUnlessRaises(pywintypes.error, GetGlobalMemory, -1) def test_custom_mem(self): ! test_data = b"hello\x00\xff" ! test_buffer = array.array("b", test_data) cf = RegisterClipboardFormat(custom_format_name) self.failUnlessEqual(custom_format_name, GetClipboardFormatName(cf)) Index: test_win32api.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/test/test_win32api.py,v retrieving revision 1.13 retrieving revision 1.13.2.1 diff -C2 -d -r1.13 -r1.13.2.1 *** test_win32api.py 4 Jan 2008 04:53:29 -0000 1.13 --- test_win32api.py 29 Aug 2008 04:59:28 -0000 1.13.2.1 *************** *** 67,71 **** ('REG_MULTI_SZ', win32con.REG_MULTI_SZ, ['string 1','string 2','string 3','string 4']), ('REG_DWORD', win32con.REG_DWORD, 666), ! ('REG_BINARY', win32con.REG_BINARY, '\x00\x01\x02\x03\x04\x05\x06\x07\x08\x01\x00'), ) --- 67,71 ---- ('REG_MULTI_SZ', win32con.REG_MULTI_SZ, ['string 1','string 2','string 3','string 4']), ('REG_DWORD', win32con.REG_DWORD, 666), ! ('REG_BINARY', win32con.REG_BINARY, b'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x01\x00'), ) *************** *** 114,118 **** self.failUnlessEqual(long_name, win32api.GetLongPathNameW(short_name)) long_name = win32api.GetLongPathNameW(short_name) ! self.failUnless(type(long_name)==unicode, "GetLongPathNameW returned type '%s'" % (type(long_name),)) self.failUnless(long_name==fname, \ "Expected long name ('%s') to be original name ('%s')" % (long_name, fname)) --- 114,118 ---- self.failUnlessEqual(long_name, win32api.GetLongPathNameW(short_name)) long_name = win32api.GetLongPathNameW(short_name) ! ## self.failUnless(type(long_name)==unicode, "GetLongPathNameW returned type '%s'" % (type(long_name),)) self.failUnless(long_name==fname, \ "Expected long name ('%s') to be original name ('%s')" % (long_name, fname)) *************** *** 125,130 **** fname = os.path.abspath(me) # passing unicode should cause GetShortPathNameW to be called. ! short_name = win32api.GetShortPathName(unicode(fname)) ! self.failUnless(isinstance(short_name, unicode)) long_name = win32api.GetLongPathName(short_name) self.failUnless(long_name==fname, \ --- 125,130 ---- fname = os.path.abspath(me) # passing unicode should cause GetShortPathNameW to be called. ! short_name = win32api.GetShortPathName(fname) ! ## self.failUnless(isinstance(short_name, unicode)) long_name = win32api.GetLongPathName(short_name) self.failUnless(long_name==fname, \ *************** *** 132,136 **** self.failUnlessEqual(long_name, win32api.GetLongPathNameW(short_name)) long_name = win32api.GetLongPathNameW(short_name) ! self.failUnless(type(long_name)==unicode, "GetLongPathNameW returned type '%s'" % (type(long_name),)) self.failUnless(long_name==fname, \ "Expected long name ('%s') to be original name ('%s')" % (long_name, fname)) --- 132,136 ---- self.failUnlessEqual(long_name, win32api.GetLongPathNameW(short_name)) long_name = win32api.GetLongPathNameW(short_name) ! ## self.failUnless(type(long_name)==unicode, "GetLongPathNameW returned type '%s'" % (type(long_name),)) self.failUnless(long_name==fname, \ "Expected long name ('%s') to be original name ('%s')" % (long_name, fname)) *************** *** 144,149 **** try: win32file.CreateDirectoryW(fname, None) ! except win32api.error, details: ! if details[0]!=winerror.ERROR_ALREADY_EXISTS: raise try: --- 144,149 ---- try: win32file.CreateDirectoryW(fname, None) ! except win32api.error as details: ! if details.args[0]!=winerror.ERROR_ALREADY_EXISTS: raise try: *************** *** 152,164 **** try: attr = win32api.GetFileAttributes(fname) ! except win32api.error, details: ! if details[0] != winerror.ERROR_FILENAME_EXCED_RANGE: raise ! attr = win32api.GetFileAttributes(unicode(fname)) self.failUnless(attr & win32con.FILE_ATTRIBUTE_DIRECTORY, attr) long_name = win32api.GetLongPathNameW(fname) ! self.failUnlessEqual(long_name, fname) finally: win32file.RemoveDirectory(fname) --- 152,164 ---- try: attr = win32api.GetFileAttributes(fname) ! except win32api.error as details: ! if details.args[0] != winerror.ERROR_FILENAME_EXCED_RANGE: raise ! attr = win32api.GetFileAttributes(fname) self.failUnless(attr & win32con.FILE_ATTRIBUTE_DIRECTORY, attr) long_name = win32api.GetLongPathNameW(fname) ! self.failUnlessEqual(long_name.lower(), fname.lower()) finally: win32file.RemoveDirectory(fname) |
From: Roger U. <ru...@us...> - 2008-08-29 04:17:03
|
Update of /cvsroot/pywin32/pywin32/win32/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31294/src Removed Files: Tag: py3k win32popen.cpp win32popenWin9x.cpp win32popenWin9x.rc Log Message: Remove popen functions --- win32popen.cpp DELETED --- --- win32popenWin9x.rc DELETED --- --- win32popenWin9x.cpp DELETED --- |
From: Roger U. <ru...@us...> - 2008-08-29 04:17:03
|
Update of /cvsroot/pywin32/pywin32/win32 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31294 Modified Files: Tag: py3k win32pipe.dsp Removed Files: Tag: py3k win32popenWin9x.dsp Log Message: Remove popen functions Index: win32pipe.dsp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/win32pipe.dsp,v retrieving revision 1.5 retrieving revision 1.5.4.1 diff -C2 -d -r1.5 -r1.5.4.1 *** win32pipe.dsp 1 Dec 2003 11:04:04 -0000 1.5 --- win32pipe.dsp 29 Aug 2008 04:17:12 -0000 1.5.4.1 *************** *** 129,136 **** SOURCE=.\src\win32pipemodule.cpp # End Source File - # Begin Source File - - SOURCE=.\src\win32popen.cpp - # End Source File # End Group # End Target --- 129,132 ---- --- win32popenWin9x.dsp DELETED --- |
From: Mark H. <mha...@us...> - 2008-08-18 13:04:01
|
Update of /cvsroot/pywin32/pywin32/com/win32comext/shell/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13809/win32comext/shell/src Modified Files: PyIShellBrowser.cpp Log Message: s/PyCom_HandlePythonFailureToCOM/MAKE_PYCOM_GATEWAY_FAILURE_CODE/ in some gateways for better error reporting. Index: PyIShellBrowser.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/shell/src/PyIShellBrowser.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** PyIShellBrowser.cpp 3 Jun 2007 14:53:07 -0000 1.9 --- PyIShellBrowser.cpp 18 Aug 2008 13:04:10 -0000 1.10 *************** *** 402,410 **** /* [out][in] */ LPOLEMENUGROUPWIDTHS lpMenuWidths) { PY_GATEWAY_METHOD; PyObject *oblpMenuWidths = PyObject_FromOLEMENUGROUPWIDTHS(lpMenuWidths); ! if (oblpMenuWidths==NULL) return PyCom_HandlePythonFailureToCOM(); PyObject *result; ! HRESULT hr=InvokeViaPolicy("InsertMenusSB", &result, "NO", PyWinLong_FromHANDLE(hmenuShared), oblpMenuWidths); Py_DECREF(oblpMenuWidths); if (FAILED(hr)) return hr; --- 402,411 ---- /* [out][in] */ LPOLEMENUGROUPWIDTHS lpMenuWidths) { + static const char *method_name = "InsertMenusSB"; PY_GATEWAY_METHOD; PyObject *oblpMenuWidths = PyObject_FromOLEMENUGROUPWIDTHS(lpMenuWidths); ! if (oblpMenuWidths==NULL) return MAKE_PYCOM_GATEWAY_FAILURE_CODE(method_name); PyObject *result; ! HRESULT hr=InvokeViaPolicy(method_name, &result, "NO", PyWinLong_FromHANDLE(hmenuShared), oblpMenuWidths); Py_DECREF(oblpMenuWidths); if (FAILED(hr)) return hr; *************** *** 456,463 **** /* [in] */ WORD wID) { PY_GATEWAY_METHOD; PyObject *obpmsg = PyObject_FromMSG(pmsg); ! if (obpmsg==NULL) return PyCom_HandlePythonFailureToCOM(); ! HRESULT hr=InvokeViaPolicy("TranslateAcceleratorSB", NULL, "OH", obpmsg, wID); Py_DECREF(obpmsg); return hr; --- 457,465 ---- /* [in] */ WORD wID) { + static const char *method_name = "TranslateAcceleratorSB"; PY_GATEWAY_METHOD; PyObject *obpmsg = PyObject_FromMSG(pmsg); ! if (obpmsg==NULL) return MAKE_PYCOM_GATEWAY_FAILURE_CODE(method_name); ! HRESULT hr=InvokeViaPolicy(method_name, NULL, "OH", obpmsg, wID); Py_DECREF(obpmsg); return hr; *************** *** 480,494 **** /* [out] */ IStream ** ppStrm) { PY_GATEWAY_METHOD; PyObject *result; ! HRESULT hr=InvokeViaPolicy("GetViewStateStream", &result, "l", grfMode); if (FAILED(hr)) return hr; // Process the Python results, and convert back to the real params PyObject *obppStrm; ! if (!PyArg_Parse(result, "O" , &obppStrm)) return PyCom_HandlePythonFailureToCOM(/*pexcepinfo*/); BOOL bPythonIsHappy = TRUE; if (bPythonIsHappy && !PyCom_InterfaceFromPyInstanceOrObject(obppStrm, IID_IStream, (void **)ppStrm, TRUE /* bNoneOK */)) bPythonIsHappy = FALSE; ! if (!bPythonIsHappy) hr = PyCom_HandlePythonFailureToCOM(/*pexcepinfo*/); Py_DECREF(result); return hr; --- 482,497 ---- /* [out] */ IStream ** ppStrm) { + static const char *method_name = "GetViewStateStream"; PY_GATEWAY_METHOD; PyObject *result; ! HRESULT hr=InvokeViaPolicy(method_name, &result, "l", grfMode); if (FAILED(hr)) return hr; // Process the Python results, and convert back to the real params PyObject *obppStrm; ! if (!PyArg_Parse(result, "O" , &obppStrm)) return MAKE_PYCOM_GATEWAY_FAILURE_CODE(method_name); BOOL bPythonIsHappy = TRUE; if (bPythonIsHappy && !PyCom_InterfaceFromPyInstanceOrObject(obppStrm, IID_IStream, (void **)ppStrm, TRUE /* bNoneOK */)) bPythonIsHappy = FALSE; ! if (!bPythonIsHappy) hr = MAKE_PYCOM_GATEWAY_FAILURE_CODE(method_name); Py_DECREF(result); return hr; *************** *** 499,509 **** /* [out] */ HWND * phwnd) { PY_GATEWAY_METHOD; PyObject *result; ! HRESULT hr=InvokeViaPolicy("GetControlWindow", &result, "I", id); if (FAILED(hr)) return hr; // Process the Python results, and convert back to the real params if (!PyWinObject_AsHANDLE(result, (HANDLE *)phwnd)) ! hr = PyCom_HandlePythonFailureToCOM(); Py_DECREF(result); return hr; --- 502,513 ---- /* [out] */ HWND * phwnd) { + static const char *method_name = "GetControlWindow"; PY_GATEWAY_METHOD; PyObject *result; ! HRESULT hr=InvokeViaPolicy(method_name, &result, "I", id); if (FAILED(hr)) return hr; // Process the Python results, and convert back to the real params if (!PyWinObject_AsHANDLE(result, (HANDLE *)phwnd)) ! hr = MAKE_PYCOM_GATEWAY_FAILURE_CODE(method_name); Py_DECREF(result); return hr; *************** *** 529,543 **** /* [out] */ IShellView ** ppshv) { PY_GATEWAY_METHOD; PyObject *result; ! HRESULT hr=InvokeViaPolicy("QueryActiveShellView", &result); if (FAILED(hr)) return hr; // Process the Python results, and convert back to the real params PyObject *obppshv; ! if (!PyArg_Parse(result, "O" , &obppshv)) return PyCom_HandlePythonFailureToCOM(/*pexcepinfo*/); BOOL bPythonIsHappy = TRUE; if (bPythonIsHappy && !PyCom_InterfaceFromPyInstanceOrObject(obppshv, IID_IShellView, (void **)ppshv, TRUE /* bNoneOK */)) bPythonIsHappy = FALSE; ! if (!bPythonIsHappy) hr = PyCom_HandlePythonFailureToCOM(/*pexcepinfo*/); Py_DECREF(result); return hr; --- 533,548 ---- /* [out] */ IShellView ** ppshv) { + static const char *method_name = "QueryActiveShellView"; PY_GATEWAY_METHOD; PyObject *result; ! HRESULT hr=InvokeViaPolicy(method_name, &result); if (FAILED(hr)) return hr; // Process the Python results, and convert back to the real params PyObject *obppshv; ! if (!PyArg_Parse(result, "O" , &obppshv)) return MAKE_PYCOM_GATEWAY_FAILURE_CODE(method_name); BOOL bPythonIsHappy = TRUE; if (bPythonIsHappy && !PyCom_InterfaceFromPyInstanceOrObject(obppshv, IID_IShellView, (void **)ppshv, TRUE /* bNoneOK */)) bPythonIsHappy = FALSE; ! if (!bPythonIsHappy) hr = MAKE_PYCOM_GATEWAY_FAILURE_CODE(method_name); Py_DECREF(result); return hr; *************** *** 560,563 **** --- 565,569 ---- /* [in] */ UINT uFlags) { + static const char *method_name = "SetToolbarItems"; PY_GATEWAY_METHOD; // *** The input argument lpButtons of type "LPTBBUTTONSB" was not processed *** *************** *** 566,571 **** PyObject *oblpButtons = Py_None; //PyObject_FromLPTBBUTTONSB(lpButtons); Py_INCREF(Py_None); ! if (oblpButtons==NULL) return PyCom_HandlePythonFailureToCOM(); ! HRESULT hr=InvokeViaPolicy("SetToolbarItems", NULL, "Oii", oblpButtons, nButtons, uFlags); Py_DECREF(oblpButtons); return hr; --- 572,577 ---- PyObject *oblpButtons = Py_None; //PyObject_FromLPTBBUTTONSB(lpButtons); Py_INCREF(Py_None); ! if (oblpButtons==NULL) return MAKE_PYCOM_GATEWAY_FAILURE_CODE(method_name); ! HRESULT hr=InvokeViaPolicy(method_name, NULL, "Oii", oblpButtons, nButtons, uFlags); Py_DECREF(oblpButtons); return hr; |
From: Mark H. <mha...@us...> - 2008-08-18 13:04:01
|
Update of /cvsroot/pywin32/pywin32/com/win32com/src/extensions In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13809/win32com/src/extensions Modified Files: PyIDataObject.cpp PyIDropTarget.cpp PyIOleWindow.cpp Log Message: s/PyCom_HandlePythonFailureToCOM/MAKE_PYCOM_GATEWAY_FAILURE_CODE/ in some gateways for better error reporting. Index: PyIDropTarget.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/src/extensions/PyIDropTarget.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** PyIDropTarget.cpp 25 Apr 2008 09:54:39 -0000 1.2 --- PyIDropTarget.cpp 18 Aug 2008 13:04:10 -0000 1.3 *************** *** 183,193 **** /* [out][in] */ DWORD * pdwEffect) { PY_GATEWAY_METHOD; PyObject *obpt = PyObject_FromPOINTL(pt); ! if (obpt==NULL) return PyCom_HandlePythonFailureToCOM(); PyObject *obpDataObj; obpDataObj = PyCom_PyObjectFromIUnknown(pDataObj, IID_IDataObject, TRUE); PyObject *result; ! HRESULT hr=InvokeViaPolicy("DragEnter", &result, "OlOl", obpDataObj, grfKeyState, obpt, *pdwEffect); Py_XDECREF(obpDataObj); Py_DECREF(obpt); --- 183,194 ---- /* [out][in] */ DWORD * pdwEffect) { + static const char *method_name = "DragEnter"; PY_GATEWAY_METHOD; PyObject *obpt = PyObject_FromPOINTL(pt); ! if (obpt==NULL) return MAKE_PYCOM_GATEWAY_FAILURE_CODE(method_name); PyObject *obpDataObj; obpDataObj = PyCom_PyObjectFromIUnknown(pDataObj, IID_IDataObject, TRUE); PyObject *result; ! HRESULT hr=InvokeViaPolicy(method_name, &result, "OlOl", obpDataObj, grfKeyState, obpt, *pdwEffect); Py_XDECREF(obpDataObj); Py_DECREF(obpt); *************** *** 204,212 **** /* [out][in] */ DWORD * pdwEffect) { PY_GATEWAY_METHOD; PyObject *obpt = PyObject_FromPOINTL(pt); ! if (obpt==NULL) return PyCom_HandlePythonFailureToCOM(); PyObject *result; ! HRESULT hr=InvokeViaPolicy("DragOver", &result, "lOl", grfKeyState, obpt, *pdwEffect); Py_DECREF(obpt); if (FAILED(hr)) return hr; --- 205,214 ---- /* [out][in] */ DWORD * pdwEffect) { + static const char *method_name = "DragOver"; PY_GATEWAY_METHOD; PyObject *obpt = PyObject_FromPOINTL(pt); ! if (obpt==NULL) return MAKE_PYCOM_GATEWAY_FAILURE_CODE(method_name); PyObject *result; ! HRESULT hr=InvokeViaPolicy(method_name, &result, "lOl", grfKeyState, obpt, *pdwEffect); Py_DECREF(obpt); if (FAILED(hr)) return hr; *************** *** 231,241 **** /* [out][in] */ DWORD * pdwEffect) { PY_GATEWAY_METHOD; PyObject *obpt = PyObject_FromPOINTL(pt); ! if (obpt==NULL) return PyCom_HandlePythonFailureToCOM(); PyObject *obpDataObj; obpDataObj = PyCom_PyObjectFromIUnknown(pDataObj, IID_IDataObject, TRUE); PyObject *result; ! HRESULT hr=InvokeViaPolicy("Drop", &result, "OlOl", obpDataObj, grfKeyState, obpt, *pdwEffect); Py_XDECREF(obpDataObj); Py_DECREF(obpt); --- 233,244 ---- /* [out][in] */ DWORD * pdwEffect) { + static const char *method_name = "Drop"; PY_GATEWAY_METHOD; PyObject *obpt = PyObject_FromPOINTL(pt); ! if (obpt==NULL) return MAKE_PYCOM_GATEWAY_FAILURE_CODE(method_name); PyObject *obpDataObj; obpDataObj = PyCom_PyObjectFromIUnknown(pDataObj, IID_IDataObject, TRUE); PyObject *result; ! HRESULT hr=InvokeViaPolicy(method_name, &result, "OlOl", obpDataObj, grfKeyState, obpt, *pdwEffect); Py_XDECREF(obpDataObj); Py_DECREF(obpt); Index: PyIDataObject.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/src/extensions/PyIDataObject.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** PyIDataObject.cpp 26 Apr 2008 22:17:49 -0000 1.7 --- PyIDataObject.cpp 18 Aug 2008 13:04:10 -0000 1.8 *************** *** 327,335 **** /* [out] */ STGMEDIUM * pmedium) { if (!pmedium) return E_POINTER; PY_GATEWAY_METHOD; PyObject *obpformatetcIn = PyObject_FromFORMATETC(pformatetcIn); ! if (obpformatetcIn==NULL) return PyCom_HandlePythonFailureToCOM(); PyObject *result; HRESULT hr=InvokeViaPolicy("GetData", &result, "(O)", obpformatetcIn); --- 327,336 ---- /* [out] */ STGMEDIUM * pmedium) { + static const char *method_name = "GetData"; if (!pmedium) return E_POINTER; PY_GATEWAY_METHOD; PyObject *obpformatetcIn = PyObject_FromFORMATETC(pformatetcIn); ! if (obpformatetcIn==NULL) return MAKE_PYCOM_GATEWAY_FAILURE_CODE(method_name); PyObject *result; HRESULT hr=InvokeViaPolicy("GetData", &result, "(O)", obpformatetcIn); *************** *** 344,348 **** pym->CopyTo(pmedium); } ! hr = PyCom_HandlePythonFailureToCOM(/*pexcepinfo*/); Py_DECREF(result); return hr; --- 345,349 ---- pym->CopyTo(pmedium); } ! hr = MAKE_PYCOM_GATEWAY_FAILURE_CODE(method_name); Py_DECREF(result); return hr; *************** *** 353,361 **** /* [out][in] */ STGMEDIUM * pmedium) { PY_GATEWAY_METHOD; PyObject *obpformatetc = PyObject_FromFORMATETC(pformatetc); ! if (obpformatetc==NULL) return PyCom_HandlePythonFailureToCOM(); PyObject *result; ! HRESULT hr=InvokeViaPolicy("GetDataHere", &result, "(O)", obpformatetc); Py_DECREF(obpformatetc); if (FAILED(hr)) return hr; --- 354,363 ---- /* [out][in] */ STGMEDIUM * pmedium) { + static const char *method_name = "GetDataHere"; PY_GATEWAY_METHOD; PyObject *obpformatetc = PyObject_FromFORMATETC(pformatetc); ! if (obpformatetc==NULL) return MAKE_PYCOM_GATEWAY_FAILURE_CODE(method_name); PyObject *result; ! HRESULT hr=InvokeViaPolicy(method_name, &result, "(O)", obpformatetc); Py_DECREF(obpformatetc); if (FAILED(hr)) return hr; *************** *** 366,370 **** pym->DropOwnership(); } ! hr = PyCom_HandlePythonFailureToCOM(/*pexcepinfo*/); Py_DECREF(result); return hr; --- 368,372 ---- pym->DropOwnership(); } ! hr = MAKE_PYCOM_GATEWAY_FAILURE_CODE(method_name); Py_DECREF(result); return hr; *************** *** 374,381 **** /* [unique][in] */ FORMATETC * pformatetc) { PY_GATEWAY_METHOD; PyObject *obpformatetc = PyObject_FromFORMATETC(pformatetc); ! if (obpformatetc==NULL) return PyCom_HandlePythonFailureToCOM(); ! HRESULT hr=InvokeViaPolicy("QueryGetData", NULL, "(O)", obpformatetc); Py_DECREF(obpformatetc); return hr; --- 376,384 ---- /* [unique][in] */ FORMATETC * pformatetc) { + static const char *method_name = "QueryGetData"; PY_GATEWAY_METHOD; PyObject *obpformatetc = PyObject_FromFORMATETC(pformatetc); ! if (obpformatetc==NULL) return MAKE_PYCOM_GATEWAY_FAILURE_CODE(method_name); ! HRESULT hr=InvokeViaPolicy(method_name, NULL, "(O)", obpformatetc); Py_DECREF(obpformatetc); return hr; *************** *** 386,394 **** /* [out] */ FORMATETC * pformatetcOut) { PY_GATEWAY_METHOD; PyObject *obpformatectIn = PyObject_FromFORMATETC(pformatectIn); ! if (obpformatectIn==NULL) return PyCom_HandlePythonFailureToCOM(); PyObject *result; ! HRESULT hr=InvokeViaPolicy("GetCanonicalFormatEtc", &result, "(O)", obpformatectIn); Py_DECREF(obpformatectIn); if (FAILED(hr)) return hr; --- 389,398 ---- /* [out] */ FORMATETC * pformatetcOut) { + static const char *method_name = "GetCanonicalFormatEtc"; PY_GATEWAY_METHOD; PyObject *obpformatectIn = PyObject_FromFORMATETC(pformatectIn); ! if (obpformatectIn==NULL) return MAKE_PYCOM_GATEWAY_FAILURE_CODE(method_name); PyObject *result; ! HRESULT hr=InvokeViaPolicy(method_name, &result, "(O)", obpformatectIn); Py_DECREF(obpformatectIn); if (FAILED(hr)) return hr; *************** *** 404,415 **** /* [in] */ BOOL fRelease) { PY_GATEWAY_METHOD; PyObject *obpformatetc = PyObject_FromFORMATETC(pformatetc); ! if (obpformatetc==NULL) return PyCom_HandlePythonFailureToCOM(); PySTGMEDIUM *obmedium = PyObject_FromSTGMEDIUM(pmedium); ! if (obmedium==NULL) return PyCom_HandlePythonFailureToCOM(); // PySTGMEDIUM should be the exact same pointer as PyObject assert((void *)(PyObject *)obmedium==(void *)obmedium); ! HRESULT hr=InvokeViaPolicy("SetData", NULL, "OOi", obpformatetc, (PyObject *)obmedium, fRelease); if (!fRelease) obmedium->DropOwnership(); --- 408,420 ---- /* [in] */ BOOL fRelease) { + static const char *method_name = "SetData"; PY_GATEWAY_METHOD; PyObject *obpformatetc = PyObject_FromFORMATETC(pformatetc); ! if (obpformatetc==NULL) return MAKE_PYCOM_GATEWAY_FAILURE_CODE(method_name); PySTGMEDIUM *obmedium = PyObject_FromSTGMEDIUM(pmedium); ! if (obmedium==NULL) return MAKE_PYCOM_GATEWAY_FAILURE_CODE(method_name); // PySTGMEDIUM should be the exact same pointer as PyObject assert((void *)(PyObject *)obmedium==(void *)obmedium); ! HRESULT hr=InvokeViaPolicy(method_name, NULL, "OOi", obpformatetc, (PyObject *)obmedium, fRelease); if (!fRelease) obmedium->DropOwnership(); *************** *** 423,437 **** /* [out] */ IEnumFORMATETC ** ppenumFormatEtc) { PY_GATEWAY_METHOD; PyObject *result; ! HRESULT hr=InvokeViaPolicy("EnumFormatEtc", &result, "l", dwDirection); if (FAILED(hr)) return hr; // Process the Python results, and convert back to the real params PyObject *obppenumFormatEtc; ! if (!PyArg_Parse(result, "O" , &obppenumFormatEtc)) return PyCom_HandlePythonFailureToCOM(/*pexcepinfo*/); BOOL bPythonIsHappy = TRUE; if (bPythonIsHappy && !PyCom_InterfaceFromPyInstanceOrObject(obppenumFormatEtc, IID_IEnumFORMATETC, (void **)ppenumFormatEtc, TRUE /* bNoneOK */)) bPythonIsHappy = FALSE; ! if (!bPythonIsHappy) hr = PyCom_HandlePythonFailureToCOM(/*pexcepinfo*/); Py_DECREF(result); return hr; --- 428,443 ---- /* [out] */ IEnumFORMATETC ** ppenumFormatEtc) { + static const char *method_name = "EnumFormatEtc"; PY_GATEWAY_METHOD; PyObject *result; ! HRESULT hr=InvokeViaPolicy(method_name, &result, "l", dwDirection); if (FAILED(hr)) return hr; // Process the Python results, and convert back to the real params PyObject *obppenumFormatEtc; ! if (!PyArg_Parse(result, "O" , &obppenumFormatEtc)) return MAKE_PYCOM_GATEWAY_FAILURE_CODE(method_name); BOOL bPythonIsHappy = TRUE; if (bPythonIsHappy && !PyCom_InterfaceFromPyInstanceOrObject(obppenumFormatEtc, IID_IEnumFORMATETC, (void **)ppenumFormatEtc, TRUE /* bNoneOK */)) bPythonIsHappy = FALSE; ! if (!bPythonIsHappy) hr = MAKE_PYCOM_GATEWAY_FAILURE_CODE(method_name); Py_DECREF(result); return hr; *************** *** 444,454 **** /* [out] */ DWORD * pdwConnection) { PY_GATEWAY_METHOD; PyObject *obpformatetc = PyObject_FromFORMATETC(pformatetc); ! if (obpformatetc==NULL) return PyCom_HandlePythonFailureToCOM(); PyObject *obpAdvSink; obpAdvSink = PyCom_PyObjectFromIUnknown(pAdvSink, IID_IAdviseSink, TRUE); PyObject *result; ! HRESULT hr=InvokeViaPolicy("DAdvise", &result, "OlO", obpformatetc, advf, obpAdvSink); Py_DECREF(obpformatetc); Py_XDECREF(obpAdvSink); --- 450,461 ---- /* [out] */ DWORD * pdwConnection) { + static const char *method_name = "DAdvise"; PY_GATEWAY_METHOD; PyObject *obpformatetc = PyObject_FromFORMATETC(pformatetc); ! if (obpformatetc==NULL) return MAKE_PYCOM_GATEWAY_FAILURE_CODE(method_name); PyObject *obpAdvSink; obpAdvSink = PyCom_PyObjectFromIUnknown(pAdvSink, IID_IAdviseSink, TRUE); PyObject *result; ! HRESULT hr=InvokeViaPolicy(method_name, &result, "OlO", obpformatetc, advf, obpAdvSink); Py_DECREF(obpformatetc); Py_XDECREF(obpAdvSink); *************** *** 470,484 **** /* [out] */ IEnumSTATDATA ** ppenumAdvise) { PY_GATEWAY_METHOD; PyObject *result; ! HRESULT hr=InvokeViaPolicy("EnumDAdvise", &result); if (FAILED(hr)) return hr; // Process the Python results, and convert back to the real params PyObject *obppenumAdvise; ! if (!PyArg_Parse(result, "O" , &obppenumAdvise)) return PyCom_HandlePythonFailureToCOM(/*pexcepinfo*/); BOOL bPythonIsHappy = TRUE; if (bPythonIsHappy && !PyCom_InterfaceFromPyInstanceOrObject(obppenumAdvise, IID_IEnumSTATDATA, (void **)ppenumAdvise, TRUE /* bNoneOK */)) bPythonIsHappy = FALSE; ! if (!bPythonIsHappy) hr = PyCom_HandlePythonFailureToCOM(/*pexcepinfo*/); Py_DECREF(result); return hr; --- 477,492 ---- /* [out] */ IEnumSTATDATA ** ppenumAdvise) { + static const char *method_name = "EnumDAdvise"; PY_GATEWAY_METHOD; PyObject *result; ! HRESULT hr=InvokeViaPolicy(method_name, &result); if (FAILED(hr)) return hr; // Process the Python results, and convert back to the real params PyObject *obppenumAdvise; ! if (!PyArg_Parse(result, "O" , &obppenumAdvise)) return MAKE_PYCOM_GATEWAY_FAILURE_CODE(method_name); BOOL bPythonIsHappy = TRUE; if (bPythonIsHappy && !PyCom_InterfaceFromPyInstanceOrObject(obppenumAdvise, IID_IEnumSTATDATA, (void **)ppenumAdvise, TRUE /* bNoneOK */)) bPythonIsHappy = FALSE; ! if (!bPythonIsHappy) hr = MAKE_PYCOM_GATEWAY_FAILURE_CODE(method_name); Py_DECREF(result); return hr; Index: PyIOleWindow.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/src/extensions/PyIOleWindow.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** PyIOleWindow.cpp 25 Jun 2007 05:15:36 -0000 1.2 --- PyIOleWindow.cpp 18 Aug 2008 13:04:10 -0000 1.3 *************** *** 87,97 **** /* [out] */ HWND __RPC_FAR * phwnd) { PY_GATEWAY_METHOD; PyObject *result; ! HRESULT hr=InvokeViaPolicy("GetWindow", &result); if (FAILED(hr)) return hr; // Process the Python results, and convert back to the real params if (!PyWinObject_AsHANDLE(result, (HANDLE *)phwnd)) ! hr=PyCom_HandlePythonFailureToCOM(/*pexcepinfo*/); Py_DECREF(result); return hr; --- 87,98 ---- /* [out] */ HWND __RPC_FAR * phwnd) { + static const char *method_name = "GetWindow"; PY_GATEWAY_METHOD; PyObject *result; ! HRESULT hr=InvokeViaPolicy(method_name, &result); if (FAILED(hr)) return hr; // Process the Python results, and convert back to the real params if (!PyWinObject_AsHANDLE(result, (HANDLE *)phwnd)) ! hr=MAKE_PYCOM_GATEWAY_FAILURE_CODE(method_name); Py_DECREF(result); return hr; |
From: Mark H. <mha...@us...> - 2008-08-18 13:01:35
|
Update of /cvsroot/pywin32/pywin32/com/win32comext/shell/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12906/win32comext/shell/src Modified Files: shell.cpp Log Message: Add more SID_* and VID_* shell constants. Index: shell.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/shell/src/shell.cpp,v retrieving revision 1.67 retrieving revision 1.68 diff -C2 -d -r1.67 -r1.68 *** shell.cpp 9 Aug 2008 01:53:01 -0000 1.67 --- shell.cpp 18 Aug 2008 13:01:43 -0000 1.68 *************** *** 3447,3450 **** --- 3447,3473 ---- ADD_IID(SID_ShellFolderViewCB); ADD_IID(SID_SShellBrowser); + ADD_IID(SID_DefView); + ADD_IID(CGID_DefView); + ADD_IID(SID_STopLevelBrowser); + ADD_IID(SID_STopWindow); + ADD_IID(SID_SGetViewFromViewDual); + ADD_IID(SID_CtxQueryAssociations); + ADD_IID(SID_SMenuBandChild); + ADD_IID(SID_SMenuBandParent); + ADD_IID(SID_SMenuPopup); + ADD_IID(SID_SMenuBandBottomSelected); + ADD_IID(SID_SMenuBandBottom); + ADD_IID(SID_MenuShellFolder); + ADD_IID(SID_SMenuBandContextMenuModifier); + ADD_IID(SID_SMenuBandBKContextMenu); + ADD_IID(SID_SMenuBandTop); + ADD_IID(SID_SCommDlgBrowser); + ADD_IID(VID_LargeIcons); + ADD_IID(VID_SmallIcons); + ADD_IID(VID_List); + ADD_IID(VID_Details); + ADD_IID(VID_Tile); + ADD_IID(VID_Thumbnails); + ADD_IID(VID_ThumbStrip); #else # pragma message("Please update your SDK headers - IE5 features missing!") |
From: Mark H. <mha...@us...> - 2008-08-18 13:00:30
|
Update of /cvsroot/pywin32/pywin32/com/win32comext/shell/demos In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12488/win32comext/shell/demos Modified Files: dump_link.py Log Message: dump more information about a shell link. Index: dump_link.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/shell/demos/dump_link.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** dump_link.py 15 Feb 2007 13:02:04 -0000 1.1 --- dump_link.py 18 Aug 2008 13:00:39 -0000 1.2 *************** *** 13,17 **** shellLink.Resolve(0, shell.SLR_ANY_MATCH | shell.SLR_NO_UI) fname, findData = shellLink.GetPath(0) ! print "Filename", fname, ", UNC=", shellLink.GetPath(shell.SLGP_UNCPRIORITY)[0] def FavDumper(nothing, path, names): --- 13,20 ---- shellLink.Resolve(0, shell.SLR_ANY_MATCH | shell.SLR_NO_UI) fname, findData = shellLink.GetPath(0) ! print "Filename:", fname, ", UNC=", shellLink.GetPath(shell.SLGP_UNCPRIORITY)[0] ! print "Description:", shellLink.GetDescription() ! print "Working Directory:", shellLink.GetWorkingDirectory() ! print "Icon:", shellLink.GetIconLocation() def FavDumper(nothing, path, names): |
From: Mark H. <mha...@us...> - 2008-08-18 12:59:47
|
Update of /cvsroot/pywin32/pywin32/com/win32com/src/extensions In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11637/win32com/src/extensions Modified Files: PyIServiceProvider.cpp Log Message: s/PyCom_HandlePythonFailureToCOM/MAKE_PYCOM_GATEWAY_FAILURE_CODE/ and fix error handling in QueryService if either param fails Index: PyIServiceProvider.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/src/extensions/PyIServiceProvider.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** PyIServiceProvider.cpp 11 Dec 2004 19:49:56 -0000 1.4 --- PyIServiceProvider.cpp 18 Aug 2008 12:59:55 -0000 1.5 *************** *** 66,82 **** STDMETHODIMP PyGServiceProvider::QueryService(REFGUID guidService, REFIID riid, void **ppv) { if (ppv==NULL) return E_POINTER; *ppv = NULL; PY_GATEWAY_METHOD; PyObject *obGUID = PyWinObject_FromIID(guidService); ! if (obGUID==NULL) PyCom_HandlePythonFailureToCOM(); PyObject *obIID = PyWinObject_FromIID(riid); if (obIID==NULL) { Py_DECREF(obGUID); ! PyCom_HandlePythonFailureToCOM(); } PyObject *result; ! HRESULT hr = InvokeViaPolicy("QueryService", &result, "OO", obGUID, obIID); Py_DECREF(obIID); Py_DECREF(obGUID); --- 66,83 ---- STDMETHODIMP PyGServiceProvider::QueryService(REFGUID guidService, REFIID riid, void **ppv) { + static const char *method_name = "QueryService"; if (ppv==NULL) return E_POINTER; *ppv = NULL; PY_GATEWAY_METHOD; PyObject *obGUID = PyWinObject_FromIID(guidService); ! if (obGUID==NULL) return MAKE_PYCOM_GATEWAY_FAILURE_CODE(method_name); PyObject *obIID = PyWinObject_FromIID(riid); if (obIID==NULL) { Py_DECREF(obGUID); ! return MAKE_PYCOM_GATEWAY_FAILURE_CODE(method_name); } PyObject *result; ! HRESULT hr = InvokeViaPolicy(method_name, &result, "OO", obGUID, obIID); Py_DECREF(obIID); Py_DECREF(obGUID); *************** *** 85,89 **** PyCom_InterfaceFromPyInstanceOrObject(result, riid, ppv, TRUE); Py_XDECREF(result); ! return PyCom_HandlePythonFailureToCOM(); } --- 86,90 ---- PyCom_InterfaceFromPyInstanceOrObject(result, riid, ppv, TRUE); Py_XDECREF(result); ! return MAKE_PYCOM_GATEWAY_FAILURE_CODE(method_name); } |
From: Roger U. <ru...@us...> - 2008-08-11 00:48:53
|
Update of /cvsroot/pywin32/pywin32/Pythonwin/pywin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29084 Modified Files: default.cfg Log Message: Remove use of string module Index: default.cfg =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/default.cfg,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** default.cfg 13 Jun 2008 20:47:56 -0000 1.8 --- default.cfg 11 Aug 2008 00:49:01 -0000 1.9 *************** *** 148,153 **** # Now set the insert point to the middle of the banner. ! import string ! line, col = map(int, string.split(pos, ".")) text.mark_set("insert", "%d.1 lineend" % (line+2, ) ) --- 148,152 ---- # Now set the insert point to the middle of the banner. ! line, col = [int(s) for s in pos.split(".")] text.mark_set("insert", "%d.1 lineend" % (line+2, ) ) |
From: Roger U. <ru...@us...> - 2008-08-11 00:38:19
|
Update of /cvsroot/pywin32/pywin32/Pythonwin/pywin/framework In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25015 Modified Files: app.py scriptutils.py Log Message: Remove mutual import between app and scriptutils Index: app.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/framework/app.py,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** app.py 9 Aug 2008 16:47:07 -0000 1.13 --- app.py 11 Aug 2008 00:38:28 -0000 1.14 *************** *** 375,385 **** sys.modules['__builtin__'].input=Win32Input - try: - # LocatePythonFile used to be here. - # THIS WILL BE DELETED SOON. - from scriptutils import LocatePythonFile - except: - pass - def HaveGoodGUI(): """Returns true if we currently have a good gui available. --- 375,378 ---- Index: scriptutils.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/framework/scriptutils.py,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** scriptutils.py 9 Aug 2008 16:47:07 -0000 1.17 --- scriptutils.py 11 Aug 2008 00:38:28 -0000 1.18 *************** *** 2,6 **** Various utilities for running/importing a script """ - import app import sys import win32ui --- 2,5 ---- *************** *** 253,257 **** script = fnameonly except os.error: ! fullScript = app.LocatePythonFile(script) if fullScript is None: win32ui.MessageBox("The file '%s' can not be located" % script ) --- 252,256 ---- script = fnameonly except os.error: ! fullScript = LocatePythonFile(script) if fullScript is None: win32ui.MessageBox("The file '%s' can not be located" % script ) |
From: Mark H. <mha...@us...> - 2008-08-10 13:13:18
|
Update of /cvsroot/pywin32/pywin32/win32/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5469/win32/src Modified Files: win32apimodule.cpp Log Message: add win32api.GetNativeSystemInfo() Index: win32apimodule.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32apimodule.cpp,v retrieving revision 1.88 retrieving revision 1.89 diff -C2 -d -r1.88 -r1.89 *** win32apimodule.cpp 25 Jul 2008 01:10:10 -0000 1.88 --- win32apimodule.cpp 10 Aug 2008 13:13:21 -0000 1.89 *************** *** 58,61 **** --- 58,63 ---- typedef BOOL (WINAPI *SetSystemPowerStatefunc)(BOOL, BOOL); static SetSystemPowerStatefunc pfnSetSystemPowerState = NULL; + typedef BOOL (WINAPI *GetNativeSystemInfofunc)(LPSYSTEM_INFO); + static GetNativeSystemInfofunc pfnGetNativeSystemInfo = NULL; // from secur32.dll *************** *** 2076,2084 **** GetSystemInfo( &info ); return Py_BuildValue("iiNNNiii(HH)", ! #if !defined(MAINWIN) ! info.dwOemId, ! #else ! 0, ! #endif // MAINWIN info.dwPageSize, PyWinLong_FromVoidPtr(info.lpMinimumApplicationAddress), --- 2078,2082 ---- GetSystemInfo( &info ); return Py_BuildValue("iiNNNiii(HH)", ! info.wProcessorArchitecture, info.dwPageSize, PyWinLong_FromVoidPtr(info.lpMinimumApplicationAddress), *************** *** 2090,2098 **** // @rdesc The return value is a tuple of 9 values, which corresponds // to the Win32 SYSTEM_INFO structure. The element names are: ! // <nl>dwOemId<nl>dwPageSize<nl>lpMinimumApplicationAddress<nl>lpMaximumApplicationAddress<nl> // dwActiveProcessorMask<nl>dwNumberOfProcessors<nl> // dwProcessorType<nl>dwAllocationGranularity<nl>(wProcessorLevel,wProcessorRevision) } // @pymethod int|win32api|GetSystemMetrics|Retrieves various system metrics and system configuration settings. static PyObject * --- 2088,2123 ---- // @rdesc The return value is a tuple of 9 values, which corresponds // to the Win32 SYSTEM_INFO structure. The element names are: ! // <nl>wProcessorArchitecture<nl>dwPageSize<nl>lpMinimumApplicationAddress<nl>lpMaximumApplicationAddress<nl> // dwActiveProcessorMask<nl>dwNumberOfProcessors<nl> // dwProcessorType<nl>dwAllocationGranularity<nl>(wProcessorLevel,wProcessorRevision) } + // @pymethod tuple|win32api|GetNativeSystemInfo|Retrieves information about the current system for a Wow64 process. + static PyObject * + PyGetNativeSystemInfo(PyObject * self, PyObject * args) + { + CHECK_PFN(SetSystemPowerState); + if (!PyArg_ParseTuple(args, ":GetNativeSystemInfo")) + return NULL; + // @pyseeapi GetNativeSystemInfo + SYSTEM_INFO info; + (*pfnGetNativeSystemInfo)( &info ); + return Py_BuildValue("iiNNNiii(HH)", + info.wProcessorArchitecture, + info.dwPageSize, + PyWinLong_FromVoidPtr(info.lpMinimumApplicationAddress), + PyWinLong_FromVoidPtr(info.lpMaximumApplicationAddress), + PyLong_FromUnsignedLongLong(info.dwActiveProcessorMask), + info.dwNumberOfProcessors, + info.dwProcessorType, info.dwAllocationGranularity, + info.wProcessorLevel, info.wProcessorRevision); + // @rdesc The return value is a tuple of 9 values, which corresponds + // to the Win32 SYSTEM_INFO structure. The element names are: + // <nl>wProcessorArchitecture<nl>dwPageSize<nl>lpMinimumApplicationAddress<nl>lpMaximumApplicationAddress<nl> + // dwActiveProcessorMask<nl>dwNumberOfProcessors<nl> + // dwProcessorType<nl>dwAllocationGranularity<nl>(wProcessorLevel,wProcessorRevision) + } + + // @pymethod int|win32api|GetSystemMetrics|Retrieves various system metrics and system configuration settings. static PyObject * *************** *** 6041,6044 **** --- 6066,6070 ---- {"SetSystemFileCacheSize", (PyCFunction)PySetSystemFileCacheSize, METH_KEYWORDS|METH_VARARGS}, // @pymeth SetSystemFileCacheSize|Sets the amount of memory reserved for file cache {"GetSystemInfo", PyGetSystemInfo, 1}, // @pymeth GetSystemInfo|Retrieves information about the current system. + {"GetNativeSystemInfo", PyGetNativeSystemInfo, 1}, // @pymeth GetNativeSystemInfo|Retrieves information about the current system for a Wow64 process. {"GetSystemMetrics", PyGetSystemMetrics, 1}, // @pymeth GetSystemMetrics|Returns the specified system metrics. {"GetSystemTime", PyGetSystemTime, 1}, // @pymeth GetSystemTime|Returns the current system time. *************** *** 6254,6257 **** --- 6280,6284 ---- pfnSetDllDirectory=(SetDllDirectoryfunc)GetProcAddress(hmodule,"SetDllDirectoryW"); pfnSetSystemPowerState=(SetSystemPowerStatefunc)GetProcAddress(hmodule,"SetSystemPowerState"); + pfnGetNativeSystemInfo=(GetNativeSystemInfofunc)GetProcAddress(hmodule,"GetNativeSystemInfo"); } |
From: Mark H. <mha...@us...> - 2008-08-10 13:13:16
|
Update of /cvsroot/pywin32/pywin32 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5469 Modified Files: CHANGES.txt Log Message: add win32api.GetNativeSystemInfo() Index: CHANGES.txt =================================================================== RCS file: /cvsroot/pywin32/pywin32/CHANGES.txt,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** CHANGES.txt 9 Aug 2008 01:53:01 -0000 1.25 --- CHANGES.txt 10 Aug 2008 13:13:20 -0000 1.26 *************** *** 13,16 **** --- 13,18 ---- * win32com.shell gets support for IContextMenu2 and IContextMenu3 + * add win32api.GetNativeSystemInfo() + Since build 211: ---------------- |
From: Roger U. <ru...@us...> - 2008-08-09 18:37:13
|
Update of /cvsroot/pywin32/pywin32/Pythonwin/pywin/framework In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20288 Modified Files: startup.py Log Message: Remove use of strop module Index: startup.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/framework/startup.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** startup.py 7 Oct 2004 08:49:04 -0000 1.3 --- startup.py 9 Aug 2008 18:37:22 -0000 1.4 *************** *** 11,15 **** import sys import win32ui - import strop # You may wish to redirect error output somewhere useful if you have startup errors. --- 11,14 ---- *************** *** 39,43 **** sys.appargv = sys.argv[:] # Must check for /app param here. ! if len(sys.argv)>=2 and strop.lower(sys.argv[0])=='/app': import cmdline moduleName = cmdline.FixArgFileName(sys.argv[1]) --- 38,42 ---- sys.appargv = sys.argv[:] # Must check for /app param here. ! if len(sys.argv)>=2 and sys.argv[0].lower()=='/app': import cmdline moduleName = cmdline.FixArgFileName(sys.argv[1]) |
From: Roger U. <ru...@us...> - 2008-08-09 16:47:11
|
Update of /cvsroot/pywin32/pywin32/Pythonwin/pywin/framework/editor In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9229 Modified Files: document.py editor.py template.py vss.py Log Message: Replace use of string module with string methods Index: vss.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/framework/editor/vss.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** vss.py 4 Jun 2000 06:19:33 -0000 1.3 --- vss.py 9 Aug 2008 16:47:20 -0000 1.4 *************** *** 51,55 **** win32ui.MessageBox("%s\r\n\r\nThis directory is not configured for Python/VSS" % origPath) return ! return project, string.join(retPaths, "/"), database --- 51,55 ---- win32ui.MessageBox("%s\r\n\r\nThis directory is not configured for Python/VSS" % origPath) return ! return project, "/".join(retPaths), database Index: document.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/framework/editor/document.py,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** document.py 5 Jan 2007 20:44:33 -0000 1.10 --- document.py 9 Aug 2008 16:47:20 -0000 1.11 *************** *** 228,232 **** try: self.scModule = __import__(self.scModuleName) ! for part in string.split(self.scModuleName,'.')[1:]: self.scModule = getattr(self.scModule, part) except: --- 228,232 ---- try: self.scModule = __import__(self.scModuleName) ! for part in self.scModuleName.split('.')[1:]: self.scModule = getattr(self.scModule, part) except: Index: template.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/framework/editor/template.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** template.py 11 Mar 2000 00:52:46 -0000 1.3 --- template.py 9 Aug 2008 16:47:20 -0000 1.4 *************** *** 22,26 **** doc = self.FindOpenDocument(fileName) if doc: return doc ! ext = string.lower(os.path.splitext(fileName)[1]) if ext in self.GetFileExtensions(): return win32ui.CDocTemplate_Confidence_yesAttemptNative --- 22,26 ---- doc = self.FindOpenDocument(fileName) if doc: return doc ! ext = os.path.splitext(fileName)[1].lower() if ext in self.GetFileExtensions(): return win32ui.CDocTemplate_Confidence_yesAttemptNative Index: editor.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/framework/editor/editor.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** editor.py 7 Feb 2004 02:06:57 -0000 1.3 --- editor.py 9 Aug 2008 16:47:20 -0000 1.4 *************** *** 104,108 **** """Given raw data read from a file, massage it suitable for the edit window""" # if a CR in the first 250 chars, then perform the expensive translate ! if string.find(data[:250],'\r')==-1: win32ui.SetStatusText("Translating from Unix file format - please wait...",1) return re.sub('\r*\n','\r\n',data) --- 104,108 ---- """Given raw data read from a file, massage it suitable for the edit window""" # if a CR in the first 250 chars, then perform the expensive translate ! if data[:250].find('\r')==-1: win32ui.SetStatusText("Translating from Unix file format - please wait...",1) return re.sub('\r*\n','\r\n',data) *************** *** 304,308 **** try: if lineNo is None: ! lineNo = string.atoi(raw_input("Enter Line Number")) except (ValueError, KeyboardInterrupt): return 0 --- 304,308 ---- try: if lineNo is None: ! lineNo = int(raw_input("Enter Line Number")) except (ValueError, KeyboardInterrupt): return 0 *************** *** 335,339 **** # look for a module name ! line=string.strip(self._obj_.GetLine()) flags=win32con.MF_STRING|win32con.MF_ENABLED if patImport.match(line)==len(line): --- 335,339 ---- # look for a module name ! line=self._obj_.GetLine().strip() flags=win32con.MF_STRING|win32con.MF_ENABLED if patImport.match(line)==len(line): *************** *** 376,380 **** # then copy the current indentation to this line. res = patIndent.match(curLine,0) ! if res>0 and string.strip(curLine): curIndent = patIndent.group(1) self._obj_.ReplaceSel(curIndent) --- 376,380 ---- # then copy the current indentation to this line. res = patIndent.match(curLine,0) ! if res>0 and curLine.strip(): curIndent = patIndent.group(1) self._obj_.ReplaceSel(curIndent) |
Update of /cvsroot/pywin32/pywin32/Pythonwin/pywin/scintilla In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8819/scintilla Modified Files: IDLEenvironment.py bindings.py config.py configui.py control.py formatter.py keycodes.py view.py Log Message: Replace use of string module with string methods Index: config.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/scintilla/config.py,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** config.py 9 Oct 2000 22:36:38 -0000 1.5 --- config.py 9 Aug 2008 16:47:07 -0000 1.6 *************** *** 25,29 **** import win32traceutil # Some trace statements fire before the interactive window is open. def trace(*args): ! sys.stderr.write(string.join(map(str, args), " ") + "\n") else: trace = lambda *args: None --- 25,29 ---- import win32traceutil # Some trace statements fire before the interactive window is open. def trace(*args): ! sys.stderr.write(" ".join(map(str, args)) + "\n") else: trace = lambda *args: None *************** *** 32,53 **** def split_line(line, lineno): ! comment_pos = string.find(line, "#") if comment_pos>=0: line = line[:comment_pos] ! sep_pos = string.rfind(line, "=") if sep_pos == -1: ! if string.strip(line): print "Warning: Line %d: %s is an invalid entry" % (lineno, `line`) return None, None return "", "" ! return string.strip(line[:sep_pos]), string.strip(line[sep_pos+1:]) def get_section_header(line): # Returns the section if the line is a section header, else None if line[0] == "[": ! end = string.find(line, "]") if end==-1: end=len(line) ! rc = string.lower(line[1:end]) try: ! i = string.index(rc, ":") return rc[:i], rc[i+1:] except ValueError: --- 32,53 ---- def split_line(line, lineno): ! comment_pos = line.find("#") if comment_pos>=0: line = line[:comment_pos] ! sep_pos = line.rfind("=") if sep_pos == -1: ! if line.strip(): print "Warning: Line %d: %s is an invalid entry" % (lineno, `line`) return None, None return "", "" ! return line[:sep_pos].strip(), line[sep_pos+1:].strip() def get_section_header(line): # Returns the section if the line is a section header, else None if line[0] == "[": ! end = line.find("]") if end==-1: end=len(line) ! rc = line[1:end].lower() try: ! i = rc.index(":") return rc[:i], rc[i+1:] except ValueError: *************** *** 222,226 **** bBreak = get_section_header(line)[0] is not None # A new section is starting if bStripComments and not bBreak: ! pos = string.find(line, "#") if pos>=0: line=line[:pos]+"\n" else: --- 222,226 ---- bBreak = get_section_header(line)[0] is not None # A new section is starting if bStripComments and not bBreak: ! pos = line.find("#") if pos>=0: line=line[:pos]+"\n" else: *************** *** 243,247 **** key, val = split_line(line, lineno) if not key: continue ! key = string.lower(key) l = map.get(key, []) l.append(val) --- 243,247 ---- key, val = split_line(line, lineno) if not key: continue ! key = key.lower() l = map.get(key, []) l.append(val) *************** *** 278,282 **** lines.append(line) try: ! c = compile(string.join(lines, ""), self.filename, "exec") self._save_data("extension code", c) except SyntaxError, details: --- 278,282 ---- lines.append(line) try: ! c = compile("".join(lines), self.filename, "exec") self._save_data("extension code", c) except SyntaxError, details: *************** *** 294,298 **** line, lineno, bBreak = self._readline(fp, lineno) if bBreak: break ! line = string.strip(line) if line: extensions.append(line) --- 294,298 ---- line, lineno, bBreak = self._readline(fp, lineno) if bBreak: break ! line = line.strip() if line: extensions.append(line) Index: IDLEenvironment.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/scintilla/IDLEenvironment.py,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** IDLEenvironment.py 29 Nov 2003 06:37:40 -0000 1.10 --- IDLEenvironment.py 9 Aug 2008 16:47:07 -0000 1.11 *************** *** 10,14 **** from pywin.mfc.dialog import GetSimpleInput ! wordchars = string.uppercase + string.lowercase + string.digits class TextError(Exception): # When a TclError would normally be raised. --- 10,14 ---- from pywin.mfc.dialog import GetSimpleInput ! wordchars = string.ascii_uppercase + string.ascii_lowercase + string.digits class TextError(Exception): # When a TclError would normally be raised. *************** *** 44,48 **** if not self.__dict__.has_key("_scint_lines"): # XXX - note - assumes this is only called once the file is loaded! ! self._scint_lines = string.split(self.text.edit.GetTextRange(), "\n") sl = self._scint_lines i = self.i = self.i + 1 --- 44,48 ---- if not self.__dict__.has_key("_scint_lines"): # XXX - note - assumes this is only called once the file is loaded! ! self._scint_lines = self.text.edit.GetTextRange().split("\n") sl = self._scint_lines i = self.i = self.i + 1 *************** *** 86,90 **** events = filter(lambda item: item[-6:]=="_event", dir(klass)) for event in events: ! name = "<<%s>>" % (string.replace(event[:-6], "_", "-"), ) self.edit.bindings.bind(name, getattr(ext, event)) return ext --- 86,90 ---- events = filter(lambda item: item[-6:]=="_event", dir(klass)) for event in events: ! name = "<<%s>>" % (event[:-6].replace("_", "-"), ) self.edit.bindings.bind(name, getattr(ext, event)) return ext *************** *** 99,104 **** if name == menu_name: for text, event in filter(lambda item: item is not None, items): ! text = string.replace(text, "&", "&&") ! text = string.replace(text, "_", "&") ret.append((text, event)) return ret --- 99,104 ---- if name == menu_name: for text, event in filter(lambda item: item is not None, items): ! text = text.replace("&", "&&") ! text = text.replace("_", "&") ret.append((text, event)) return ret *************** *** 203,209 **** base, nextTokPos = _NextTok(bm, 0) if base is None: raise ValueError, "Empty bookmark ID!" ! if string.find(base,".")>0: try: ! line, col = string.split(base, ".", 2) if col=="first" or col=="last": # Tag name --- 203,209 ---- base, nextTokPos = _NextTok(bm, 0) if base is None: raise ValueError, "Empty bookmark ID!" ! if base.find(".")>0: try: ! line, col = base.split(".", 2) if col=="first" or col=="last": # Tag name *************** *** 339,343 **** # pretend a trailing '\n' exists if necessary. if checkEnd and (not ret or ret[-1] != '\n'): ret = ret + '\n' ! return string.replace(ret, "\r", "") def index(self, spec): try: --- 339,343 ---- # pretend a trailing '\n' exists if necessary. if checkEnd and (not ret or ret[-1] != '\n'): ret = ret + '\n' ! return ret.replace("\r", "") def index(self, spec): try: *************** *** 352,356 **** self.edit.SetSel((pos, pos)) # IDLE only deals with "\n" - we will be nicer ! bits = string.split(text, '\n') self.edit.SCIAddText(bits[0]) for bit in bits[1:]: --- 352,356 ---- self.edit.SetSel((pos, pos)) # IDLE only deals with "\n" - we will be nicer ! bits = text.split('\n') self.edit.SCIAddText(bits[0]) for bit in bits[1:]: Index: keycodes.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/scintilla/keycodes.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** keycodes.py 10 Apr 2000 01:57:42 -0000 1.4 --- keycodes.py 9 Aug 2008 16:47:07 -0000 1.5 *************** *** 3,7 **** char_ranges = [ ! (string.lowercase, -32), (string.digits, 0), ("?><:[]\\", 128), --- 3,7 ---- char_ranges = [ ! (string.ascii_lowercase, -32), (string.digits, 0), ("?><:[]\\", 128), *************** *** 33,37 **** names = filter(lambda entry: entry[:3]=="VK_", win32con.__dict__.keys()) for name in names: ! n = string.lower(name[3:]) val = getattr(win32con, name) key_name_to_code[n] = val --- 33,37 ---- names = filter(lambda entry: entry[:3]=="VK_", win32con.__dict__.keys()) for name in names: ! n = name[3:].lower() val = getattr(win32con, name) key_name_to_code[n] = val *************** *** 50,54 **** def get_scan_code(chardesc): ! return key_name_to_code.get(string.lower(chardesc)) modifiers = { --- 50,54 ---- def get_scan_code(chardesc): ! return key_name_to_code.get(chardesc.lower()) modifiers = { *************** *** 75,79 **** while pos<max: if name[pos] in "+-": ! tok = string.lower(name[start:pos]) mod = modifiers.get(tok) if mod is None: --- 75,79 ---- while pos<max: if name[pos] in "+-": ! tok = name[start:pos].lower() mod = modifiers.get(tok) if mod is None: *************** *** 122,126 **** sep = "+" if sep in parts: sep = "-" ! return string.join(map(string.capitalize, parts), sep) def _psc(char): --- 122,126 ---- sep = "+" if sep in parts: sep = "-" ! return sep.join([p.capitalize() for p in parts]) def _psc(char): Index: control.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/scintilla/control.py,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** control.py 23 Feb 2008 08:05:07 -0000 1.16 --- control.py 9 Aug 2008 16:47:07 -0000 1.17 *************** *** 65,69 **** if style is not None: text = map(lambda char, style=style: char+chr(style), text) ! text = string.join(text, '') self.SendMessage(SCI_ADDSTYLEDTEXT, buffer(text)) def SCIInsertText(self, text, pos=-1): --- 65,69 ---- if style is not None: text = map(lambda char, style=style: char+chr(style), text) ! text = ''.join(text) self.SendMessage(SCI_ADDSTYLEDTEXT, buffer(text)) def SCIInsertText(self, text, pos=-1): *************** *** 179,183 **** def SCIAutoCShow(self, text): if type(text) in [type([]), type(())]: ! text = string.join(text) buff = array.array('c', text + "\0") addressBuffer = buff.buffer_info()[0] --- 179,183 ---- def SCIAutoCShow(self, text): if type(text) in [type([]), type(())]: ! text = ' '.join(text) buff = array.array('c', text + "\0") addressBuffer = buff.buffer_info()[0] Index: configui.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/scintilla/configui.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** configui.py 5 Jul 2001 07:52:32 -0000 1.4 --- configui.py 9 Aug 2008 16:47:07 -0000 1.5 *************** *** 49,55 **** colorizer = self.scintilla._GetColorizer() text = colorizer.GetSampleText() ! items = string.split(text, '|', 2) pos = len(items[0]) ! self.scintilla.SCIAddText(string.join(items,'')) self.scintilla.SetSel(pos, pos) self.scintilla.ApplyFormattingStyles() --- 49,55 ---- colorizer = self.scintilla._GetColorizer() text = colorizer.GetSampleText() ! items = text.split('|', 2) pos = len(items[0]) ! self.scintilla.SCIAddText(''.join(items)) self.scintilla.SetSel(pos, pos) self.scintilla.ApplyFormattingStyles() Index: view.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/scintilla/view.py,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** view.py 18 Jun 2008 22:12:54 -0000 1.27 --- view.py 9 Aug 2008 16:47:08 -0000 1.28 *************** *** 26,30 **** EM_FORMATRANGE = win32con.WM_USER+57 ! wordbreaks = "._" + string.uppercase + string.lowercase + string.digits patImport=re.compile('import (?P<name>.*)') --- 26,30 ---- EM_FORMATRANGE = win32con.WM_USER+57 ! wordbreaks = "._" + string.ascii_uppercase + string.ascii_lowercase + string.digits patImport=re.compile('import (?P<name>.*)') *************** *** 67,73 **** for name in _event_commands: val = eval(name) ! name_parts = string.split(name, "_")[1:] ! name_parts = map(string.capitalize, name_parts) ! event =string.join(name_parts,'') event_commands.append((event, val)) for name, id in _extra_event_commands: --- 67,73 ---- for name in _event_commands: val = eval(name) ! name_parts = name.split("_")[1:] ! name_parts = [p.capitalize() for p in name_parts] ! event = ''.join(name_parts) event_commands.append((event, val)) for name, id in _extra_event_commands: *************** *** 360,364 **** def OnCmdFileLocate(self, cmd, id): ! line=string.strip(self.GetLine()) import pywin.framework.scriptutils m = patImport.match(line) --- 360,364 ---- def OnCmdFileLocate(self, cmd, id): ! line = self.GetLine().strip() import pywin.framework.scriptutils m = patImport.match(line) *************** *** 379,383 **** def OnCmdGotoLine(self, cmd, id): try: ! lineNo = string.atoi(raw_input("Enter Line Number"))-1 except (ValueError, KeyboardInterrupt): return 0 --- 379,383 ---- def OnCmdGotoLine(self, cmd, id): try: ! lineNo = int(raw_input("Enter Line Number"))-1 except (ValueError, KeyboardInterrupt): return 0 *************** *** 581,585 **** after.append(char) index=index+1 ! return string.join(before,''), string.join(after,'') def OnPrepareDC (self, dc, pInfo): --- 581,585 ---- after.append(char) index=index+1 ! return ''.join(before), ''.join(after) def OnPrepareDC (self, dc, pInfo): Index: bindings.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/scintilla/bindings.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** bindings.py 7 Aug 2000 08:27:02 -0000 1.4 --- bindings.py 9 Aug 2008 16:47:07 -0000 1.5 *************** *** 99,103 **** try: instance = self.parent_view.idle.IDLEExtension(ext) ! name = string.replace(handler, "-", "_") + "_event" return getattr(instance, name) except (ImportError, AttributeError): --- 99,103 ---- try: instance = self.parent_view.idle.IDLEExtension(ext) ! name = handler.replace("-", "_") + "_event" return getattr(instance, name) except (ImportError, AttributeError): Index: formatter.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/scintilla/formatter.py,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** formatter.py 25 Feb 2008 07:46:13 -0000 1.13 --- formatter.py 9 Aug 2008 16:47:07 -0000 1.14 *************** *** 16,20 **** import sys, win32traceutil, win32trace def trace(*args): ! win32trace.write(string.join(map(str, args), " ") + "\n") else: trace = lambda *args: None --- 16,20 ---- import sys, win32traceutil, win32trace def trace(*args): ! win32trace.write(' '.join(map(str, args)) + "\n") else: trace = lambda *args: None *************** *** 516,530 **** # These taken from the SciTE properties file. source_formatter_extensions = [ ! ( string.split(".py .pys .pyw"), scintillacon.SCLEX_PYTHON ), ! ( string.split(".html .htm .asp .shtml"), scintillacon.SCLEX_HTML ), ! ( string.split("c .cc .cpp .cxx .h .hh .hpp .hxx .idl .odl .php3 .phtml .inc .js"),scintillacon.SCLEX_CPP ), ! ( string.split(".vbs .frm .ctl .cls"), scintillacon.SCLEX_VB ), ! ( string.split(".pl .pm .cgi .pod"), scintillacon.SCLEX_PERL ), ! ( string.split(".sql .spec .body .sps .spb .sf .sp"), scintillacon.SCLEX_SQL ), ! ( string.split(".tex .sty"), scintillacon.SCLEX_LATEX ), ! ( string.split(".xml .xul"), scintillacon.SCLEX_XML ), ! ( string.split(".err"), scintillacon.SCLEX_ERRORLIST ), ! ( string.split(".mak"), scintillacon.SCLEX_MAKEFILE ), ! ( string.split(".bat .cmd"), scintillacon.SCLEX_BATCH ), ] --- 516,530 ---- # These taken from the SciTE properties file. source_formatter_extensions = [ ! ( ".py .pys .pyw".split(), scintillacon.SCLEX_PYTHON ), ! ( ".html .htm .asp .shtml".split(), scintillacon.SCLEX_HTML ), ! ( "c .cc .cpp .cxx .h .hh .hpp .hxx .idl .odl .php3 .phtml .inc .js".split(), scintillacon.SCLEX_CPP ), ! ( ".vbs .frm .ctl .cls".split(), scintillacon.SCLEX_VB ), ! ( ".pl .pm .cgi .pod".split(), scintillacon.SCLEX_PERL ), ! ( ".sql .spec .body .sps .spb .sf .sp".split(), scintillacon.SCLEX_SQL ), ! ( ".tex .sty".split(), scintillacon.SCLEX_LATEX ), ! ( ".xml .xul".split(), scintillacon.SCLEX_XML ), ! ( ".err".split(), scintillacon.SCLEX_ERRORLIST ), ! ( ".mak".split(), scintillacon.SCLEX_MAKEFILE ), ! ( ".bat .cmd".split(), scintillacon.SCLEX_BATCH ), ] *************** *** 556,560 **** formatter_use = scintillacon.SCLEX_PYTHON sc.SendScintilla(scintillacon.SCI_SETLEXER, formatter_use) ! keywords = string.join(kwlist) sc.SCISetKeywords(keywords) --- 556,560 ---- formatter_use = scintillacon.SCLEX_PYTHON sc.SendScintilla(scintillacon.SCI_SETLEXER, formatter_use) ! keywords = ' '.join(kwlist) sc.SCISetKeywords(keywords) |
From: Roger U. <ru...@us...> - 2008-08-09 16:47:00
|
Update of /cvsroot/pywin32/pywin32/Pythonwin/pywin/framework In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8819/framework Modified Files: app.py bitmap.py cmdline.py help.py interact.py intpyapp.py mdi_pychecker.py scriptutils.py sgrepmdi.py stdin.py winout.py Log Message: Replace use of string module with string methods Index: intpyapp.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/framework/intpyapp.py,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** intpyapp.py 24 May 2007 13:48:37 -0000 1.10 --- intpyapp.py 9 Aug 2008 16:47:07 -0000 1.11 *************** *** 233,237 **** if args[0] and args[0][0]!='/': argStart = 0 ! argType = string.lower(win32ui.GetProfileVal("Python","Default Arg Type","/edit")) else: argStart = 1 --- 233,237 ---- if args[0] and args[0][0]!='/': argStart = 0 ! argType = win32ui.GetProfileVal("Python","Default Arg Type","/edit").lower() else: argStart = 1 *************** *** 248,261 **** elif argType=="/rundlg": if dde: ! dde.Exec("import scriptutils;scriptutils.RunScript('%s', '%s', 1)" % (args[argStart], string.join(args[argStart+1:]))) else: import scriptutils ! scriptutils.RunScript(args[argStart], string.join(args[argStart+1:])) elif argType=="/run": if dde: ! dde.Exec("import scriptutils;scriptutils.RunScript('%s', '%s', 0)" % (args[argStart], string.join(args[argStart+1:]))) else: import scriptutils ! scriptutils.RunScript(args[argStart], string.join(args[argStart+1:]), 0) elif argType=="/app": raise RuntimeError, "/app only supported for new instances of Pythonwin.exe" --- 248,261 ---- elif argType=="/rundlg": if dde: ! dde.Exec("import scriptutils;scriptutils.RunScript('%s', '%s', 1)" % (args[argStart], ' '.join(args[argStart+1:]))) else: import scriptutils ! scriptutils.RunScript(args[argStart], ' '.join(args[argStart+1:])) elif argType=="/run": if dde: ! dde.Exec("import scriptutils;scriptutils.RunScript('%s', '%s', 0)" % (args[argStart], ' '.join(args[argStart+1:]))) else: import scriptutils ! scriptutils.RunScript(args[argStart], ' '.join(args[argStart+1:]), 0) elif argType=="/app": raise RuntimeError, "/app only supported for new instances of Pythonwin.exe" *************** *** 289,293 **** def DoLoadModules(self, moduleNames): # ", sep string of module names. if not moduleNames: return ! modules = string.splitfields(moduleNames,",") for module in modules: try: --- 289,293 ---- def DoLoadModules(self, moduleNames): # ", sep string of module names. if not moduleNames: return ! modules = moduleNames.split(",") for module in modules: try: *************** *** 364,370 **** lastLocateFileName = name # if ".py" supplied, rip it off! ! if string.lower(lastLocateFileName[-3:])=='.py': lastLocateFileName = lastLocateFileName[:-3] ! lastLocateFileName = string.translate(lastLocateFileName, string.maketrans(".","\\")) newName = scriptutils.LocatePythonFile(lastLocateFileName) if newName is None: --- 364,371 ---- lastLocateFileName = name # if ".py" supplied, rip it off! ! # should also check for .pys and .pyw ! if lastLocateFileName[-3:].lower()=='.py': lastLocateFileName = lastLocateFileName[:-3] ! lastLocateFileName = lastLocateFileName.replace(".","\\") newName = scriptutils.LocatePythonFile(lastLocateFileName) if newName is None: Index: mdi_pychecker.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/framework/mdi_pychecker.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** mdi_pychecker.py 24 May 2007 13:48:37 -0000 1.1 --- mdi_pychecker.py 9 Aug 2008 16:47:07 -0000 1.2 *************** *** 52,60 **** class dirpath: def __init__(self, str, recurse=0): ! dp = string.split(str, ';') dirs = {} for d in dp: if os.path.isdir(d): ! d = string.lower(d) if not dirs.has_key(d): dirs[d] = None --- 52,60 ---- class dirpath: def __init__(self, str, recurse=0): ! dp = str.split(';') dirs = {} for d in dp: if os.path.isdir(d): ! d = d.lower() if not dirs.has_key(d): dirs[d] = None *************** *** 62,66 **** subdirs = getsubdirs(d) for sd in subdirs: ! sd = string.lower(sd) if not dirs.has_key(sd): dirs[sd] = None --- 62,66 ---- subdirs = getsubdirs(d) for sd in subdirs: ! sd = sd.lower() if not dirs.has_key(sd): dirs[sd] = None *************** *** 72,76 **** x = dirpath(os.environ[d]) elif d[:5] == 'HKEY_': ! keystr = string.split(d,'\\') try: root = eval('win32con.'+keystr[0]) --- 72,76 ---- x = dirpath(os.environ[d]) elif d[:5] == 'HKEY_': ! keystr = d.split('\\') try: root = eval('win32con.'+keystr[0]) *************** *** 78,82 **** win32ui.MessageBox("Can't interpret registry key name '%s'" % keystr[0]) try: ! subkey = string.join(keystr[1:], '\\') val = win32api.RegQueryValue(root, subkey) if val: --- 78,82 ---- win32ui.MessageBox("Can't interpret registry key name '%s'" % keystr[0]) try: ! subkey = '\\'.join(keystr[1:]) val = win32api.RegQueryValue(root, subkey) if val: *************** *** 95,99 **** subdirs = getsubdirs(xd) for sd in subdirs: ! sd = string.lower(sd) if not dirs.has_key(sd): dirs[sd] = None --- 95,99 ---- subdirs = getsubdirs(xd) for sd in subdirs: ! sd = sd.lower() if not dirs.has_key(sd): dirs[sd] = None *************** *** 147,151 **** doc = self.FindOpenDocument(fileName) if doc: return doc ! ext = string.lower(os.path.splitext(fileName)[1]) if ext =='.pychecker': return win32ui.CDocTemplate_Confidence_yesAttemptNative --- 147,151 ---- doc = self.FindOpenDocument(fileName) if doc: return doc ! ext = os.path.splitext(fileName)[1].lower() if ext =='.pychecker': return win32ui.CDocTemplate_Confidence_yesAttemptNative *************** *** 201,205 **** if paramstr is None: paramstr = win32ui.GetProfileVal("Pychecker", "Params", '\t\t\t1\t0\t0') ! params = string.split(paramstr, '\t') if len(params) < 3: params = params + ['']*(3-len(params)) --- 201,205 ---- if paramstr is None: paramstr = win32ui.GetProfileVal("Pychecker", "Params", '\t\t\t1\t0\t0') ! params = paramstr.split('\t') if len(params) < 3: params = params + ['']*(3-len(params)) *************** *** 251,255 **** self.GetFirstView().Append('# Files '+self.filpattern+'\n') self.GetFirstView().Append('# Options '+self.greppattern+'\n') ! self.fplist = string.split(self.filpattern,';') self.GetFirstView().Append('# Running... ( double click on result lines in order to jump to the source code ) \n') win32ui.SetStatusText("Pychecker running. Please wait...", 0) --- 251,255 ---- self.GetFirstView().Append('# Files '+self.filpattern+'\n') self.GetFirstView().Append('# Options '+self.greppattern+'\n') ! self.fplist = self.filpattern.split(';') self.GetFirstView().Append('# Running... ( double click on result lines in order to jump to the source code ) \n') win32ui.SetStatusText("Pychecker running. Please wait...", 0) *************** *** 395,399 **** if regexGrepResult: fname = regexGrepResult.group(1) ! line = string.atoi(regexGrepResult.group(2)) scriptutils.JumpToDocument(fname, line) return 0 # dont pass on --- 395,399 ---- if regexGrepResult: fname = regexGrepResult.group(1) ! line = int(regexGrepResult.group(2)) scriptutils.JumpToDocument(fname, line) return 0 # dont pass on *************** *** 409,413 **** if regexGrepResult: self.fnm = regexGrepResult.group(1) ! self.lnnum = string.atoi(regexGrepResult.group(2)) menu.AppendMenu(flags, ID_OPEN_FILE, "&Open "+self.fnm) menu.AppendMenu(flags, ID_ADDCOMMENT, "&Add to source: Comment Tag/#$pycheck_no ..") --- 409,413 ---- if regexGrepResult: self.fnm = regexGrepResult.group(1) ! self.lnnum = int(regexGrepResult.group(2)) menu.AppendMenu(flags, ID_OPEN_FILE, "&Open "+self.fnm) menu.AppendMenu(flags, ID_ADDCOMMENT, "&Add to source: Comment Tag/#$pycheck_no ..") *************** *** 444,448 **** ##import pywin.debugger;pywin.debugger.set_trace() fname = m.group(1) ! line = string.atoi(m.group(2)) view = scriptutils.JumpToDocument(fname,line) pos=view.LineIndex(line)-1 --- 444,448 ---- ##import pywin.debugger;pywin.debugger.set_trace() fname = m.group(1) ! line = int(m.group(2)) view = scriptutils.JumpToDocument(fname,line) pos=view.LineIndex(line)-1 *************** *** 465,469 **** #hope you have an editor that implements GotoLine()! try: ! vw.GotoLine(string.atoi(self.lnnum)) except: pass --- 465,469 ---- #hope you have an editor that implements GotoLine()! try: ! vw.GotoLine(int(self.lnnum)) except: pass *************** *** 472,478 **** def OnCmdThe(self, cmd, code): curparamsstr = self.GetDocument().GetParams() ! params = string.split(curparamsstr,'\t') params[2] = self.sel ! greptemplate.setParams(string.join(params,'\t')) greptemplate.OpenDocumentFile() return 0 --- 472,478 ---- def OnCmdThe(self, cmd, code): curparamsstr = self.GetDocument().GetParams() ! params = curparamsstr.split('\t') params[2] = self.sel ! greptemplate.setParams('\t'.join(params)) greptemplate.OpenDocumentFile() return 0 *************** *** 546,553 **** items = [] for secitem in secitems: ! items.append(string.split(secitem,'=')[1]) dlg = TheParamsDialog(items) if dlg.DoModal() == win32con.IDOK: ! itemstr = string.join(dlg.getItems(),';') self._obj_.data[key] = itemstr #update the ini file with dlg.getNew() --- 546,553 ---- items = [] for secitem in secitems: ! items.append(secitem.split('=')[1]) dlg = TheParamsDialog(items) if dlg.DoModal() == win32con.IDOK: ! itemstr = ';'.join(dlg.getItems()) self._obj_.data[key] = itemstr #update the ini file with dlg.getNew() Index: stdin.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/framework/stdin.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** stdin.py 15 Apr 2001 13:14:43 -0000 1.2 --- stdin.py 9 Aug 2008 16:47:07 -0000 1.3 *************** *** 70,74 **** if '\n' in self.buffer[:maximum_result_size]: ! result_size = string.find(self.buffer, '\n', 0, maximum_result_size) + 1 assert(result_size > 0) else: --- 70,74 ---- if '\n' in self.buffer[:maximum_result_size]: ! result_size = self.buffer.find('\n', 0, maximum_result_size) + 1 assert(result_size > 0) else: *************** *** 155,159 **** end_of_line_pos = len(test_input) else: ! end_of_line_pos = string.find(test_input, '\n') result = test_input[:end_of_line_pos] test_input = test_input[end_of_line_pos + 1:] --- 155,159 ---- end_of_line_pos = len(test_input) else: ! end_of_line_pos = test_input.find('\n') result = test_input[:end_of_line_pos] test_input = test_input[end_of_line_pos + 1:] Index: interact.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/framework/interact.py,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** interact.py 19 Jun 2008 02:08:57 -0000 1.16 --- interact.py 9 Aug 2008 16:47:07 -0000 1.17 *************** *** 332,336 **** terms = (["\n" + sys.ps2] * (len(bufLines)-1)) + [''] for bufLine, term in map(None, bufLines, terms): ! if string.strip(bufLine): self.write( bufLine + term ) self.flush() --- 332,336 ---- terms = (["\n" + sys.ps2] * (len(bufLines)-1)) + [''] for bufLine, term in map(None, bufLines, terms): ! if bufLine.strip(): self.write( bufLine + term ) self.flush() *************** *** 473,477 **** self.SetSel(-2) self.ReplaceSel("\n") ! source = string.join(lines, '\n') while source and source[-1] in '\t ': source = source[:-1] --- 473,477 ---- self.SetSel(-2) self.ReplaceSel("\n") ! source = '\n'.join(lines) while source and source[-1] in '\t ': source = source[:-1] Index: cmdline.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/framework/cmdline.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** cmdline.py 5 May 2000 13:55:22 -0000 1.2 --- cmdline.py 9 Aug 2008 16:47:07 -0000 1.3 *************** *** 19,23 **** pos=pos+1 try: ! endPos = string.index(str, '"', pos)-1 nextPos = endPos+2 except ValueError: --- 19,23 ---- pos=pos+1 try: ! endPos = str.index('"', pos)-1 nextPos = endPos+2 except ValueError: *************** *** 28,32 **** while endPos<length and not str[endPos] in string.whitespace: endPos = endPos+1 nextPos=endPos+1 ! ret.append(string.strip(str[pos:endPos+1])) pos = nextPos return ret --- 28,32 ---- while endPos<length and not str[endPos] in string.whitespace: endPos = endPos+1 nextPos=endPos+1 ! ret.append(str[pos:endPos+1].strip()) pos = nextPos return ret Index: app.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/framework/app.py,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** app.py 10 Feb 2008 13:33:31 -0000 1.12 --- app.py 9 Aug 2008 16:47:07 -0000 1.13 *************** *** 233,242 **** # Load the users/application paths new_path = [] ! apppath=string.splitfields(win32ui.GetProfileVal('Python','Application Path',''),';') for path in apppath: if len(path)>0: new_path.append(win32ui.FullPath(path)) for extra_num in range(1,11): ! apppath=string.splitfields(win32ui.GetProfileVal('Python','Application Path %d'%extra_num,''),';') if len(apppath) == 0: break --- 233,242 ---- # Load the users/application paths new_path = [] ! apppath=win32ui.GetProfileVal('Python','Application Path','').split(';') for path in apppath: if len(path)>0: new_path.append(win32ui.FullPath(path)) for extra_num in range(1,11): ! apppath=win32ui.GetProfileVal('Python','Application Path %d'%extra_num,'').split(';') if len(apppath) == 0: break Index: sgrepmdi.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/framework/sgrepmdi.py,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** sgrepmdi.py 25 Feb 2008 12:27:35 -0000 1.6 --- sgrepmdi.py 9 Aug 2008 16:47:07 -0000 1.7 *************** *** 42,50 **** class dirpath: def __init__(self, str, recurse=0): ! dp = string.split(str, ';') dirs = {} for d in dp: if os.path.isdir(d): ! d = string.lower(d) if not dirs.has_key(d): dirs[d] = None --- 42,50 ---- class dirpath: def __init__(self, str, recurse=0): ! dp = str.split(';') dirs = {} for d in dp: if os.path.isdir(d): ! d = d.lower() if not dirs.has_key(d): dirs[d] = None *************** *** 52,56 **** subdirs = getsubdirs(d) for sd in subdirs: ! sd = string.lower(sd) if not dirs.has_key(sd): dirs[sd] = None --- 52,56 ---- subdirs = getsubdirs(d) for sd in subdirs: ! sd = sd.lower() if not dirs.has_key(sd): dirs[sd] = None *************** *** 62,66 **** x = dirpath(os.environ[d]) elif d[:5] == 'HKEY_': ! keystr = string.split(d,'\\') try: root = eval('win32con.'+keystr[0]) --- 62,66 ---- x = dirpath(os.environ[d]) elif d[:5] == 'HKEY_': ! keystr = d.split('\\') try: root = eval('win32con.'+keystr[0]) *************** *** 68,72 **** win32ui.MessageBox("Can't interpret registry key name '%s'" % keystr[0]) try: ! subkey = string.join(keystr[1:], '\\') val = win32api.RegQueryValue(root, subkey) if val: --- 68,72 ---- win32ui.MessageBox("Can't interpret registry key name '%s'" % keystr[0]) try: ! subkey = '\\'.join(keystr[1:]) val = win32api.RegQueryValue(root, subkey) if val: *************** *** 85,89 **** subdirs = getsubdirs(xd) for sd in subdirs: ! sd = string.lower(sd) if not dirs.has_key(sd): dirs[sd] = None --- 85,89 ---- subdirs = getsubdirs(xd) for sd in subdirs: ! sd = sd.lower() if not dirs.has_key(sd): dirs[sd] = None *************** *** 137,141 **** doc = self.FindOpenDocument(fileName) if doc: return doc ! ext = string.lower(os.path.splitext(fileName)[1]) if ext =='.grep': return win32ui.CDocTemplate_Confidence_yesAttemptNative --- 137,141 ---- doc = self.FindOpenDocument(fileName) if doc: return doc ! ext = os.path.splitext(fileName)[1].lower() if ext =='.grep': return win32ui.CDocTemplate_Confidence_yesAttemptNative *************** *** 191,195 **** if paramstr is None: paramstr = win32ui.GetProfileVal("Grep", "Params", '\t\t\t1\t0\t0') ! params = string.split(paramstr, '\t') if len(params) < 3: params = params + ['']*(3-len(params)) --- 191,195 ---- if paramstr is None: paramstr = win32ui.GetProfileVal("Grep", "Params", '\t\t\t1\t0\t0') ! params = paramstr.split('\t') if len(params) < 3: params = params + ['']*(3-len(params)) *************** *** 237,241 **** self.GetFirstView().Append('# Files '+self.filpattern+'\n') self.GetFirstView().Append('# For '+self.greppattern+'\n') ! self.fplist = string.split(self.filpattern,';') if self.casesensitive: self.pat = re.compile(self.greppattern) --- 237,241 ---- self.GetFirstView().Append('# Files '+self.filpattern+'\n') self.GetFirstView().Append('# For '+self.greppattern+'\n') ! self.fplist = self.filpattern.split(';') if self.casesensitive: self.pat = re.compile(self.greppattern) *************** *** 327,331 **** if regexGrepResult: fname = regexGrepResult.group(1) ! line = string.atoi(regexGrepResult.group(2)) scriptutils.JumpToDocument(fname, line) return 0 # dont pass on --- 327,331 ---- if regexGrepResult: fname = regexGrepResult.group(1) ! line = int(regexGrepResult.group(2)) scriptutils.JumpToDocument(fname, line) return 0 # dont pass on *************** *** 340,344 **** if regexGrepResult: self.fnm = regexGrepResult.group(1) ! self.lnnum = string.atoi(regexGrepResult.group(2)) menu.AppendMenu(flags, ID_OPEN_FILE, "&Open "+self.fnm) menu.AppendMenu(win32con.MF_SEPARATOR) --- 340,344 ---- if regexGrepResult: self.fnm = regexGrepResult.group(1) ! self.lnnum = int(regexGrepResult.group(2)) menu.AppendMenu(flags, ID_OPEN_FILE, "&Open "+self.fnm) menu.AppendMenu(win32con.MF_SEPARATOR) *************** *** 366,370 **** #hope you have an editor that implements GotoLine()! try: ! vw.GotoLine(string.atoi(self.lnnum)) except: pass --- 366,370 ---- #hope you have an editor that implements GotoLine()! try: ! vw.GotoLine(int(self.lnnum)) except: pass *************** *** 373,379 **** def OnCmdGrep(self, cmd, code): curparamsstr = self.GetDocument().GetParams() ! params = string.split(curparamsstr,'\t') params[2] = self.sel ! greptemplate.setParams(string.join(params,'\t')) greptemplate.OpenDocumentFile() return 0 --- 373,379 ---- def OnCmdGrep(self, cmd, code): curparamsstr = self.GetDocument().GetParams() ! params = curparamsstr.split('\t') params[2] = self.sel ! greptemplate.setParams('\t'.join(params)) greptemplate.OpenDocumentFile() return 0 *************** *** 447,454 **** items = [] for secitem in secitems: ! items.append(string.split(secitem,'=')[1]) dlg = GrepParamsDialog(items) if dlg.DoModal() == win32con.IDOK: ! itemstr = string.join(dlg.getItems(),';') self._obj_.data[key] = itemstr #update the ini file with dlg.getNew() --- 447,454 ---- items = [] for secitem in secitems: ! items.append(secitem.split('=')[1]) dlg = GrepParamsDialog(items) if dlg.DoModal() == win32con.IDOK: ! itemstr = ';'.join(dlg.getItems()) self._obj_.data[key] = itemstr #update the ini file with dlg.getNew() Index: help.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/framework/help.py,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** help.py 19 May 2008 13:55:01 -0000 1.11 --- help.py 9 Aug 2008 16:47:07 -0000 1.12 *************** *** 34,38 **** try: if helpCmd is None: helpCmd = win32con.HELP_CONTENTS ! ext = string.lower(os.path.splitext(fileName)[1]) if ext == ".hlp": win32api.WinHelp( win32ui.GetMainFrame().GetSafeHwnd(), fileName, helpCmd, helpArg) --- 34,38 ---- try: if helpCmd is None: helpCmd = win32con.HELP_CONTENTS ! ext = os.path.splitext(fileName)[1].lower() if ext == ".hlp": win32api.WinHelp( win32ui.GetMainFrame().GetSafeHwnd(), fileName, helpCmd, helpArg) Index: winout.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/framework/winout.py,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** winout.py 22 Mar 2006 10:50:44 -0000 1.13 --- winout.py 9 Aug 2008 16:47:07 -0000 1.14 *************** *** 125,129 **** try: import win32api, win32con ! det = eval(string.strip(line[string.find(line,":")+1:])) win32ui.SetStatusText("Opening help file on OLE error..."); import help --- 125,129 ---- try: import win32api, win32con ! det = eval(line[line.find(":")+1:].strip()) win32ui.SetStatusText("Opening help file on OLE error..."); import help *************** *** 164,168 **** win32ui.SetStatusText("Jumping to line "+lineNoString+" of file "+fileName,1) ! if not scriptutils.JumpToDocument(fileName, string.atoi(lineNoString)): win32ui.SetStatusText("Could not open %s" % fileName) return 1 # still was an error message. --- 164,168 ---- win32ui.SetStatusText("Jumping to line "+lineNoString+" of file "+fileName,1) ! if not scriptutils.JumpToDocument(fileName, int(lineNoString)): win32ui.SetStatusText("Could not open %s" % fileName) return 1 # still was an error message. *************** *** 456,460 **** return 1 # In trouble - so say we have nothing to do. win32ui.PumpWaitingMessages() # Pump paint messages ! self.currentView.dowrite(string.join(items,'')) return rc --- 456,460 ---- return 1 # In trouble - so say we have nothing to do. win32ui.PumpWaitingMessages() # Pump paint messages ! self.currentView.dowrite(''.join(items)) return rc *************** *** 466,470 **** # debug("not my thread - ignoring queue options!\n") elif self.writeQueueing==flags.WQ_LINE: ! pos = string.rfind(message, '\n') if pos>=0: # debug("Line queueing - forcing flush\n") --- 466,470 ---- # debug("not my thread - ignoring queue options!\n") elif self.writeQueueing==flags.WQ_LINE: ! pos = message.rfind('\n') if pos>=0: # debug("Line queueing - forcing flush\n") Index: bitmap.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/framework/bitmap.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** bitmap.py 1 Sep 1999 23:33:44 -0000 1.1 --- bitmap.py 9 Aug 2008 16:47:07 -0000 1.2 *************** *** 104,108 **** doc = self.FindOpenDocument(fileName) if doc: return doc ! ext = string.lower(os.path.splitext(fileName)[1]) if ext =='.bmp': # removed due to PIL! or ext=='.ppm': return win32ui.CDocTemplate_Confidence_yesAttemptNative --- 104,108 ---- doc = self.FindOpenDocument(fileName) if doc: return doc ! ext = os.path.splitext(fileName)[1].lower() if ext =='.bmp': # removed due to PIL! or ext=='.ppm': return win32ui.CDocTemplate_Confidence_yesAttemptNative Index: scriptutils.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/framework/scriptutils.py,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** scriptutils.py 26 Feb 2008 06:40:23 -0000 1.16 --- scriptutils.py 9 Aug 2008 16:47:07 -0000 1.17 *************** *** 23,30 **** RS_DEBUGGER_PM=3 # Dont run under debugger, but do post-mortem analysis on exception. ! debugging_options = string.split("""No debugging Step-through in the debugger Run in the debugger ! Post-Mortem of unhandled exceptions""", "\n") # A dialog box for the "Run Script" command. --- 23,30 ---- RS_DEBUGGER_PM=3 # Dont run under debugger, but do post-mortem analysis on exception. ! debugging_options = """No debugging Step-through in the debugger Run in the debugger ! Post-Mortem of unhandled exceptions""".split("\n") # A dialog box for the "Run Script" command. *************** *** 99,108 **** # If on path, _and_ existing package of that name loaded. if IsOnPythonPath(path) and sys.modules.has_key(modBit) and \ ! ( os.path.exists(os.path.join(path, '__init__.py')) or \ ! os.path.exists(os.path.join(path, '__init__.pyc')) or \ ! os.path.exists(os.path.join(path, '__init__.pyo')) \ ! ): modBits.reverse() ! return string.join(modBits, ".") + "." + fname, newPathReturn # Not found - look a level higher else: --- 99,108 ---- # If on path, _and_ existing package of that name loaded. if IsOnPythonPath(path) and sys.modules.has_key(modBit) and \ ! ( os.path.exists(os.path.join(path, '__init__.py')) or \ ! os.path.exists(os.path.join(path, '__init__.pyc')) or \ ! os.path.exists(os.path.join(path, '__init__.pyo')) \ ! ): modBits.reverse() ! return ".".join(modBits) + "." + fname, newPathReturn # Not found - look a level higher else: *************** *** 363,367 **** if pathName is not None: ! if string.lower(os.path.splitext(pathName)[1]) <> ".py": pathName = None --- 363,367 ---- if pathName is not None: ! if os.path.splitext(pathName)[1].lower() <> ".py": pathName = None *************** *** 383,387 **** fname = mod.__file__ base, ext = os.path.splitext(fname) ! if string.lower(ext) in ['.pyo', '.pyc']: ext = '.py' fname = base + ext --- 383,387 ---- fname = mod.__file__ base, ext = os.path.splitext(fname) ! if ext.lower() in ['.pyo', '.pyc']: ext = '.py' fname = base + ext *************** *** 400,404 **** bNeedReload = 0 ! win32ui.SetStatusText(string.capitalize(what)+'ing module...',1) win32ui.DoWaitCursor(1) # win32ui.GetMainFrame().BeginWaitCursor() --- 400,404 ---- bNeedReload = 0 ! win32ui.SetStatusText(what.capitalize()+'ing module...',1) win32ui.DoWaitCursor(1) # win32ui.GetMainFrame().BeginWaitCursor() *************** *** 432,436 **** what = "check" ! win32ui.SetStatusText(string.capitalize(what)+'ing module...',1) win32ui.DoWaitCursor(1) try: --- 432,436 ---- what = "check" ! win32ui.SetStatusText(what.capitalize()+'ing module...',1) win32ui.DoWaitCursor(1) try: *************** *** 473,477 **** if data: try: ! lineno = string.split(data)[1] lineno = int(lineno) _JumpToPosition(filename, lineno) --- 473,477 ---- if data: try: ! lineno = data.split()[1] lineno = int(lineno) _JumpToPosition(filename, lineno) |
From: Roger U. <ru...@us...> - 2008-08-09 16:47:00
|
Update of /cvsroot/pywin32/pywin32/Pythonwin/pywin/tools In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8819/tools Modified Files: browseProjects.py browser.py Log Message: Replace use of string module with string methods Index: browser.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/tools/browser.py,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** browser.py 26 Feb 2008 02:22:49 -0000 1.9 --- browser.py 9 Aug 2008 16:47:08 -0000 1.10 *************** *** 125,129 **** return "DocString" def GetText(self): ! return string.strip(self.myobject) def IsExpandable(self): return 0 --- 125,129 ---- return "DocString" def GetText(self): ! return self.myobject.strip() def IsExpandable(self): return 0 Index: browseProjects.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/tools/browseProjects.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** browseProjects.py 13 Jul 2004 05:29:53 -0000 1.2 --- browseProjects.py 9 Aug 2008 16:47:08 -0000 1.3 *************** *** 123,127 **** ret.append(HLIDirectoryItem(filename, os.path.split(filename)[1])) else: ! if string.lower(os.path.splitext(filename)[1]) in ['.py', '.pyw']: ret.append(HLIModuleItem(filename)) return ret --- 123,127 ---- ret.append(HLIDirectoryItem(filename, os.path.split(filename)[1])) else: ! if os.path.splitext(filename)[1].lower() in ['.py', '.pyw']: ret.append(HLIModuleItem(filename)) return ret *************** *** 162,166 **** def GetSubList(self): paths = regutil.GetRegisteredNamedPath(self.projectName) ! pathList = string.split(paths,";") if len(pathList)==1: # Single dir - dont bother putting the dir in ret = MakePathSubList(pathList[0]) --- 162,166 ---- def GetSubList(self): paths = regutil.GetRegisteredNamedPath(self.projectName) ! pathList = paths.split(";") if len(pathList)==1: # Single dir - dont bother putting the dir in ret = MakePathSubList(pathList[0]) |