From 11fda911512fe80b5d3c1584acc66bbe06cca80b Mon Sep 17 00:00:00 2001 From: Avasam Date: Tue, 28 May 2024 03:51:36 -0400 Subject: [PATCH 01/21] Ensure modern type annotation best practices and modern syntax (#2258) --- .github/workflows/main.yml | 16 ++++++++-------- .pre-commit-config.yaml | 2 +- ruff.toml | 11 ++++++++++- setup.py | 6 +++--- win32/Lib/win32gui_struct.py | 3 ++- 5 files changed, 24 insertions(+), 14 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 686787752..aa6ecd69c 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -17,8 +17,8 @@ jobs: strategy: fail-fast: false matrix: - python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12-dev'] - architecture: ['x64', 'x86'] + python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12-dev"] + architecture: ["x64", "x86"] steps: - uses: actions/checkout@v4 @@ -66,7 +66,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: ['3.10', '3.11', '3.12-dev'] + python-version: ["3.10", "3.11", "3.12-dev"] steps: - uses: actions/checkout@v4 @@ -75,7 +75,7 @@ jobs: uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - architecture: 'x64' + architecture: "x64" cache: pip cache-dependency-path: .github/workflows/main.yml @@ -107,14 +107,14 @@ jobs: - uses: actions/setup-python@v5 with: # This job only needs to target the oldest supported version (black@stable supports Python >=3.8) - python-version: '3.8' + python-version: "3.8" cache: pip cache-dependency-path: .github/workflows/main.yml - run: pip install pycln - run: pycln . --config=pycln.toml --check - uses: chartboost/ruff-action@v1 with: - version: '0.3.7' + version: "0.4.5" - uses: psf/black@stable with: options: "--fast --check --diff --verbose" @@ -125,7 +125,7 @@ jobs: fail-fast: false matrix: # mypy 1.5 dropped support for Python 3.7 - python-version: ['3.8', '3.9', '3.10', '3.11', '3.12'] + python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v5 @@ -141,7 +141,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12'] + python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"] steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v5 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index a2baeca37..ea5bb9cdd 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -28,7 +28,7 @@ repos: args: [--config=pycln.toml] verbose: true - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.3.7 + rev: v0.4.5 hooks: - id: ruff # Run the linter. args: [--fix] diff --git a/ruff.toml b/ruff.toml index 59f722965..733c24839 100644 --- a/ruff.toml +++ b/ruff.toml @@ -3,8 +3,17 @@ target-version = "py37" [lint] select = [ - "I", # isort + "I", # isort "PLC", # Pylint Convention + # Ensure modern type annotation syntax and best practices + # Not including those covered by type-checkers + "FA", # flake8-future-annotations + "F404", # late-future-import + "PYI", # flake8-pyi + "UP006", # non-pep585-annotation + "UP007", # non-pep604-annotation + "UP010", # unnecessary-future-import + "UP037", # quoted-annotation ] [lint.per-file-ignores] diff --git a/setup.py b/setup.py index 44a542b47..03bc1dd73 100644 --- a/setup.py +++ b/setup.py @@ -41,7 +41,7 @@ from setuptools.command.install import install from setuptools.command.install_lib import install_lib from tempfile import gettempdir -from typing import Iterable, List, Tuple, Union +from typing import Iterable from distutils import ccompiler from distutils._msvccompiler import MSVCCompiler @@ -2089,7 +2089,7 @@ def finalize_options(self): swig_include_files = "mapilib adsilib".split() -def expand_modules(module_dir: Union[str, os.PathLike[str]]): +def expand_modules(module_dir: str | os.PathLike[str]): """Helper to allow our script specifications to include wildcards.""" return [str(path.with_suffix("")) for path in Path(module_dir).rglob("*.py")] @@ -2100,7 +2100,7 @@ def expand_modules(module_dir: Union[str, os.PathLike[str]]): # 'Lib/site-packages/pythonwin/licence.txt'. We exploit this to # get 'com/win32com/whatever' installed to 'win32com/whatever' def convert_data_files(files: Iterable[str]): - ret: List[Tuple[str, Tuple[str]]] = [] + ret: list[tuple[str, tuple[str]]] = [] for file in files: file = os.path.normpath(file) if file.find("*") >= 0: diff --git a/win32/Lib/win32gui_struct.py b/win32/Lib/win32gui_struct.py index bf4c9c6be..62e52648c 100644 --- a/win32/Lib/win32gui_struct.py +++ b/win32/Lib/win32gui_struct.py @@ -40,7 +40,8 @@ def _MakeResult(names_str, values): names = names_str.split() - nt = namedtuple(names[0], names[1:]) + # TODO: Dynamic namedtuple. This could be made static, also exposing the types + nt = namedtuple(names[0], names[1:]) # noqa: PYI024 return nt(*values) From d7fc9a3b9f89d5ef2bb686aa12efc92b9bb22788 Mon Sep 17 00:00:00 2001 From: Mark Hammond Date: Tue, 28 May 2024 09:11:55 -0400 Subject: [PATCH 02/21] SAFEARRAY(VT_RECORD) missing last element. (#2263) Fixes #2247. Co-authored-by: Avasam --- CHANGES.txt | 3 ++- com/win32com/src/PyRecord.cpp | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index 9e2ac1213..08d8e393f 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,4 +1,4 @@ -Notable changes in recent builds. +Notable changes in recent builds. Maintained by hand, so what's "notable" is subjective! Contributors are encouraged to add entries for their work. @@ -14,6 +14,7 @@ https://mhammond.github.io/pywin32_installers.html. Coming in build 307, as yet unreleased -------------------------------------- ### pywin32 +* Fixed VT_SAFEARRAY(VT_RECORD) which were missing the last element (#2247) * Fixed `MFC redist DLLs not found` by preferring corresponding version but accepting different version (#2248, @andreabravetti) * Fixed `pywintypes.error: (5, 'RegOpenKeyEx', 'Access is denied.')` when running service with debug parameter and no elevation (#2238, @jmartens) * Fixed handling of `SyntaxError` exception from a Windows Scripting Host Python Script on Python 3.10+ (#2235, @nbbeatty) diff --git a/com/win32com/src/PyRecord.cpp b/com/win32com/src/PyRecord.cpp index b26a4db29..05e93d3fe 100644 --- a/com/win32com/src/PyRecord.cpp +++ b/com/win32com/src/PyRecord.cpp @@ -71,7 +71,7 @@ PyObject *PyObject_FromSAFEARRAYRecordInfo(SAFEARRAY *psa) hr = SafeArrayGetLBound(psa, 1, &lbound); if (FAILED(hr)) goto exit; - nelems = ubound - lbound; + nelems = ubound - lbound + 1; hr = info->GetSize(&cb_elem); if (FAILED(hr)) goto exit; @@ -522,7 +522,7 @@ PyObject *PyRecord::getattro(PyObject *self, PyObject *obname) hr = sub->GetSize(&element_size); if (FAILED(hr)) goto array_end; - nelems = ubound - lbound; + nelems = ubound - lbound + 1; ret_tuple = PyTuple_New(nelems); if (ret_tuple == NULL) goto array_end; From 518ac84adeab062879f72faefa7a9f6f24b54b35 Mon Sep 17 00:00:00 2001 From: Avasam Date: Tue, 28 May 2024 09:24:53 -0400 Subject: [PATCH 03/21] Fix `py.exe -m win32verstamp` command and other ISC typos (#2225) --- CHANGES.txt | 2 ++ Pythonwin/pywin/test/test_pywin.py | 2 +- pywin32_postinstall.py | 2 +- setup.py | 2 +- win32/Demos/NetValidatePasswordPolicy.py | 2 +- win32/Demos/security/setkernelobjectsecurity.py | 4 ++-- win32/Demos/security/setnamedsecurityinfo.py | 4 ++-- win32/Demos/security/setsecurityinfo.py | 4 ++-- win32/Demos/security/sspi/socket_server.py | 2 +- win32/test/test_odbc.py | 6 +++--- 10 files changed, 16 insertions(+), 14 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index 08d8e393f..101ff94f1 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -13,7 +13,9 @@ https://mhammond.github.io/pywin32_installers.html. Coming in build 307, as yet unreleased -------------------------------------- + ### pywin32 +* Fixed `py.exe -m win32verstamp` command and other quote typos caused by Implied String Concatenation (#2225, @Avasam) * Fixed VT_SAFEARRAY(VT_RECORD) which were missing the last element (#2247) * Fixed `MFC redist DLLs not found` by preferring corresponding version but accepting different version (#2248, @andreabravetti) * Fixed `pywintypes.error: (5, 'RegOpenKeyEx', 'Access is denied.')` when running service with debug parameter and no elevation (#2238, @jmartens) diff --git a/Pythonwin/pywin/test/test_pywin.py b/Pythonwin/pywin/test/test_pywin.py index 14b4430e2..6389de930 100644 --- a/Pythonwin/pywin/test/test_pywin.py +++ b/Pythonwin/pywin/test/test_pywin.py @@ -377,7 +377,7 @@ def t_print(*args): pywin.scintilla.IDLEenvironment.test() ed = scriptutils.GetActiveEditControl() doc = ed.GetDocument() - assert "hi " "there" in ed.GetTextRange() + assert "hi there" in ed.GetTextRange() assert doc.IsModified() # edit w auto-indent diff --git a/pywin32_postinstall.py b/pywin32_postinstall.py index b1b9cdd21..bddb8ccd3 100644 --- a/pywin32_postinstall.py +++ b/pywin32_postinstall.py @@ -260,7 +260,7 @@ def RegisterHelpFile(register=True, lib_dir=None): SetPyKeyVal("Help\\Pythonwin Reference", None, chm_file) return chm_file else: - print("NOTE: PyWin32.chm can not be located, so has not " "been registered") + print("NOTE: PyWin32.chm can not be located, so has not been registered") else: UnsetPyKeyVal("Help\\Pythonwin Reference", None, delete_key=True) return None diff --git a/setup.py b/setup.py index 03bc1dd73..4c50fb6fd 100644 --- a/setup.py +++ b/setup.py @@ -995,7 +995,7 @@ def link( # allow --skip-verstamp on the cmdline - but if it's not there, the # verstamp must work.) if not skip_verstamp: - args = ["py.exe", "-m" "win32verstamp"] + args = ["py.exe", "-m", "win32verstamp"] args.append(f"--version={pywin32_version}") args.append("--comments=https://github.com/mhammond/pywin32") args.append(f"--original-filename={os.path.basename(output_filename)}") diff --git a/win32/Demos/NetValidatePasswordPolicy.py b/win32/Demos/NetValidatePasswordPolicy.py index 86c3bc40b..be9f3aa34 100644 --- a/win32/Demos/NetValidatePasswordPolicy.py +++ b/win32/Demos/NetValidatePasswordPolicy.py @@ -43,7 +43,7 @@ def main(): "-u", "--username", action="store", - help="The username to pass to the function (only for the " "change command", + help="The username to pass to the function (only for the 'change' command)", ) parser.add_option( diff --git a/win32/Demos/security/setkernelobjectsecurity.py b/win32/Demos/security/setkernelobjectsecurity.py index 34c8f4469..f82a7de51 100644 --- a/win32/Demos/security/setkernelobjectsecurity.py +++ b/win32/Demos/security/setkernelobjectsecurity.py @@ -112,9 +112,9 @@ new_sd = win32security.GetKernelObjectSecurity(ph, all_info) if new_sd.GetSecurityDescriptorDacl().GetAceCount() != dacl_ace_cnt + 1: - print("New dacl doesn" "t contain extra ace ????") + 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 ????") + print("New Sacl doesn't contain extra ace ????") if ( win32security.LookupAccountSid("", new_sd.GetSecurityDescriptorOwner())[0] != "Power Users" diff --git a/win32/Demos/security/setnamedsecurityinfo.py b/win32/Demos/security/setnamedsecurityinfo.py index 8915a0df1..6b5c342d2 100644 --- a/win32/Demos/security/setnamedsecurityinfo.py +++ b/win32/Demos/security/setnamedsecurityinfo.py @@ -101,9 +101,9 @@ ## 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 ????") + 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 ????") + print("New Sacl doesn't contain extra ace ????") if ( win32security.LookupAccountSid("", new_sd.GetSecurityDescriptorOwner())[0] != "Power Users" diff --git a/win32/Demos/security/setsecurityinfo.py b/win32/Demos/security/setsecurityinfo.py index d784d9509..a06a54390 100644 --- a/win32/Demos/security/setsecurityinfo.py +++ b/win32/Demos/security/setsecurityinfo.py @@ -102,9 +102,9 @@ new_sd = win32security.GetSecurityInfo(ph, win32security.SE_KERNEL_OBJECT, all_info) if new_sd.GetSecurityDescriptorDacl().GetAceCount() != dacl_ace_cnt + 1: - print("New dacl doesn" "t contain extra ace ????") + 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 ????") + print("New Sacl doesn't contain extra ace ????") if ( win32security.LookupAccountSid("", new_sd.GetSecurityDescriptorOwner())[0] != "Power Users" diff --git a/win32/Demos/security/sspi/socket_server.py b/win32/Demos/security/sspi/socket_server.py index 6bf3806bb..09f005b46 100644 --- a/win32/Demos/security/sspi/socket_server.py +++ b/win32/Demos/security/sspi/socket_server.py @@ -187,7 +187,7 @@ def sspi_client(): serve() else: parser.error( - "You must supply 'client' or 'server' - " "use --help for details" + "You must supply 'client' or 'server' - use --help for details" ) except KeyboardInterrupt: pass diff --git a/win32/test/test_odbc.py b/win32/test/test_odbc.py index 85b577357..7b61cb354 100644 --- a/win32/test/test_odbc.py +++ b/win32/test/test_odbc.py @@ -225,7 +225,7 @@ def testDates(self): def test_set_nonzero_length(self): self.assertEqual( self.cur.execute( - "insert into %s (userid,username) " "values (?,?)" % self.tablename, + "insert into %s (userid,username) values (?,?)" % self.tablename, ["Frank", "Frank Millman"], ), 1, @@ -240,7 +240,7 @@ def test_set_nonzero_length(self): def test_set_zero_length(self): self.assertEqual( self.cur.execute( - "insert into %s (userid,username) " "values (?,?)" % self.tablename, + "insert into %s (userid,username) values (?,?)" % self.tablename, [b"Frank", ""], ), 1, @@ -251,7 +251,7 @@ def test_set_zero_length(self): def test_set_zero_length_unicode(self): self.assertEqual( self.cur.execute( - "insert into %s (userid,username) " "values (?,?)" % self.tablename, + "insert into %s (userid,username) values (?,?)" % self.tablename, ["Frank", ""], ), 1, From 31a6ff785d5a94844ed4fc795e6ca172116a491b Mon Sep 17 00:00:00 2001 From: Avasam Date: Tue, 28 May 2024 09:26:28 -0400 Subject: [PATCH 04/21] Remove trailing whitespaces not handled by black (#2222) --- Pythonwin/pywin/dialogs/login.py | 2 +- com/win32com/makegw/makegw.py | 11 ++-- com/win32com/makegw/makegwenum.py | 6 +- com/win32com/makegw/makegwparse.py | 2 +- com/win32com/server/exception.py | 5 +- com/win32com/server/policy.py | 65 +++++++++---------- com/win32com/server/util.py | 3 +- com/win32com/test/testGIT.py | 7 +- com/win32comext/axscript/test/testHost.py | 4 +- .../shell/demos/explorer_browser.py | 2 +- win32/Demos/win32rcparser_demo.py | 2 +- win32/Lib/win32pdhquery.py | 19 +++--- win32/scripts/rasutil.py | 2 +- 13 files changed, 62 insertions(+), 68 deletions(-) diff --git a/Pythonwin/pywin/dialogs/login.py b/Pythonwin/pywin/dialogs/login.py index 7ab3fd4e5..b3bddc3ec 100644 --- a/Pythonwin/pywin/dialogs/login.py +++ b/Pythonwin/pywin/dialogs/login.py @@ -1,6 +1,6 @@ """login -- PythonWin user ID and password dialog box -(Adapted from originally distributed with Mark Hammond's PythonWin - +(Adapted from originally distributed with Mark Hammond's PythonWin - this now replaces it!) login.GetLogin() displays a modal "OK/Cancel" dialog box with input diff --git a/com/win32com/makegw/makegw.py b/com/win32com/makegw/makegw.py index d99fa540a..8e72da871 100644 --- a/com/win32com/makegw/makegw.py +++ b/com/win32com/makegw/makegw.py @@ -2,11 +2,11 @@ This module will generate a C++/Python binding for a specific COM interface. - + Can be run from command line (passing required arguments) or the old way (start Python, import this module, change to the directory where the generated code should be written, and run the public function). - + This module is capable of generating both 'Interfaces' (ie, Python client side support for the interface) and 'Gateways' (ie, Python server side support for the interface). Many COM interfaces are useful @@ -14,15 +14,15 @@ sense to implement one side or the other. For example, it would be pointless for Python to implement Server side for 'IRunningObjectTable', unless we were implementing core COM for an operating system in Python (hey - now there's an idea!) - + Most COM interface code is totally boiler-plate - it consists of converting arguments, dispatching the call to Python, and processing any result values. - + This module automates the generation of such code. It has the ability to parse a .H file generated by the MIDL tool (ie, almost all COM .h files) and build almost totally complete C++ code. - + The module understands some of the well known data types, and how to convert them. There are only a couple of places where hand-editing is necessary, as detailed below: @@ -43,7 +43,6 @@ * FAILED(scode) for the interface still has valid data to return (by default, the code generated does not process the return values, and raise an exception to Python/COM - """ import argparse diff --git a/com/win32com/makegw/makegwenum.py b/com/win32com/makegw/makegwenum.py index 662dff4b6..3ba274a4e 100644 --- a/com/win32com/makegw/makegwenum.py +++ b/com/win32com/makegw/makegwenum.py @@ -226,7 +226,7 @@ def _write_enumgw_cpp(f, interface): STDMETHODIMP PyGEnum{enumtype}::GetIDsOfNames(REFIID refiid, OLECHAR FAR* FAR* rgszNames, UINT cNames, LCID lcid, DISPID FAR* rgdispid) {{return PyGatewayBase::GetIDsOfNames( refiid, rgszNames, cNames, lcid, rgdispid);}} STDMETHODIMP PyGEnum{enumtype}::Invoke(DISPID dispid, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS FAR* params, VARIANT FAR* pVarResult, EXCEPINFO FAR* pexcepinfo, UINT FAR* puArgErr) {{return PyGatewayBase::Invoke( dispid, riid, lcid, wFlags, params, pVarResult, pexcepinfo, puArgErr);}} -STDMETHODIMP PyGEnum{enumtype}::Next( +STDMETHODIMP PyGEnum{enumtype}::Next( /* [in] */ ULONG celt, /* [length_is][size_is][out] */ {argdeclare}, /* [out] */ ULONG __RPC_FAR *pCeltFetched) @@ -273,7 +273,7 @@ def _write_enumgw_cpp(f, interface): return PyCom_HandleIEnumNoSequence(IID_IEnum{enumtype}); }} -STDMETHODIMP PyGEnum{enumtype}::Skip( +STDMETHODIMP PyGEnum{enumtype}::Skip( /* [in] */ ULONG celt) {{ PY_GATEWAY_METHOD; @@ -286,7 +286,7 @@ def _write_enumgw_cpp(f, interface): return InvokeViaPolicy("Reset"); }} -STDMETHODIMP PyGEnum{enumtype}::Clone( +STDMETHODIMP PyGEnum{enumtype}::Clone( /* [out] */ IEnum{enumtype} __RPC_FAR *__RPC_FAR *ppEnum) {{ PY_GATEWAY_METHOD; diff --git a/com/win32com/makegw/makegwparse.py b/com/win32com/makegw/makegwparse.py index a1dff12ab..8086eee65 100644 --- a/com/win32com/makegw/makegwparse.py +++ b/com/win32com/makegw/makegwparse.py @@ -7,7 +7,7 @@ Each argument knows how to use Py_BuildValue or Py_ParseTuple to exchange itself with Python. - + See the @win32com.makegw@ module for information in building a COM interface """ diff --git a/com/win32com/server/exception.py b/com/win32com/server/exception.py index 887186b4d..043933fa0 100644 --- a/com/win32com/server/exception.py +++ b/com/win32com/server/exception.py @@ -5,12 +5,11 @@ To better support COM exceptions, the framework allows for an instance to be raised. This instance may have a certain number of known attributes, which are translated into COM exception details. - + This means, for example, that Python could raise a COM exception that includes details on a Help file and location, and a description for the user. - - This module provides a class which provides the necessary attributes. + This module provides a class which provides the necessary attributes. """ import sys diff --git a/com/win32com/server/policy.py b/com/win32com/server/policy.py index a66fc0ca5..f62a7c28e 100644 --- a/com/win32com/server/policy.py +++ b/com/win32com/server/policy.py @@ -1,70 +1,69 @@ -"""Policies +"""Policies Note that Dispatchers are now implemented in "dispatcher.py", but are still documented here. Policies - A policy is an object which manages the interaction between a public - Python object, and COM . In simple terms, the policy object is the - object which is actually called by COM, and it invokes the requested - method, fetches/sets the requested property, etc. See the + A policy is an object which manages the interaction between a public + Python object, and COM . In simple terms, the policy object is the + object which is actually called by COM, and it invokes the requested + method, fetches/sets the requested property, etc. See the @win32com.server.policy.CreateInstance@ method for a description of how a policy is specified or created. - Exactly how a policy determines which underlying object method/property - is obtained is up to the policy. A few policies are provided, but you - can build your own. See each policy class for a description of how it + Exactly how a policy determines which underlying object method/property + is obtained is up to the policy. A few policies are provided, but you + can build your own. See each policy class for a description of how it implements its policy. - There is a policy that allows the object to specify exactly which - methods and properties will be exposed. There is also a policy that - will dynamically expose all Python methods and properties - even those + There is a policy that allows the object to specify exactly which + methods and properties will be exposed. There is also a policy that + will dynamically expose all Python methods and properties - even those added after the object has been instantiated. Dispatchers - A Dispatcher is a level in front of a Policy. A dispatcher is the - thing which actually receives the COM calls, and passes them to the - policy object (which in turn somehow does something with the wrapped + A Dispatcher is a level in front of a Policy. A dispatcher is the + thing which actually receives the COM calls, and passes them to the + policy object (which in turn somehow does something with the wrapped object). It is important to note that a policy does not need to have a dispatcher. - A dispatcher has the same interface as a policy, and simply steps in its - place, delegating to the real policy. The primary use for a Dispatcher - is to support debugging when necessary, but without imposing overheads + A dispatcher has the same interface as a policy, and simply steps in its + place, delegating to the real policy. The primary use for a Dispatcher + is to support debugging when necessary, but without imposing overheads when not (ie, by not using a dispatcher at all). - There are a few dispatchers provided - "tracing" dispatchers which simply - prints calls and args (including a variation which uses - win32api.OutputDebugString), and a "debugger" dispatcher, which can + There are a few dispatchers provided - "tracing" dispatchers which simply + prints calls and args (including a variation which uses + win32api.OutputDebugString), and a "debugger" dispatcher, which can invoke the debugger when necessary. Error Handling It is important to realise that the caller of these interfaces may - not be Python. Therefore, general Python exceptions and tracebacks aren't + not be Python. Therefore, general Python exceptions and tracebacks aren't much use. - In general, there is an COMException class that should be raised, to allow + In general, there is an COMException class that should be raised, to allow the framework to extract rich COM type error information. - The general rule is that the **only** exception returned from Python COM - Server code should be an COMException instance. Any other Python exception - should be considered an implementation bug in the server (if not, it - should be handled, and an appropriate COMException instance raised). Any - other exception is considered "unexpected", and a dispatcher may take + The general rule is that the **only** exception returned from Python COM + Server code should be an COMException instance. Any other Python exception + should be considered an implementation bug in the server (if not, it + should be handled, and an appropriate COMException instance raised). Any + other exception is considered "unexpected", and a dispatcher may take special action (see Dispatchers above) - Occasionally, the implementation will raise the policy.error error. - This usually means there is a problem in the implementation that the + Occasionally, the implementation will raise the policy.error error. + This usually means there is a problem in the implementation that the Python programmer should fix. - For example, if policy is asked to wrap an object which it can not - support (because, eg, it does not provide _public_methods_ or _dynamic_) - then policy.error will be raised, indicating it is a Python programmers + For example, if policy is asked to wrap an object which it can not + support (because, eg, it does not provide _public_methods_ or _dynamic_) + then policy.error will be raised, indicating it is a Python programmers problem, rather than a COM error. - """ __author__ = "Greg Stein and Mark Hammond" diff --git a/com/win32com/server/util.py b/com/win32com/server/util.py index d8682460a..d7470a2bf 100644 --- a/com/win32com/server/util.py +++ b/com/win32com/server/util.py @@ -1,5 +1,4 @@ -""" General Server side utilities -""" +""" General Server side utilities""" import pythoncom import winerror diff --git a/com/win32com/test/testGIT.py b/com/win32com/test/testGIT.py index 3f9a5f420..011a11a98 100644 --- a/com/win32com/test/testGIT.py +++ b/com/win32com/test/testGIT.py @@ -1,6 +1,6 @@ """Testing pasing object between multiple COM threads -Uses standard COM marshalling to pass objects between threads. Even +Uses standard COM marshalling to pass objects between threads. Even though Python generally seems to work when you just pass COM objects between threads, it shouldnt. @@ -10,15 +10,14 @@ COM marshalls back all calls to that object to the main Python thread, which must be running a message loop (as this sample does). -When this test is run in "free threaded" mode (at this stage, you must -manually mark the COM objects as "ThreadingModel=Free", or run from a +When this test is run in "free threaded" mode (at this stage, you must +manually mark the COM objects as "ThreadingModel=Free", or run from a service which has marked itself as free-threaded), then no marshalling is done, and the Python.Interpreter object start doing the "expected" thing - ie, it reports being on the same thread as its caller! Python.exe needs a good way to mark itself as FreeThreaded - at the moment this is a pain in the but! - """ import _thread diff --git a/com/win32comext/axscript/test/testHost.py b/com/win32comext/axscript/test/testHost.py index e0b9995ac..1dba19ed1 100644 --- a/com/win32comext/axscript/test/testHost.py +++ b/com/win32comext/axscript/test/testHost.py @@ -97,7 +97,7 @@ def NotifyDoneIt(self, interface, arg): sub hello(arg1) test.echo arg1 end sub - + sub testcollection if test.collection.Item(0) <> 1 then test.fail("Index 0 was wrong") @@ -122,7 +122,7 @@ def NotifyDoneIt(self, interface, arg): prop = "Property Value" def hello(arg1): test.echo(arg1) - + def testcollection(): # test.collection[1] = "New one" got = [] diff --git a/com/win32comext/shell/demos/explorer_browser.py b/com/win32comext/shell/demos/explorer_browser.py index dbbd76b16..fb6f9b2a3 100644 --- a/com/win32comext/shell/demos/explorer_browser.py +++ b/com/win32comext/shell/demos/explorer_browser.py @@ -12,7 +12,7 @@ from win32com.shell import shell, shellcon # event handler for the browser. -IExplorerBrowserEvents_Methods = """OnNavigationComplete OnNavigationFailed +IExplorerBrowserEvents_Methods = """OnNavigationComplete OnNavigationFailed OnNavigationPending OnViewCreated""".split() diff --git a/win32/Demos/win32rcparser_demo.py b/win32/Demos/win32rcparser_demo.py index 6d85d3db3..8f88e3dd6 100644 --- a/win32/Demos/win32rcparser_demo.py +++ b/win32/Demos/win32rcparser_demo.py @@ -73,7 +73,7 @@ def DemoModal(): if __name__ == "__main__": flags = 0 - for flag in """ICC_DATE_CLASSES ICC_ANIMATE_CLASS ICC_ANIMATE_CLASS + for flag in """ICC_DATE_CLASSES ICC_ANIMATE_CLASS ICC_ANIMATE_CLASS ICC_BAR_CLASSES ICC_COOL_CLASSES ICC_DATE_CLASSES ICC_HOTKEY_CLASS ICC_INTERNET_CLASSES ICC_LISTVIEW_CLASSES ICC_PAGESCROLLER_CLASS ICC_PROGRESS_CLASS ICC_TAB_CLASSES diff --git a/win32/Lib/win32pdhquery.py b/win32/Lib/win32pdhquery.py index bda1665f0..71d77e03a 100644 --- a/win32/Lib/win32pdhquery.py +++ b/win32/Lib/win32pdhquery.py @@ -9,10 +9,10 @@ The basic idea of a PDH Query is an object which can query the system about the status of any number of "counters." The counters are paths -to a particular piece of performance data. For instance, the path +to a particular piece of performance data. For instance, the path '\\Memory\\Available Bytes' describes just about exactly what it says -it does, the amount of free memory on the default computer expressed -in Bytes. These paths can be considerably more complex than this, +it does, the amount of free memory on the default computer expressed +in Bytes. These paths can be considerably more complex than this, but part of the point of this wrapper module is to hide that complexity from the end-user/programmer. @@ -27,17 +27,17 @@ As an example, the following code implements a logger which allows the user to choose what counters they would like to log, and logs those counters for 30 seconds, at two-second intervals. - + query = Query() query.addcounterbybrowsing() query.collectdatafor(30,2) - + The data is now stored in a list of lists as: query.curresults - + The counters(paths) which were used to collect the data are: query.curpaths - + You can use the win32pdh.ParseCounterPath(path) utility function to turn the paths into more easily read values for your task, or write the data to a file, or do whatever you want with it. @@ -79,7 +79,7 @@ workaround other than Alt-tabing to reach the browser window. ### Other References ### -The win32pdhutil module (which should be in the %pythonroot%/win32/lib +The win32pdhutil module (which should be in the %pythonroot%/win32/lib directory) provides quick-and-dirty utilities for one-off access to variables from the PDH. Almost everything in that module can be done with a Query object, but it provides task-oriented functions for a @@ -96,7 +96,7 @@ In general the Python version of the API is just a wrapper around the Query-based version of this API (as far as I can see), so you can learn what -you need to from there. From what I understand, the MSDN Online +you need to from there. From what I understand, the MSDN Online resources are available for the price of signing up for them. I can't guarantee how long that's supposed to last. (Or anything for that matter). @@ -121,7 +121,6 @@ Use at your own risk, no warranties, no guarantees, no assurances, if you use it, you accept the risk of using it, etceteras. - """ # Feb 12, 98 - MH added "rawaddcounter" so caller can get exception details. diff --git a/win32/scripts/rasutil.py b/win32/scripts/rasutil.py index 1819a79b0..75426341f 100644 --- a/win32/scripts/rasutil.py +++ b/win32/scripts/rasutil.py @@ -65,7 +65,7 @@ def Disconnect(handle): Usage: rasutil [-r retryCount] [-c rasname] [-d rasname] - + -r retryCount - Number of times to retry the RAS connection -c rasname - Connect to the phonebook entry specified by rasname -d rasname - Disconnect from the phonebook entry specified by rasname From 073110358e8b382bac5695132ea3f017f5a36805 Mon Sep 17 00:00:00 2001 From: Avasam Date: Tue, 28 May 2024 09:44:31 -0400 Subject: [PATCH 05/21] pyright: pin version and turn on `reportAssignmentType` + `reportIndexIssue` (#2216) --- .github/workflows/main.yml | 1 + CHANGES.txt | 18 +++++++++++------- Pythonwin/pywin/framework/interact.py | 2 +- Pythonwin/pywin/framework/startup.py | 4 ++++ Pythonwin/pywin/scintilla/config.py | 4 ++-- Pythonwin/pywin/scintilla/formatter.py | 2 +- Pythonwin/pywin/test/test_pywin.py | 2 +- Pythonwin/win32uimodule.cpp | 4 ++-- com/win32com/__init__.py | 8 +++++--- com/win32com/server/register.py | 2 +- com/win32com/test/GenTestScripts.py | 4 +++- com/win32com/test/testAXScript.py | 8 +++++--- com/win32comext/axdebug/codecontainer.py | 3 ++- com/win32comext/axscript/client/pydumper.py | 4 ++-- mypy.ini | 2 +- pyrightconfig.json | 4 +--- win32/scripts/setup_d.py | 2 +- 17 files changed, 44 insertions(+), 30 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index aa6ecd69c..fb05eee83 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -154,4 +154,5 @@ jobs: - uses: jakebailey/pyright-action@v2 with: python-version: ${{ matrix.python-version }} + version: "1.1.358" annotate: errors diff --git a/CHANGES.txt b/CHANGES.txt index 101ff94f1..3a04862bd 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,4 +1,4 @@ -Notable changes in recent builds. +Notable changes in recent builds. Maintained by hand, so what's "notable" is subjective! Contributors are encouraged to add entries for their work. @@ -15,6 +15,10 @@ Coming in build 307, as yet unreleased -------------------------------------- ### pywin32 +* Fixed non-overriden `pywin.scintilla.formatter.Formatter.ColorizeString` raising `TypeError` instead of `RuntimeError` due to too many parameters (#2216, @Avasam) +* Fixed broken since Python 3 tokenization in `win32comext.axdebug.codecontainer.pySourceCodeContainer.GetSyntaxColorAttributes` (#2216, @Avasam) +* Fixed a `TypeError` due to incorrect kwargs in `win32comext.axscript.client.pydumper.Register` (#2216, @Avasam) +* Fixed error reporting of file copy failure for for installing debug dlls (#2216, @Avasam) * Fixed `py.exe -m win32verstamp` command and other quote typos caused by Implied String Concatenation (#2225, @Avasam) * Fixed VT_SAFEARRAY(VT_RECORD) which were missing the last element (#2247) * Fixed `MFC redist DLLs not found` by preferring corresponding version but accepting different version (#2248, @andreabravetti) @@ -22,7 +26,7 @@ Coming in build 307, as yet unreleased * Fixed handling of `SyntaxError` exception from a Windows Scripting Host Python Script on Python 3.10+ (#2235, @nbbeatty) * Add `CredGetSessionTypes` support (#2232, @CristiFati) * Fixed `win32clipboard` increasing size of data when `SetClipboardData` used with `CF_DIB` (#2184, @CristiFati) -* Add `StoreLogoff` to `PyIMsgStore` to prevent possible hang when MAPI uninitializes or during session logoff (#2196, avivbrg) +* Add `StoreLogoff` to `PyIMsgStore` to prevent possible hang when MAPI uninitializes or during session logoff (#2196, @avivbrg) * Enhance CredDelete to work with dictionaries (#2198, @CristiFati) * Add UnregisterHotKey support (#2185, @CristiFati) * IFolderView COM client support (#2180, #2181, #2182, @CristiFati) @@ -131,17 +135,17 @@ Coming in build 307, as yet unreleased * General speed and size improvements due to all the removed code. (#2046, #1986, #2050, #1950, #2085, #2087, #2051, #1990, #2106, #2127, #2124, #2126, #2177, #2218, #2202, #2205, #2217) ### adodbapi -* Remove references to outdated IronPython (#2049) +* Remove references to outdated IronPython (#2049, @Avasam) This removes the following public names: * `adodbapi.adodbapi.onWin32` * `adodbapi.apibase.onIronPython` * `adodbapi.apibase.NullTypes` * `adodbapi.apibase.DateTime` -* Remove references to outdated `mxDateTime` (#2048) +* Remove references to outdated `mxDateTime` (#2048, @Avasam) This removes the following public names: * `adodbapi.apibase.mxDateTime` * `adodbapi.apibase.mxDateTimeConverter` -* Removed obsolete Python 2 aliases (#2088) +* Removed obsolete Python 2 aliases (#2088, @Avasam) This removes the following public names: * `adodbapi.adodbapi.unicodeType` * `adodbapi.adodbapi.longType` @@ -152,8 +156,8 @@ Coming in build 307, as yet unreleased * `adodbapi.apibase.StringTypes` * `adodbapi.apibase.makeByteBuffer` * `adodbapi.apibase.memoryViewType` -* Remove outdated and unused remote feature (#2098) -* Migrated from `distutils` to `setuptools` (#2133) +* Remove outdated and unused remote feature (#2098, @Avasam) +* Migrated from `distutils` to `setuptools` (#2133, @Avasam) Build 306, released 2023-03-26 ------------------------------ diff --git a/Pythonwin/pywin/framework/interact.py b/Pythonwin/pywin/framework/interact.py index f1c0f143c..1bd47c440 100644 --- a/Pythonwin/pywin/framework/interact.py +++ b/Pythonwin/pywin/framework/interact.py @@ -163,7 +163,7 @@ def ColorizeInteractiveCode(self, cdoc, styleStart, stylePyStart): if ch not in "\r\n": self.ColorSeg(startSeg, i - 1, state) startSeg = i - if ch in (sys.ps1[0], sys.ps2[0]): + if ch in (str(sys.ps1)[0], str(sys.ps2)[0]): state = STYLE_INTERACTIVE_PROMPT elif cdoc[i : i + len(tracebackHeader)] == tracebackHeader: state = STYLE_INTERACTIVE_ERROR diff --git a/Pythonwin/pywin/framework/startup.py b/Pythonwin/pywin/framework/startup.py index 5496063e3..d10eecf35 100644 --- a/Pythonwin/pywin/framework/startup.py +++ b/Pythonwin/pywin/framework/startup.py @@ -43,6 +43,10 @@ import pywin import pywin.framework +# Ensure we're working on __path__ as list, not Iterable +pywin.__path__ = list(pywin.__path__) +pywin.framework.__path__ = list(pywin.framework.__path__) + pywin.__path__[0] = win32ui.FullPath(pywin.__path__[0]) pywin.framework.__path__[0] = win32ui.FullPath(pywin.framework.__path__[0]) diff --git a/Pythonwin/pywin/scintilla/config.py b/Pythonwin/pywin/scintilla/config.py index f6916a733..8113a0a89 100644 --- a/Pythonwin/pywin/scintilla/config.py +++ b/Pythonwin/pywin/scintilla/config.py @@ -64,7 +64,7 @@ def get_section_header(line): def find_config_file(f): - return os.path.join(pywin.__path__[0], f + ".cfg") + return os.path.join(next(iter(pywin.__path__)), f + ".cfg") def find_config_files(): @@ -72,7 +72,7 @@ def find_config_files(): os.path.split(x)[1] for x in [ os.path.splitext(x)[0] - for x in glob.glob(os.path.join(pywin.__path__[0], "*.cfg")) + for x in glob.glob(os.path.join(next(iter(pywin.__path__)), "*.cfg")) ] ] diff --git a/Pythonwin/pywin/scintilla/formatter.py b/Pythonwin/pywin/scintilla/formatter.py index 0f91968fa..b8aad0b13 100644 --- a/Pythonwin/pywin/scintilla/formatter.py +++ b/Pythonwin/pywin/scintilla/formatter.py @@ -279,7 +279,7 @@ def RegisterStyle(self, style, stylenum=None): self.nextstylenum = self.nextstylenum + 1 FormatterBase.RegisterStyle(self, style, stylenum) - def ColorizeString(self, str, charStart, styleStart): + def ColorizeString(self, str, styleStart): raise RuntimeError("You must override this method") def Colorize(self, start=0, end=-1): diff --git a/Pythonwin/pywin/test/test_pywin.py b/Pythonwin/pywin/test/test_pywin.py index 6389de930..63178e2a1 100644 --- a/Pythonwin/pywin/test/test_pywin.py +++ b/Pythonwin/pywin/test/test_pywin.py @@ -26,7 +26,7 @@ user_interaction = getattr(__main__, "user_interaction", False) # from all.py maybe file_abs = os.path.abspath(__file__) src_dir = os.path.dirname(file_abs) -pywin_path = pywin.__path__[0] +pywin_path = next(iter(pywin.__path__)) pythonwinpy_path = os.path.dirname(pywin_path) + "\\start_pythonwin.py" Object = argparse.Namespace _indebugger = "pywin.debugger" in sys.modules diff --git a/Pythonwin/win32uimodule.cpp b/Pythonwin/win32uimodule.cpp index 8b4ae7a5d..5a22057fa 100644 --- a/Pythonwin/win32uimodule.cpp +++ b/Pythonwin/win32uimodule.cpp @@ -1603,8 +1603,8 @@ static PyObject *ui_set_dialog_bk_color(PyObject *self, PyObject *args) int clrCtlBk = RGB(192, 192, 192); int clrCtlText = RGB(0, 0, 0); - // @pyparm int|clrCtlBk|win32ui.RGB(192, 192, 192)|The color for the controls background. - // @pyparm int|clrCtlText|win32ui.RGB(0, 0, 0)|The color for the controls text. + // @pyparm int|clrCtlBk|win32api.RGB(192, 192, 192)|The color for the controls background. + // @pyparm int|clrCtlText|win32api.RGB(0, 0, 0)|The color for the controls text. if (!PyArg_ParseTuple(args, "|ii:SetDialogBkColor", &clrCtlBk, &clrCtlText)) return NULL; CProtectedWinApp *pApp = GetProtectedApp(); diff --git a/com/win32com/__init__.py b/com/win32com/__init__.py index 56d1b815c..3e42dcc10 100644 --- a/com/win32com/__init__.py +++ b/com/win32com/__init__.py @@ -1,6 +1,7 @@ # # Initialization for the win32com package # +from __future__ import annotations import os import sys @@ -26,6 +27,9 @@ ### TODO - Load _all_ \\Extensions subkeys - for now, we only read the default ### Modules will work if loaded into "win32comext" path. +# Ensure we're working on __path__ as list, not Iterable +__path__: list[str] = list(__path__) # type: ignore[no-redef] + def SetupEnvironment(): HKEY_LOCAL_MACHINE = -2147483646 # Avoid pulling in win32con for just these... @@ -96,9 +100,7 @@ def __PackageSupportBuildPath__(package_path): try: import win32com.gen_py - # hrmph - 3.3 throws: TypeError: '_NamespacePath' object does not support indexing - # attempting to get __path__[0] - but I can't quickly repro this stand-alone. - # Work around it by using an iterator. + # __path__ is only ensured to be an Iterable, not a list. __gen_path__ = next(iter(sys.modules["win32com.gen_py"].__path__)) except ImportError: # If a win32com\gen_py directory already exists, then we use it diff --git a/com/win32com/server/register.py b/com/win32com/server/register.py index 6fd412e9d..9f1e3ce49 100644 --- a/com/win32com/server/register.py +++ b/com/win32com/server/register.py @@ -130,7 +130,7 @@ def _find_localserver_exe(mustfind): def _find_localserver_module(): import win32com.server - path = win32com.server.__path__[0] + path = next(iter(win32com.server.__path__)) baseName = "localserver" pyfile = os.path.join(path, baseName + ".py") try: diff --git a/com/win32com/test/GenTestScripts.py b/com/win32com/test/GenTestScripts.py index 627560fde..079f6a984 100644 --- a/com/win32com/test/GenTestScripts.py +++ b/com/win32com/test/GenTestScripts.py @@ -19,7 +19,9 @@ def GetGenPath(): import win32api - return os.path.join(win32api.GetFullPathName(win32com.test.__path__[0]), genDir) + return os.path.join( + win32api.GetFullPathName(next(iter(win32com.test.__path__))), genDir + ) def GenerateFromRegistered(fname, *loadArgs): diff --git a/com/win32com/test/testAXScript.py b/com/win32com/test/testAXScript.py index d7a4553ed..d1dc7f11c 100644 --- a/com/win32com/test/testAXScript.py +++ b/com/win32com/test/testAXScript.py @@ -13,7 +13,7 @@ class AXScript(win32com.test.util.TestCase): def setUp(self): file = win32api.GetFullPathName( - os.path.join(win32com.axscript.client.__path__[0], "pyscript.py") + os.path.join(next(iter(win32com.axscript.client.__path__)), "pyscript.py") ) from win32com.test.util import RegisterPythonServer @@ -22,7 +22,7 @@ def setUp(self): def testHost(self): file = win32api.GetFullPathName( - os.path.join(win32com.axscript.__path__[0], "test\\testHost.py") + os.path.join(next(iter(win32com.axscript.__path__)), "test\\testHost.py") ) cmd = f'{win32api.GetModuleFileName(0)} "{file}"' if verbose: @@ -31,7 +31,9 @@ def testHost(self): def testCScript(self): file = win32api.GetFullPathName( - os.path.join(win32com.axscript.__path__[0], "Demos\\Client\\wsh\\test.pys") + os.path.join( + next(iter(win32com.axscript.__path__)), "Demos\\Client\\wsh\\test.pys" + ) ) cmd = 'cscript.exe "%s"' % (file) if verbose: diff --git a/com/win32comext/axdebug/codecontainer.py b/com/win32comext/axdebug/codecontainer.py index 2030cf695..d6d48048f 100644 --- a/com/win32comext/axdebug/codecontainer.py +++ b/com/win32comext/axdebug/codecontainer.py @@ -159,7 +159,8 @@ def GetSyntaxColorAttributes(self): self.lastPos = 0 self.attrs = [] try: - tokenize.tokenize(self.GetNextLine, self._ProcessToken) + for tokens in tokenize.tokenize(self.GetNextLine): + self._ProcessToken(*tokens) except tokenize.TokenError: pass # Ignore - will cause all subsequent text to be commented. numAtEnd = len(self.GetText()) - self.lastPos diff --git a/com/win32comext/axscript/client/pydumper.py b/com/win32comext/axscript/client/pydumper.py index 281bb9d24..0380d21be 100644 --- a/com/win32comext/axscript/client/pydumper.py +++ b/com/win32comext/axscript/client/pydumper.py @@ -60,11 +60,11 @@ def Register(): RegisterServer( clsid=clsid, pythonInstString="win32com.axscript.client.pyscript.PyDumper", - className="Python Debugging/Dumping ActiveX Scripting Engine", + desc="Python Debugging/Dumping ActiveX Scripting Engine", progID=languageName, verProgID=verProgId, - catids=categories, policy=policy, + catids=categories, dispatcher=dispatcher, ) diff --git a/mypy.ini b/mypy.ini index 7f0506d85..34ac87ef0 100644 --- a/mypy.ini +++ b/mypy.ini @@ -40,7 +40,7 @@ exclude = (?x)( | ^Pythonwin/Scintilla/ ; Forked IDLE extensions predating Python 2.3. They now live in idlelib in https://github.com/python/cpython/tree/main/Lib/idlelib | ^Pythonwin/pywin/idle/ - ; TODO: adodbapi should be updated and fixed separatly + ; TODO: adodbapi should be updated and fixed separately | ^adodbapi/ ; TODO: Ignoring non-public APIs until all public API is typed | ([Tt]est|[Dd]emos?)/ diff --git a/pyrightconfig.json b/pyrightconfig.json index 5ea2fe279..356d749ba 100644 --- a/pyrightconfig.json +++ b/pyrightconfig.json @@ -33,15 +33,13 @@ "reportAttributeAccessIssue": "none", // FIXE: These all need to be fixed first and turned back to error // some of the fixes need to be done in types-pywin32 from typeshed - "reportAssignmentType": "warning", "reportCallIssue": "warning", - "reportIndexIssue": "warning", "reportOperatorIssue": "warning", "reportOptionalCall": "warning", "reportOptionalIterable": "warning", "reportOptionalMemberAccess": "warning", "reportOptionalSubscript": "warning", - // TODO: Leave Unbound/Undefined to its own PR(s) + // TODO: Leave Unbound/Undefined to their own PR(s) "reportUnboundVariable": "warning", "reportUndefinedVariable": "warning", // Too many dynamically generated modules. This will require type stubs to properly fix. diff --git a/win32/scripts/setup_d.py b/win32/scripts/setup_d.py index c40cd65c8..b458854d1 100644 --- a/win32/scripts/setup_d.py +++ b/win32/scripts/setup_d.py @@ -61,7 +61,7 @@ def _docopy(src, dest): return 1 except: print(f"Error copying '{src}' -> '{dest}'") - print(str(sys.exc_info[1])) + print(str(sys.exc_info()[1])) usage_and_die(3) From 9743cd0aa5c1c96986b6e6e8396926bc6da64533 Mon Sep 17 00:00:00 2001 From: Avasam Date: Tue, 28 May 2024 09:56:18 -0400 Subject: [PATCH 06/21] Format trailing-whitespaces and end-of-file with pre-commit --- .editorconfig | 7 +- .pre-commit-config.yaml | 12 +- AutoDuck/bin/autoduck.fmt | 977 +++++++++--------- AutoDuck/common.mak | 6 +- AutoDuck/common_top.mak | 1 - AutoDuck/pyhtml.fmt | 27 +- AutoDuck/pythonwin.fmt | 314 +++--- AutoDuck/pywin32.mak | 5 +- CHANGES.txt | 2 +- Pythonwin/License.txt | 20 +- Pythonwin/Win32uiHostGlue.h | 2 +- Pythonwin/contents.d | 8 +- Pythonwin/dbgthread.cpp | 2 +- Pythonwin/doc/EmbeddingWin32ui.html | 114 +- Pythonwin/pythondoc.h | 2 +- Pythonwin/pythonwin.rc | 12 +- Pythonwin/pywin/Demos/app/readme.txt | 2 +- Pythonwin/pywin/Demos/readme.txt | 3 +- Pythonwin/pywin/IDLE.cfg | 1 - Pythonwin/pywin/default.cfg | 7 +- Pythonwin/pywin/idle/readme.txt | 6 +- Pythonwin/pywin/tools/__init__.py | 1 - Pythonwin/win32splitter.cpp | 2 +- Pythonwin/win32toolbar.h | 2 +- Pythonwin/win32ui.rc | 231 +++-- Pythonwin/win32uioledoc.h | 2 +- SWIG/pywin32_swig.patch | 32 +- SWIG/readme.txt | 1 - SWIG/swig_lib/array.i | 27 +- SWIG/swig_lib/autodoc.i | 6 +- SWIG/swig_lib/carray.i | 19 +- SWIG/swig_lib/constraints.i | 14 +- SWIG/swig_lib/exception.i | 2 - SWIG/swig_lib/malloc.i | 5 +- SWIG/swig_lib/math.i | 1 - SWIG/swig_lib/memory.i | 2 - SWIG/swig_lib/objc.i | 8 +- SWIG/swig_lib/pointer.i | 14 +- SWIG/swig_lib/python/embed.i | 18 +- SWIG/swig_lib/python/embed13.i | 15 +- SWIG/swig_lib/python/embed14.i | 18 +- SWIG/swig_lib/python/ptrlang.i | 64 +- SWIG/swig_lib/python/pyexp.swg | 1 - SWIG/swig_lib/python/python.swg | 10 +- SWIG/swig_lib/python/pywintypes.i | 3 +- SWIG/swig_lib/python/typemaps.i | 29 +- SWIG/swig_lib/stdlib.i | 1 - SWIG/swig_lib/swigptr.swg | 38 +- SWIG/swig_lib/timers.i | 22 +- adodbapi/license.txt | 3 +- adodbapi/quick_reference.md | 8 +- adodbapi/readme.txt | 10 +- com/License.txt | 18 +- com/TestSources/PyCOMTest/Connect.rc | 9 +- com/TestSources/PyCOMTest/PyCOMTest.dsp | 40 +- com/TestSources/PyCOMTest/PyCOMTest.dsw | 1 - com/TestSources/PyCOMTest/PyCOMTest.idl | 15 +- .../PyCOMVBTest/EnumerableCollection.cls | 1 - com/TestSources/PyCOMVBTest/Tester.cls | 6 +- com/changes.txt | 13 +- com/help/active_directory.html | 30 +- com/help/adsi.html | 12 +- com/help/asp.d | 29 +- com/help/cpp.d | 8 +- com/help/mts.d | 14 +- com/help/shell.d | 38 +- com/win32com/HTML/variant.html | 40 +- com/win32com/changes.txt | 13 +- com/win32com/readme.html | 22 +- com/win32com/server/util.py | 2 +- com/win32com/src/PyIDispatch.cpp | 1 - com/win32com/src/PythonCOM.def | 1 - .../src/extensions/PyICatInformation.cpp | 1 - .../src/extensions/PyICatRegister.cpp | 1 - .../src/extensions/PyIEnumCATEGORYINFO.cpp | 1 - com/win32com/src/extensions/PyIEnumGUID.cpp | 1 - .../src/extensions/PyIPropertySetStorage.cpp | 1 - .../src/extensions/PyIPropertyStorage.cpp | 1 - .../src/extensions/PyIProvideClassInfo.cpp | 1 - .../src/extensions/PyIServiceProvider.cpp | 1 - com/win32com/test/Testpys.sct | 9 +- com/win32com/test/pippo.idl | 2 +- com/win32com/test/readme.txt | 2 +- com/win32com/test/testDictionary.vbs | 2 - com/win32com/test/testInterp.vbs | 1 - com/win32com/test/testxslt.xsl | 1 - com/win32comext/adsi/src/PyADSIUtil.cpp | 2 +- com/win32comext/adsi/src/PyIDirectorySearch.i | 2 +- com/win32comext/adsi/src/adsi.i | 4 +- .../axdebug/src/PyIDebugExpressionContext.h | 2 +- .../axdebug/src/PyIDebugProperties.h | 2 +- .../axdebug/src/PyIEnumDebugPropertyInfo.cpp | 2 +- .../src/PyIProvideExpressionContexts.h | 2 +- .../src/PyIRemoteDebugApplicationThread.h | 2 +- .../demos/client/asp/CreateObject.asp | 1 - .../axscript/demos/client/asp/caps.asp | 32 +- .../demos/client/asp/interrupt/test1.html | 1 - .../axscript/demos/client/asp/tut1.asp | 1 - .../axscript/demos/client/ie/CHARTPY.HTM | 12 +- .../axscript/demos/client/ie/MarqueeText1.htm | 1 - .../axscript/demos/client/ie/calc.htm | 1 - .../axscript/demos/client/ie/demo.htm | 1 - .../axscript/demos/client/ie/demo_check.htm | 7 +- .../axscript/demos/client/ie/demo_intro.htm | 9 +- .../axscript/demos/client/ie/demo_menu.htm | 10 +- .../axscript/demos/client/ie/marqueeDemo.htm | 9 +- .../axscript/demos/client/ie/mousetrack.htm | 9 +- .../axscript/demos/client/wsh/excel.pys | 2 - .../axscript/demos/client/wsh/registry.pys | 3 +- .../axscript/demos/client/wsh/test.pys | 1 - com/win32comext/axscript/src/MULTINFO.H | 60 +- com/win32comext/axscript/test/debugTest.pys | 1 - com/win32comext/axscript/test/debugTest.vbs | 2 +- .../directsound/src/PyIDirectSound.h | 2 +- .../directsound/src/PyIDirectSoundBuffer.h | 2 +- .../directsound/src/PyIDirectSoundCapture.h | 2 +- .../src/PyIDirectSoundCaptureBuffer.h | 2 +- .../directsound/src/PyIDirectSoundNotify.h | 2 +- com/win32comext/mapi/src/PyIAddrBook.i | 10 +- com/win32comext/mapi/src/PyIAttach.i | 8 +- .../mapi/src/PyIConverterSession.i | 38 +- .../mapi/src/PyIExchangeManageStore.i | 2 +- .../mapi/src/PyIExchangeManageStoreEx.i | 2 +- com/win32comext/mapi/src/PyIMAPIContainer.i | 7 +- com/win32comext/mapi/src/PyIMAPIFolder.i | 42 +- com/win32comext/mapi/src/PyIMAPIProp.i | 29 +- com/win32comext/mapi/src/PyIMAPISession.i | 38 +- com/win32comext/mapi/src/PyIMAPIStatus.i | 2 +- com/win32comext/mapi/src/PyIMAPITable.i | 54 +- com/win32comext/mapi/src/PyIMessage.i | 5 +- com/win32comext/mapi/src/PyIMsgServiceAdmin.i | 28 +- com/win32comext/mapi/src/PyIMsgStore.i | 28 +- com/win32comext/mapi/src/PyIProfAdmin.i | 70 +- com/win32comext/mapi/src/PyIProviderAdmin.i | 22 +- com/win32comext/mapi/src/exchange.i | 42 +- com/win32comext/mapi/src/exchdapi.i | 18 +- com/win32comext/mapi/src/mapi.i | 212 ++-- .../mapi/src/mapi_stub_library/LICENSE | 2 +- .../src/mapi_stub_library/MapiStubLibrary.cpp | 2 +- com/win32comext/mapi/src/mapilib.i | 18 +- .../shell/demos/servers/folder_view.propdesc | 2 +- .../shell/src/PyIApplicationDestinations.cpp | 2 +- .../shell/src/PyIApplicationDestinations.h | 2 +- .../shell/src/PyIApplicationDocumentLists.cpp | 2 +- .../shell/src/PyIApplicationDocumentLists.h | 2 +- com/win32comext/shell/src/PyIShellLink.h | 2 +- isapi/README.txt | 4 +- isapi/doc/isapi.html | 26 +- isapi/samples/README.txt | 6 +- isapi/src/PythonEng.h | 2 +- isapi/test/README.txt | 2 +- win32/Demos/c_extension/README.txt | 4 +- win32/Demos/service/install/readme.txt | 4 +- win32/Demos/win32wnet/netresource.htm | 2 +- win32/License.txt | 20 +- win32/help/event.d | 50 +- win32/help/file.d | 62 +- win32/help/process_info.html | 270 ++--- win32/help/security.d | 21 +- win32/help/security_directories.html | 74 +- win32/help/win32net.html | 68 +- win32/src/PerfMon/perfmondata.def | 2 +- win32/src/PerfMon/perfutil.h | 2 +- win32/src/PyACL.cpp | 1 - win32/src/PySecurityObjects.h | 1 - win32/src/PySoundObjects.h | 2 +- win32/src/PythonService.rc | 2 +- win32/src/_winxptheme.i | 82 +- win32/src/win32apimodule.cpp | 2 +- win32/src/win32crypt/win32crypt_structs.cpp | 2 +- win32/src/win32crypt/win32cryptmodule.cpp | 4 +- win32/src/win32event.i | 123 ++- win32/src/win32evtlog_messages.mc | 1 - win32/src/win32file.i | 476 ++++----- win32/src/win32gui.i | 250 ++--- win32/src/win32inet.i | 106 +- win32/src/win32job.i | 5 +- win32/src/win32pipe.i | 42 +- win32/src/win32process.i | 159 ++- win32/src/win32security.i | 216 ++-- win32/src/win32service.i | 204 ++-- win32/src/win32service_messages.mc | 1 - win32/test/win32crypt_testcert_base64.cer | 2 +- win32/test/win32rcparser/test.rc | 27 +- 184 files changed, 2762 insertions(+), 2924 deletions(-) diff --git a/.editorconfig b/.editorconfig index 1b4b1d264..51baf1204 100644 --- a/.editorconfig +++ b/.editorconfig @@ -1,10 +1,9 @@ root = true [*] -# TODO: Activate and run in a different PR. Lots of files affected -# trim_trailing_whitespace = true -# insert_final_newline = true -# end_of_line = crlf +trim_trailing_whitespace = true +insert_final_newline = true +end_of_line = crlf indent_style = space indent_size = 4 max_line_length = 120 # Same as .clang-format diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index ea5bb9cdd..19d63b202 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -3,14 +3,11 @@ repos: - repo: https://github.com/pre-commit/pre-commit-hooks rev: v4.5.0 hooks: - # TODO: Activate and run in a different PR. Lots of files affected - # - id: trailing-whitespace - # args: [--markdown-linebreak-ext=md] - # - id: end-of-file-fixer + - id: trailing-whitespace + args: [--markdown-linebreak-ext=md] + - id: end-of-file-fixer - id: mixed-line-ending args: [--fix=crlf] - # Vendored - exclude: ^com/win32comext/mapi/src/mapi_headers/.*$ - id: check-case-conflict - repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks rev: v2.12.0 @@ -38,5 +35,8 @@ repos: - id: black verbose: true +# Vendored +exclude: ^(com/win32comext/mapi/src/mapi_headers/|Pythonwin/Scintilla/).*$ + ci: autoupdate_schedule: quarterly diff --git a/AutoDuck/bin/autoduck.fmt b/AutoDuck/bin/autoduck.fmt index c546fbeb6..9444cf90b 100644 --- a/AutoDuck/bin/autoduck.fmt +++ b/AutoDuck/bin/autoduck.fmt @@ -1,15 +1,15 @@ [token] .output=doc,rtf -.token=^p,\par -.token=^t,\tab +.token=^p,\par +.token=^t,\tab .token=\,\\ .token={,\{ .token=},\} .highcharmask=\'%x .output=help,rtf -.token=^p,\par -.token=^t,\tab +.token=^p,\par +.token=^t,\tab .token=\,\\ .token={,\{ .token=},\} @@ -43,60 +43,60 @@ .output=both .define=build,dev -.define=reset,\pard\plain +.define=reset,\pard\plain .define=title,Help .define=doc_header,Autoduck Output -.define=par,\par -.define=cb,{\b +.define=par,\par +.define=cb,{\b .define=cbe,} -.define=ci,{\i +.define=ci,{\i .define=cie,} -.define=page,\page +.define=page,\page ; ; Help constants ; .output=help -.define=header,\s243\li-1800\sl210\tqr\tx6960 \b\f2\fs19\lang1033 -.define=heading_4,\s251\sb160\sa40\sl280 \b\f2\lang1033 -.define=heading_3,\s252\li240\sb160\sa40\sl340 \b\f2\lang1033 -.define=heading_2,\s253\li240\sb160\sa60\sl380 \b\f0\fs28\lang1033 -.define=heading_1,\s254\li240\sb200\sa80\sl440 \b\f0\fs36\lang1033 -.define=normal,\li240\sa160\sl240 \f2\fs20\lang1033 -.define=table_text,\f2\fs20\lang1033 -.define=ex,\s28\li240\sl220\tx732\tx1224\tx1716\tx2208\tx2700\tx3192\tx3684\tx4176\tx4668\tx5160\tx5652\tx6144\tx6636\tx7128\tx7620 \f17\fs20\lang1033 -.define=header_rule,\s44\li-1770\ri30\sb50\sl-80\brdrt\brdrs\brdrw15\brdrcf2 \fs12\lang1033 -.define=rh1,\s45\li240\sl440\keep\keepn \b\f2\fs34\lang1033 -.define=rmh,\s46\li240\sb20\sl220 \b\f2\fs21\lang1033 -.define=term1,\s50\li240\sl240 \f2\fs20\lang1033 -.define=term2,\s53\li480\sl240 \f2\fs20\lang1033 -.define=term3,\s53\li720\sl240 \f2\fs20\lang1033 -.define=def1,\s54\li480\sa80\sl240 \f2\fs20\lang1033 -.define=def2,\s55\li720\sa80\sl240 \f2\fs20\lang1033 -.define=def3,\s55\li960\sa80\sl240 \f2\fs20\lang1033 +.define=header,\s243\li-1800\sl210\tqr\tx6960 \b\f2\fs19\lang1033 +.define=heading_4,\s251\sb160\sa40\sl280 \b\f2\lang1033 +.define=heading_3,\s252\li240\sb160\sa40\sl340 \b\f2\lang1033 +.define=heading_2,\s253\li240\sb160\sa60\sl380 \b\f0\fs28\lang1033 +.define=heading_1,\s254\li240\sb200\sa80\sl440 \b\f0\fs36\lang1033 +.define=normal,\li240\sa160\sl240 \f2\fs20\lang1033 +.define=table_text,\f2\fs20\lang1033 +.define=ex,\s28\li240\sl220\tx732\tx1224\tx1716\tx2208\tx2700\tx3192\tx3684\tx4176\tx4668\tx5160\tx5652\tx6144\tx6636\tx7128\tx7620 \f17\fs20\lang1033 +.define=header_rule,\s44\li-1770\ri30\sb50\sl-80\brdrt\brdrs\brdrw15\brdrcf2 \fs12\lang1033 +.define=rh1,\s45\li240\sl440\keep\keepn \b\f2\fs34\lang1033 +.define=rmh,\s46\li240\sb20\sl220 \b\f2\fs21\lang1033 +.define=term1,\s50\li240\sl240 \f2\fs20\lang1033 +.define=term2,\s53\li480\sl240 \f2\fs20\lang1033 +.define=term3,\s53\li720\sl240 \f2\fs20\lang1033 +.define=def1,\s54\li480\sa80\sl240 \f2\fs20\lang1033 +.define=def2,\s55\li720\sa80\sl240 \f2\fs20\lang1033 +.define=def3,\s55\li960\sa80\sl240 \f2\fs20\lang1033 .define=def4,\fi-2880\li2880\sa160 \tx2880\tx6930 \fs21\lang1033 -.define=rule,\s57\li-1770\ri30\sb280\sa160\sl120\brdrb\brdrs\brdrw15 \fs8\cf8\lang1033 -.define=indexlink,\s93\sl240\li240 \f2\fs20\lang1033 +.define=rule,\s57\li-1770\ri30\sb280\sa160\sl120\brdrb\brdrs\brdrw15 \fs8\cf8\lang1033 +.define=indexlink,\s93\sl240\li240 \f2\fs20\lang1033 ; ; Doc constants ; .output=doc -.define=header,\s243\li-1800\sl-210\tqr\tx6960 \b\f2\fs19\lang1033 -.define=heading_4,\s251\sb160\sa40\sl-280\keepn \b\f2\lang1033 -.define=heading_3,\s252\sb160\sa40\sl-340\keepn \b\f2\fs30\lang1033 -.define=heading_2,\s253\li-1800\sb160\sa60\sl-380\keepn \b\f0\fs34\lang1033 -.define=heading_1,\s254\li-1800\sb200\sa80\sl-440\keepn \b\f0\fs40\lang1033 -.define=normal,\sa160\sl240 \fs21\lang1033 -.define=ex,\s28\sl-220\tx380\tx760\tx1140\tx1520\tx1900\tx2280\tx2660\tx3040\tx3420\tx3800 \f19\fs16\lang1033 -.define=header_rule,\s44\li-1770\ri30\sb50\sl-80\brdrt\brdrs\brdrw15\brdrcf2 \fs12\lang1033 -.define=rh1,\s45\li-1800\sa180\sl-440\keepn\tx0 \b\f2\fs40\up8\lang1033 -.define=rmh,\s46\sb20\sl-220\keepn\pvpara\phpg\posy0\absw1560\dxfrtext240\dfrmtxtx240\dfrmtxty240 \b\f2\fs21\lang1033 -.define=term1,\s50\sl-240\keepn \f0\fs21\lang1033 -.define=term2,\s53\li280\sl-240\keepn \f0\fs21\lang1033 -.define=def1,\s54\li280\sa80\sl-240 \f0\fs21\lang1033 -.define=def2,\s55\li560\sa80\sl-240 \f0\fs21\lang1033 -.define=rule,\s57\li-1770\ri30\sb280\sa250\sl-120\keepn\brdrb\brdrs\brdrw15\brdrcf2 \fs8\cf8\lang1033 -.define=Table_Text,\s25\sa80\widctlpar\intbl \f4\fs21\lang1024 \sbasedon0\snext25 -.define=indexlink,\s93\sl240 \fs21\lang1033 +.define=header,\s243\li-1800\sl-210\tqr\tx6960 \b\f2\fs19\lang1033 +.define=heading_4,\s251\sb160\sa40\sl-280\keepn \b\f2\lang1033 +.define=heading_3,\s252\sb160\sa40\sl-340\keepn \b\f2\fs30\lang1033 +.define=heading_2,\s253\li-1800\sb160\sa60\sl-380\keepn \b\f0\fs34\lang1033 +.define=heading_1,\s254\li-1800\sb200\sa80\sl-440\keepn \b\f0\fs40\lang1033 +.define=normal,\sa160\sl240 \fs21\lang1033 +.define=ex,\s28\sl-220\tx380\tx760\tx1140\tx1520\tx1900\tx2280\tx2660\tx3040\tx3420\tx3800 \f19\fs16\lang1033 +.define=header_rule,\s44\li-1770\ri30\sb50\sl-80\brdrt\brdrs\brdrw15\brdrcf2 \fs12\lang1033 +.define=rh1,\s45\li-1800\sa180\sl-440\keepn\tx0 \b\f2\fs40\up8\lang1033 +.define=rmh,\s46\sb20\sl-220\keepn\pvpara\phpg\posy0\absw1560\dxfrtext240\dfrmtxtx240\dfrmtxty240 \b\f2\fs21\lang1033 +.define=term1,\s50\sl-240\keepn \f0\fs21\lang1033 +.define=term2,\s53\li280\sl-240\keepn \f0\fs21\lang1033 +.define=def1,\s54\li280\sa80\sl-240 \f0\fs21\lang1033 +.define=def2,\s55\li560\sa80\sl-240 \f0\fs21\lang1033 +.define=rule,\s57\li-1770\ri30\sb280\sa250\sl-120\keepn\brdrb\brdrs\brdrw15\brdrcf2 \fs8\cf8\lang1033 +.define=Table_Text,\s25\sa80\widctlpar\intbl \f4\fs21\lang1024 \sbasedon0\snext25 +.define=indexlink,\s93\sl240 \fs21\lang1033 [file] ; ******************************************** @@ -166,13 +166,13 @@ {$(table_text)Table Text;} } -\paperw12240\paperh15840\margl3330\margr1530\margt-2540\margb-2220\gutter420 -\facingp\deftab280\widowctrl\ftnbj +\paperw12240\paperh15840\margl3330\margr1530\margt-2540\margb-2220\gutter420 +\facingp\deftab280\widowctrl\ftnbj -\sectd \binfsxn1\binsxn1\linex0\headery1990\footery360\endnhere\titlepg +\sectd \binfsxn1\binsxn1\linex0\headery1990\footery360\endnhere\titlepg {\headerl $(reset)$(header) -{\field\flddirty{\*\fldinst PAGE}{\fldrslt 4}}{\expnd50 }$(doc_header) - $!d\par +{\field\flddirty{\*\fldinst PAGE}{\fldrslt 4}}{\expnd50 }$(doc_header) - $!d\par $(reset)$(header_rule)\par } {\headerr $(reset)$(header) @@ -236,13 +236,13 @@ $(reset)$(header_rule)\par } {$(table_text)Table Text;} } -\paperw12240\paperh15840\margl3330\margr1530\margt-2540\margb-2220\gutter420 -\facingp\deftab280\widowctrl\ftnbj +\paperw12240\paperh15840\margl3330\margr1530\margt-2540\margb-2220\gutter420 +\facingp\deftab280\widowctrl\ftnbj -\sectd \binfsxn1\binsxn1\linex0\headery1990\footery360\endnhere\titlepg +\sectd \binfsxn1\binsxn1\linex0\headery1990\footery360\endnhere\titlepg {\headerl $(reset)$(header) -{\field\flddirty{\*\fldinst PAGE}{\fldrslt 4}}{\expnd50 }$(doc_header) - $!d\par +{\field\flddirty{\*\fldinst PAGE}{\fldrslt 4}}{\expnd50 }$(doc_header) - $!d\par $(reset)$(header_rule)\par } {\headerr $(reset)$(header) @@ -293,7 +293,7 @@ $(reset)$(heading_1) ##{\footnote ## $!c} $${\footnote $$ $!n} K{\footnote K classes; $!n} -+{\footnote + classes:0000} ++{\footnote + classes:0000} $!n class$(par) $(reset)$(normal)$[jclass]$(par) $(reset)$(normal)$5$(par) @@ -306,7 +306,7 @@ $(reset)$(heading_1) ##{\footnote ## $!c} $${\footnote $$ $!n} K{\footnote K methods; $!n} -+{\footnote + methods:0000} ++{\footnote + methods:0000} $!n method$(par) $(reset)$(normal)$[jmethod]$(par) $(reset)$(normal)$6$(par) @@ -321,75 +321,75 @@ $(reset)$(normal)Defined in: $!P$(par) .tag=bfunc,doc, 4, 20, $2 .order=rdesc bparm comm ex .parsesource=bfunc -.pre=$(reset)$(rule)\par -$(reset)$(heading_1)$2\par +.pre=$(reset)$(rule)\par +$(reset)$(heading_1)$2\par $[bfunc] -$(reset)$(normal)$4\par -$(reset)$(normal)Defined in: $!P\par +$(reset)$(normal)$4\par +$(reset)$(normal)Defined in: $!P\par .tag=bfunc, help, 4, 20, $2 .order=rdesc bparm comm ex .parsesource=bfunc -.pre=\page +.pre=\page $(reset)$(heading_1) ##{\footnote ## $!c} $${\footnote $$ $!n} K{\footnote K functions; $!n} -+{\footnote + functions:0000} -$2\par ++{\footnote + functions:0000} +$2\par $[bfunc] -$(reset)$(normal)$4\par -$(reset)$(normal)Defined in: $!P\par +$(reset)$(normal)$4\par +$(reset)$(normal)Defined in: $!P\par .tag=bsub,doc, 3, 20, $2 .order=rdesc bparm comm ex .parsesource=bsub -.pre=$(reset)$(rule)\par -$(reset)$(heading_1)$2\par +.pre=$(reset)$(rule)\par +$(reset)$(heading_1)$2\par $[bsub] -$(reset)$(normal)$3\par -$(reset)$(normal)Defined in: $!P\par +$(reset)$(normal)$3\par +$(reset)$(normal)Defined in: $!P\par .tag=bsub, help, 3, 20, $2 .order=rdesc bparm comm ex .parsesource=bsub -.pre=\page +.pre=\page $(reset)$(heading_1) ##{\footnote ## $!c} $${\footnote $$ $!n} K{\footnote K functions; $!n} -+{\footnote + functions:0000} -$2\par ++{\footnote + functions:0000} +$2\par $[bsub] -$(reset)$(normal)$3\par -$(reset)$(normal)Defined in: $!P\par +$(reset)$(normal)$3\par +$(reset)$(normal)Defined in: $!P\par .tag=btype, doc, 3, 20, $2 .order=bfield comm ex .parsesource=btype -.pre=$(reset)$(rule)\par -$(reset)$(heading_1)$2\par +.pre=$(reset)$(rule)\par +$(reset)$(heading_1)$2\par $[bstruct] -$(reset)$(normal)$3\par -$(reset)$(normal)Defined in: $!P\par +$(reset)$(normal)$3\par +$(reset)$(normal)Defined in: $!P\par .tag=btype, help, 3, 20, $2 .order=bfield comm ex .parsesource=btype -.pre=\page +.pre=\page $(reset)$(heading_1) ##{\footnote ## $!c} $${\footnote $$ $!n} K{\footnote K functions; $!n} -+{\footnote + functions:0000} -$2\par ++{\footnote + functions:0000} +$2\par $[bstruct] -$(reset)$(normal)$3\par -$(reset)$(normal)Defined in: $!P\par +$(reset)$(normal)$3\par +$(reset)$(normal)Defined in: $!P\par ; ; *********************************************************** @@ -401,59 +401,59 @@ $(reset)$(normal)Defined in: $!P\par .tag=func, doc, 3, 20, $2 .order=syntax rdesc parm parmvar comm ex .parsesource=function -.pre=$(reset)$(rule)\par -$(reset)$(heading_1)$2\par +.pre=$(reset)$(rule)\par +$(reset)$(heading_1)$2\par $[function] -$(reset)$(normal)$3\par -$(reset)$(normal)Defined in: $!P\par +$(reset)$(normal)$3\par +$(reset)$(normal)Defined in: $!P\par .tag=func, help, 3, 20, $2 .order=syntax rdesc parm parmvar comm ex .parsesource=function -.pre=\page +.pre=\page $(reset)$(heading_1) ##{\footnote ## $!c} $${\footnote $$ $!n} K{\footnote K functions; $!n} -+{\footnote + functions:0000} -$2\par ++{\footnote + functions:0000} +$2\par $[function] -$(reset)$(normal)$3\par -$(reset)$(normal)Defined in: $!P\par +$(reset)$(normal)$3\par +$(reset)$(normal)Defined in: $!P\par ; Functions .tag=cb, doc, 3, 20, $2 .order=syntax rdesc parm parmvar comm ex .parsesource=function -.pre=$(reset)$(rule)\par -$(reset)$(heading_1)$2\par +.pre=$(reset)$(rule)\par +$(reset)$(heading_1)$2\par $[function] -$(reset)$(normal)$3\par -$(reset)$(normal)Defined in: $!P\par +$(reset)$(normal)$3\par +$(reset)$(normal)Defined in: $!P\par .tag=cb, help, 3, 20, $2 .order=syntax rdesc parm parmvar comm ex .parsesource=function -.pre=\page +.pre=\page $(reset)$(heading_1) ##{\footnote ## $!c} $${\footnote $$ $!n} K{\footnote K callback functions; functions; $!n callback function} -+{\footnote + functions:0000} -$2\par ++{\footnote + functions:0000} +$2\par $[function] -$(reset)$(normal)$3\par -$(reset)$(normal)Defined in: $!P\par +$(reset)$(normal)$3\par +$(reset)$(normal)Defined in: $!P\par ; Messages .tag=msg, doc, 2, 30, $1 .order=rdesc parm comm ex -.pre=$(reset)$(rule)\par -$(reset)$(heading_1)$1\par -$(reset)$(normal)$2\par -$(reset)$(normal)Defined in: $!P\par +.pre=$(reset)$(rule)\par +$(reset)$(heading_1)$1\par +$(reset)$(normal)$2\par +$(reset)$(normal)Defined in: $!P\par .tag=msg, help, 2, 30, $1 .order=rdesc parm comm ex @@ -461,21 +461,21 @@ $(reset)$(normal)Defined in: $!P\par ##{\footnote ## $!c} $${\footnote $$ $!n} K{\footnote K messages; $!n} -+{\footnote + messages:0000} -$1\par -$(reset)$(normal)$2\par -$(reset)$(normal)Defined in: $!P\par ++{\footnote + messages:0000} +$1\par +$(reset)$(normal)$2\par +$(reset)$(normal)Defined in: $!P\par ; Constants .tag=const, doc, 3, 30, $2 .order=comm ex .parsesource=constant -.pre=$(reset)$(rule)\par -$(reset)$(heading_1)$2 constant\par -$(reset)$(normal)$[constant]\par -$(reset)$(normal)Defined in: $!P\par -$(reset)$(normal)$3\par +.pre=$(reset)$(rule)\par +$(reset)$(heading_1)$2 constant\par +$(reset)$(normal)$[constant]\par +$(reset)$(normal)Defined in: $!P\par +$(reset)$(normal)$3\par .tag=const, help, 3, 30, $2 .order=comm ex @@ -484,89 +484,89 @@ $(reset)$(normal)$3\par ##{\footnote ## $!c} $${\footnote $$ $!n} K{\footnote K constants; $!n constant} -+{\footnote + constants:0000} -$2 constant\par -$(reset)$(normal)$[constant]\par -$(reset)$(normal)Defined in: $!P\par -$(reset)$(normal)$3\par ++{\footnote + constants:0000} +$2 constant\par +$(reset)$(normal)$[constant]\par +$(reset)$(normal)Defined in: $!P\par +$(reset)$(normal)$3\par ; Data types (typedefs, etc.) .tag=type, doc, 2, 50, $1 .order=field comm ex -.pre=$(reset)$(rule)\par -$(reset)$(heading_1)$1\par -$(reset)$(normal)$2\par -$(reset)$(normal)Defined in: $!P\par +.pre=$(reset)$(rule)\par +$(reset)$(heading_1)$1\par +$(reset)$(normal)$2\par +$(reset)$(normal)Defined in: $!P\par .tag=type, help, 2, 50, $1 .order=field comm ex -.pre=\page +.pre=\page $(reset)$(heading_1) ##{\footnote ## $!c} $${\footnote $$ $!n} K{\footnote K types; typedefs; $1} -+{\footnote + struct:0000} -$1\par -$(reset)$(normal)$2\par -$(reset)$(normal)Defined in: $!P\par ++{\footnote + struct:0000} +$1\par +$(reset)$(normal)$2\par +$(reset)$(normal)Defined in: $!P\par ; Structures .tag=struct, doc, 2, 50, $1 .parsesource=struct .order=field comm ex -.pre=$(reset)$(rule)\par -$(reset)$(heading_1)$1 Structure\par +.pre=$(reset)$(rule)\par +$(reset)$(heading_1)$1 Structure\par $[structure] -$(reset)$(normal)$2\par -$(reset)$(normal)Defined in: $!P\par +$(reset)$(normal)$2\par +$(reset)$(normal)Defined in: $!P\par .tag=struct, help, 2, 50, $1 .parsesource=struct .order=field comm ex -.pre=\page +.pre=\page $(reset)$(heading_1) ##{\footnote ## $!c} $${\footnote $$ $!n} K{\footnote K types; structures; $1} -+{\footnote + struct:0000} -$1 Structure\par ++{\footnote + struct:0000} +$1 Structure\par $[structure] -$(reset)$(normal)$2\par -$(reset)$(normal)Defined in: $!P\par +$(reset)$(normal)$2\par +$(reset)$(normal)Defined in: $!P\par ; Modules .tag=module, doc, 2, 10, $1 -.pre=$(reset)$(rule)\par -$(reset)$(heading_1)Module $1\par -$(reset)$(normal)Filename: $!P\par -$(reset)$(rmh)Description\par -$(reset)$(normal)$2\par +.pre=$(reset)$(rule)\par +$(reset)$(heading_1)Module $1\par +$(reset)$(normal)Filename: $!P\par +$(reset)$(rmh)Description\par +$(reset)$(normal)$2\par .tag=module, help, 2, 10, $1 -.pre=\page +.pre=\page $(reset)$(heading_1) ##{\footnote ## $!c} $${\footnote $$ $!n} K{\footnote K modules; $1} -+{\footnote + overviews:0000} -Module $1\par -$(reset)$(normal)Filename: $!P\par -$(reset)$(rmh)Description\par -$(reset)$(normal)$2\par ++{\footnote + overviews:0000} +Module $1\par +$(reset)$(normal)Filename: $!P\par +$(reset)$(rmh)Description\par +$(reset)$(normal)$2\par ; Enumeration Types .tag=enum, doc, 2, 50, $1 .parsesource=enum .order=emem comm ex -.pre=$(reset)$(rule)\par -$(reset)$(heading_1)$1\par +.pre=$(reset)$(rule)\par +$(reset)$(heading_1)$1\par $[enum] $(reset)$(normal)$2\par -$(reset)$(normal)Defined in: $!P\par +$(reset)$(normal)Defined in: $!P\par .tag=enum, help, 2, 50, $1 .order=emem comm ex @@ -575,11 +575,11 @@ $(reset)$(normal)Defined in: $!P\par ##{\footnote ## $!c} $${\footnote $$ $!n} K{\footnote K types; enumeration types; $1} -+{\footnote + types:0000} ++{\footnote + types:0000} $(reset)$(heading_1)$1\par $[enum] $(reset)$(normal)$2\par -$(reset)$(normal)Defined in: $!P\par +$(reset)$(normal)Defined in: $!P\par ; *********************************************************** ; C++ Language topics @@ -589,11 +589,11 @@ $(reset)$(normal)Defined in: $!P\par .tag=class, doc, 2, 20, $1 .parsesource=class -.pre=$(reset)$(rule)\par -$(reset)$(heading_1)$1 Class\par +.pre=$(reset)$(rule)\par +$(reset)$(heading_1)$1 Class\par $[class] -$(reset)$(normal)$2\par -$(reset)$(normal)Defined in: $!P\par +$(reset)$(normal)$2\par +$(reset)$(normal)Defined in: $!P\par .tag=class, help, 2, 20, $1 .parsesource=class @@ -602,21 +602,21 @@ $(reset)$(heading_1) ##{\footnote ## $!c} $${\footnote $$ $!n (class)} K{\footnote K classes; $!n} -+{\footnote + classes:0000} -$1 Class\par ++{\footnote + classes:0000} +$1 Class\par $[class] -$(reset)$(normal)$2\par -$(reset)$(normal)Defined in: $!P\par +$(reset)$(normal)$2\par +$(reset)$(normal)Defined in: $!P\par ; Member Classes .tag=mclass, doc, 3, 20, $1::$2 .parsesource=class -.pre=$(reset)$(rule)\par -$(reset)$(heading_1)$!n Class\par +.pre=$(reset)$(rule)\par +$(reset)$(heading_1)$!n Class\par $[mclass] -$(reset)$(normal)$3\par -$(reset)$(normal)Defined in: $!P\par +$(reset)$(normal)$3\par +$(reset)$(normal)Defined in: $!P\par .tag=mclass, help, 3, 20, $1::$2 .parsesource=class @@ -625,11 +625,11 @@ $(reset)$(heading_1) ##{\footnote ## $!c} $${\footnote $$ $!n (class)} K{\footnote K classes; $!n} -+{\footnote + classes:0000} -$!n Class\par ++{\footnote + classes:0000} +$!n Class\par $[mclass] -$(reset)$(normal)$3\par -$(reset)$(normal)Defined in: $!P\par +$(reset)$(normal)$3\par +$(reset)$(normal)Defined in: $!P\par ; Member functions @@ -637,80 +637,80 @@ $(reset)$(normal)Defined in: $!P\par .context=$2::$3 .order=syntax rdesc parm comm ex .parsesource=memberfunction -.pre=$(reset)$(rule)\par -$(reset)$(heading_1)$2::$3\par +.pre=$(reset)$(rule)\par +$(reset)$(heading_1)$2::$3\par $[mfunction] -$(reset)$(normal)$4\par -$(reset)$(normal)Defined in: $!P\par +$(reset)$(normal)$4\par +$(reset)$(normal)Defined in: $!P\par .tag=mfunc, help, 4, 20, $2::$3 .context=$2::$3 .order=syntax rdesc parm comm ex .parsesource=memberfunction -.pre=\page +.pre=\page $(reset)$(heading_1) ##{\footnote ## $!c} $${\footnote $$ $!n} K{\footnote K functions; member functions; class member functions; $3; $!n} -+{\footnote + functions:0000} -$2::$3\par ++{\footnote + functions:0000} +$2::$3\par $[mfunction] -$(reset)$(normal)$4\par -$(reset)$(normal)Defined in: $!P\par +$(reset)$(normal)$4\par +$(reset)$(normal)Defined in: $!P\par ; Member data .tag=mdata, doc, 4, 20, $2::$3 .order=comm ex -.pre=$(reset)$(rule)\par -$(reset)$(heading_1)$2::$3\par +.pre=$(reset)$(rule)\par +$(reset)$(heading_1)$2::$3\par $[mdata] -$(reset)$(normal)$4\par +$(reset)$(normal)$4\par .tag=mdata, help, 4, 20, $2::$3 .order=comm ex -.pre=\page +.pre=\page $(reset)$(heading_1) ##{\footnote ## $!c} $${\footnote $$ $!n} K{\footnote K member data; class member data; $2::$3} -+{\footnote + functions:0000} -$2::$3\par ++{\footnote + functions:0000} +$2::$3\par $[mdata] -$(reset)$(normal)$4\par +$(reset)$(normal)$4\par ; Member structure .tag=mstruct, doc, 3, 50, $1::$2 .order=field comm ex -.pre=$(reset)$(rule)\par -$(reset)$(heading_1)$1::$2 Structure\par +.pre=$(reset)$(rule)\par +$(reset)$(heading_1)$1::$2 Structure\par $[structure] -$(reset)$(normal)$3\par -$(reset)$(normal)Defined in: $!P\par +$(reset)$(normal)$3\par +$(reset)$(normal)Defined in: $!P\par .tag=mstruct, help, 3, 50, $1::$2 .order=field comm ex -.pre=\page +.pre=\page $(reset)$(heading_1) ##{\footnote ## $!c} $${\footnote $$ $!n} K{\footnote K types; structures; $!n} -+{\footnote + struct:0000} -$1::$2 Structure\par ++{\footnote + struct:0000} +$1::$2 Structure\par $[structure] -$(reset)$(normal)$3\par -$(reset)$(normal)Defined in: $!P\par +$(reset)$(normal)$3\par +$(reset)$(normal)Defined in: $!P\par ; Member enumerations ; .tag=menum, doc, 3, 50, $1::$2 .order=emem comm ex -.pre=$(reset)$(rule)\par -$(reset)$(heading_1)$1::$2\par +.pre=$(reset)$(rule)\par +$(reset)$(heading_1)$1::$2\par $[enum] $(reset)$(normal)$3\par -$(reset)$(normal)Defined in: $!P\par +$(reset)$(normal)Defined in: $!P\par .tag=menum, help, 3, 50, $1::$2 .order=emem comm ex @@ -718,11 +718,11 @@ $(reset)$(normal)Defined in: $!P\par ##{\footnote ## $!c} $${\footnote $$ $!n} K{\footnote K types; enumeration types; $1; $!n} -+{\footnote + types:0000} ++{\footnote + types:0000} $(reset)$(heading_1)$!n\par $[enum] $(reset)$(normal)$3\par -$(reset)$(normal)Defined in: $!P\par +$(reset)$(normal)Defined in: $!P\par ; ; @@ -734,154 +734,154 @@ $(reset)$(normal)Defined in: $!P\par ; @object Point2D | Represents a two-dimensional coordinate. .tag=object, doc, 2, 20, $1 -.pre=$(reset)$(rule)\par +.pre=$(reset)$(rule)\par $(reset)$(heading_1)$1 Object\par -$(reset)$(rmh)Description\par -$(reset)$(normal)$2\par -$(reset)$(normal)Defined in: $!P\par +$(reset)$(rmh)Description\par +$(reset)$(normal)$2\par +$(reset)$(normal)Defined in: $!P\par .tag=object, help, 2, 20, $1 -.pre=\page +.pre=\page ##{\footnote ## $!c} $${\footnote $$ $1 object} K{\footnote K OLE objects; objects; $1 object} -+{\footnote + OLE:0000} ++{\footnote + OLE:0000} $(reset)$(heading_1)$1 Object\par -$(reset)$(normal)$2\par -$(reset)$(normal)Defined in: $!P\par +$(reset)$(normal)$2\par +$(reset)$(normal)Defined in: $!P\par ; Abstract objects .tag=abstract, doc, 2, 20, $1 -.pre=$(reset)$(rule)\par +.pre=$(reset)$(rule)\par $(reset)$(heading_1)$1 Abstract Object\par -$(reset)$(rmh)Description\par -$(reset)$(normal)$2\par +$(reset)$(rmh)Description\par +$(reset)$(normal)$2\par .tag=abstract, help, 2, 20, $1 -.pre=\page +.pre=\page ##{\footnote ## $!c} $${\footnote $$ $1 abstract object} K{\footnote K abstract objects; $1 abstract object; $1 object} -+{\footnote + OLE:0000} ++{\footnote + OLE:0000} $(reset)$(heading_1)$1 Abstract Object\par -$(reset)$(normal)$2\par -$(reset)$(normal)Defined in: $!P\par +$(reset)$(normal)$2\par +$(reset)$(normal)Defined in: $!P\par ; Interfaces .tag=interface, doc, 2, 20, $1 .context=$1_int -.pre=$(reset)$(rule)\par +.pre=$(reset)$(rule)\par $(reset)$(heading_1)$1 Interface\par -$(reset)$(normal)$2\par -$(reset)$(normal)Defined in: $!P\par +$(reset)$(normal)$2\par +$(reset)$(normal)Defined in: $!P\par .tag=interface, help, 2, 20, $1 .context=$1_int -.pre=\page +.pre=\page ##{\footnote ## $!c} $${\footnote $$ $!n} K{\footnote K OLE interfaces; interfaces; $!n interface} -+{\footnote + OLE:0000} ++{\footnote + OLE:0000} $(reset)$(heading_1)$!n\par -$(reset)$(normal)$2\par -$(reset)$(normal)Defined in: $!P\par +$(reset)$(normal)$2\par +$(reset)$(normal)Defined in: $!P\par ; Object methods .tag=method, doc, 4, 20, $2::$3 .context=$2::$3_meth .order=rvalue rdesc parm comm ex -.pre=$(reset)$(rule)\par -$(reset)$(heading_1)$2::$3 Method\par +.pre=$(reset)$(rule)\par +$(reset)$(heading_1)$2::$3 Method\par $[method] -$(reset)$(normal)$4\par -$(reset)$(normal)Defined in: $!P\par +$(reset)$(normal)$4\par +$(reset)$(normal)Defined in: $!P\par .tag=method, help, 4, 20, $2::$3 .context=$2::$3_meth .order=rvalue rdesc parm comm ex -.pre=\page +.pre=\page ##{\footnote ## $!c} $${\footnote $$ $!n} K{\footnote K interface methods; methods; $3 method;$!n method} -+{\footnote + OLE:0000} -$(reset)$(heading_1)$!n\par ++{\footnote + OLE:0000} +$(reset)$(heading_1)$!n\par $[method] -$(reset)$(normal)$4\par -$(reset)$(normal)Defined in: $!P\par +$(reset)$(normal)$4\par +$(reset)$(normal)Defined in: $!P\par ; Object properties .tag=property, doc, 4, 20, $2::$3 .order=rdesc comm ex .context=$2::$3_prop -.pre=$(reset)$(rule)\par +.pre=$(reset)$(rule)\par $(reset)$(heading_1)$2::$3 Property\par -$(reset)$(rmh)Data Type\par -$(reset)$(normal){\b $1}\par -$(reset)$(rmh)Description\par -$(reset)$(normal)$4\par -$(reset)$(normal)Defined in: $!P\par +$(reset)$(rmh)Data Type\par +$(reset)$(normal){\b $1}\par +$(reset)$(rmh)Description\par +$(reset)$(normal)$4\par +$(reset)$(normal)Defined in: $!P\par .tag=property, help, 4, 20, $2::$3 .order=rdesc comm ex .context=$2::$3_prop -.pre=\page +.pre=\page ##{\footnote ## $!c} $${\footnote $$ $!n} K{\footnote K OLE object properties; properties; $3 property;$!n property} -+{\footnote + OLE:0000} -$(reset)$(heading_1)$!n\par -$(reset)$(rmh)Data Type\par -$(reset)$(normal){\b $1}\par -$(reset)$(rmh)Description\par -$(reset)$(normal)$4\par -$(reset)$(normal)Defined in: $!P\par ++{\footnote + OLE:0000} +$(reset)$(heading_1)$!n\par +$(reset)$(rmh)Data Type\par +$(reset)$(normal){\b $1}\par +$(reset)$(rmh)Description\par +$(reset)$(normal)$4\par +$(reset)$(normal)Defined in: $!P\par ; Object events .tag=event, doc, 3, 20, $1::$2 .context=$1::$2_event .order=parm comm ex -.pre=$(reset)$(rule)\par +.pre=$(reset)$(rule)\par $(reset)$(heading_1)$!n\par $[event] -$(reset)$(rmh)Description\par -$(reset)$(normal)$3\par -$(reset)$(normal)Defined in: $!P\par +$(reset)$(rmh)Description\par +$(reset)$(normal)$3\par +$(reset)$(normal)Defined in: $!P\par .tag=event, help, 3, 20, $1::$2 .context=$1::$2_event .order=parm comm ex -.pre=\page +.pre=\page ##{\footnote ## $!c} $${\footnote $$ $!n} K{\footnote K OLE object events; events; $2 event;$!n event} -+{\footnote + OLE:0000} -$(reset)$(heading_1)$1::$2 Event\par ++{\footnote + OLE:0000} +$(reset)$(heading_1)$1::$2 Event\par $[event] -$(reset)$(rmh)Description\par -$(reset)$(normal)$3\par -$(reset)$(normal)Defined in: $!P\par +$(reset)$(rmh)Description\par +$(reset)$(normal)$3\par +$(reset)$(normal)Defined in: $!P\par ; ; *********************************************************** ; Overview Topics ; *********************************************************** .tag=topic, doc, 2, 5, $1 -.pre=\pard\plain $(heading_1)$1\par -\pard\plain $(normal)$2\par +.pre=\pard\plain $(heading_1)$1\par +\pard\plain $(normal)$2\par .tag=topic, help, 2, 5, $1 .pre=\page \pard\plain $(heading_1) ##{\footnote ## #1} $${\footnote $$ $1} K{\footnote K $1} -+{\footnote + overviews:0000} -$1\par -\pard\plain $(normal)$2\par ++{\footnote + overviews:0000} +$1\par +\pard\plain $(normal)$2\par ; ; *********************************************************** @@ -889,30 +889,30 @@ $1\par ; *********************************************************** .tag=Contents1, doc, 2, 0, __aaa$1 -.pre=$(reset)$(heading_1)$1\par -$(reset)$(indexlink)$2\par +.pre=$(reset)$(heading_1)$1\par +$(reset)$(indexlink)$2\par .tag=contents1, help, 2, 0, __aaa$1 .pre=\pard\plain $(heading_1) ##{\footnote ## #1} $${\footnote $$ $1} K{\footnote K $1} -+{\footnote + Contents:0000} -$1\par -$(reset)$(indexlink)$2\par ++{\footnote + Contents:0000} +$1\par +$(reset)$(indexlink)$2\par .tag=Contents2, doc, 2, 0, _aaa$1 -.pre=$(reset)$(heading_1)$1\par -$(reset)$(indexlink)$2\par +.pre=$(reset)$(heading_1)$1\par +$(reset)$(indexlink)$2\par .tag=contents2, help, 2, 0, _aaa$1 .pre=\page $(reset)$(heading_1) ##{\footnote ## #1} $${\footnote $$ $1} K{\footnote K $1} -+{\footnote + Contents:0000} -$1\par -$(reset)$(indexlink)$2\par ++{\footnote + Contents:0000} +$1\par +$(reset)$(indexlink)$2\par ; *********************************************************************** ; *********************************************************************** @@ -950,15 +950,15 @@ $(reset)$(def1)$3$(par) ; .tag=bparm, both, 4, 1 .parsesource=bparameter -.pre=$(reset)$(rmh)Parameters\par -.format=$(reset)$(term1){\i $2}\par -$(reset)$(def1)$4\par +.pre=$(reset)$(rmh)Parameters\par +.format=$(reset)$(term1){\i $2}\par +$(reset)$(def1)$4\par .tag=bfield, both, 3, 1 .parsesource=bfield -.pre=$(reset)$(rmh)Fields\par -.format=$(reset)$(term1)$1\par -$(reset)$(def1)$3\par +.pre=$(reset)$(rmh)Fields\par +.format=$(reset)$(term1)$1\par +$(reset)$(def1)$3\par @@ -970,110 +970,110 @@ $(reset)$(def1)$3\par ; Parameters .tag=parm, both, 3, 1 .parsesource=parameter -.pre=$(reset)$(rmh)Parameters\par -.format=$(reset)$(term1){\i $2}\par -$(reset)$(def1)$3\par +.pre=$(reset)$(rmh)Parameters\par +.format=$(reset)$(term1){\i $2}\par +$(reset)$(def1)$3\par ; Optional Parameters .tag=parmopt, both, 4, 1 .parsesource=parameteropt .pre=$[parmopthead] -.format=$(reset)$(term1){\i $2}\par -$(reset)$(def1)$4\par +.format=$(reset)$(term1){\i $2}\par +$(reset)$(def1)$4\par ; Variable length parameter list .tag=parmvar, both, 1, 1 -.pre=$(reset)$(rmh)Parameters\par -.format=$(reset)$(term1){\b ...}\par -$(reset)$(def1)$1\par +.pre=$(reset)$(rmh)Parameters\par +.format=$(reset)$(term1){\b ...}\par +$(reset)$(def1)$1\par -; Class template arguments +; Class template arguments .tag=tcarg, both, 3, 1 .parsesource=parameter -.pre=$(reset)$(rmh)Class Template Arguments\par -.format=$(reset)$(term1){\i $2}\par -$(reset)$(def1)$3\par +.pre=$(reset)$(rmh)Class Template Arguments\par +.format=$(reset)$(term1){\i $2}\par +$(reset)$(def1)$3\par -; Function template arguments +; Function template arguments .tag=tfarg, both, 3, 1 .parsesource=parameter -.pre=$(reset)$(rmh)Function Template Arguments\par -.format=$(reset)$(term1){\i $2}\par -$(reset)$(def1)$3\par +.pre=$(reset)$(rmh)Function Template Arguments\par +.format=$(reset)$(term1){\i $2}\par +$(reset)$(def1)$3\par .tag=field, both, 3, 1 .parsesource=field -.pre=$(reset)$(rmh)Members\par -.format=$(reset)$(term1){\b $2}\par -$(reset)$(def1)$3\par +.pre=$(reset)$(rmh)Members\par +.format=$(reset)$(term1){\b $2}\par +$(reset)$(def1)$3\par .tag=flag, both, 2, 2 -.format=$(reset)$(term2)$1\par -$(reset)$(def2)$2\par +.format=$(reset)$(term2)$1\par +$(reset)$(def2)$2\par .tag=rdesc, both, 1, 1 -.pre=$(reset)$(rmh)Return Value\par -.format=$(reset)$(normal)$1\par +.pre=$(reset)$(rmh)Return Value\par +.format=$(reset)$(normal)$1\par .tag=emem, both, 2, 1 .parsesource=emem -.pre=\pard\plain $(rmh)Members\par -.format=\pard\plain $(term1){\b $1}\par -\pard\plain $(def1)$2\par +.pre=\pard\plain $(rmh)Members\par +.format=\pard\plain $(term1){\b $1}\par +\pard\plain $(def1)$2\par .tag=field, both, 3, 1 .parsesource=parameter -.pre=$(reset)$(rmh)Members\par -.format=$(reset)$(term1){\b $2}\par -$(reset)$(def1)$3\par +.pre=$(reset)$(rmh)Members\par +.format=$(reset)$(term1){\b $2}\par +$(reset)$(def1)$3\par ; Global variables .tag=globalv, help, 3, 1 .parsesource=parameter -.pre=$(reset)$(rmh)Global Variables\par -.format=$(reset)$(term1){\uldb $1}{\v $1} {\b $2}\par -$(reset)$(def1)$3\par +.pre=$(reset)$(rmh)Global Variables\par +.format=$(reset)$(term1){\uldb $1}{\v $1} {\b $2}\par +$(reset)$(def1)$3\par .if=exists($1) .tag=globalv, both, 3, 1 .parsesource=parameter -.pre=$(reset)$(rmh)Global Variables\par -.format=$(reset)$(term1){\b $1 $2}\par -$(reset)$(def1)$3\par +.pre=$(reset)$(rmh)Global Variables\par +.format=$(reset)$(term1){\b $1 $2}\par +$(reset)$(def1)$3\par ; ; *********************************************************** ; Misc Tags ; *********************************************************** .tag=comm, both, 1, 1 -.pre=$(reset)$(rmh)Comments\par -.format=$(reset)$(normal)$1\par +.pre=$(reset)$(rmh)Comments\par +.format=$(reset)$(normal)$1\par .tag=xref, both, 1, 1 -.pre=$(reset)$(rmh)See Also\par -.format=$(reset)$(normal)$1\par +.pre=$(reset)$(rmh)See Also\par +.format=$(reset)$(normal)$1\par .tag=ex, both, 2, 1, 1 -.pre=$(reset)$(rmh)Example\par -.format=$(reset)$(normal)$1\par -$(reset)$(ex)$2\par -$(reset)$(ex)\par +.pre=$(reset)$(rmh)Example\par +.format=$(reset)$(normal)$1\par +$(reset)$(ex)$2\par +$(reset)$(ex)\par .tag=iex, both, 1, 8, 1 -.format=$(reset)$(ex)$1\par -$(reset)$(ex)\par +.format=$(reset)$(ex)$1\par +$(reset)$(ex)\par .tag=devnote, both, 1, 1 -.pre=$(reset)$(rmh)\cf6 Developer Notes\par -.format=$(reset)$(normal)\cf6 $1\par +.pre=$(reset)$(rmh)\cf6 Developer Notes\par +.format=$(reset)$(normal)\cf6 $1\par .tag=todo, both, 1, 1 -.pre=$(reset)$(rmh)\cf6 To Do\par -.format=$(reset)$(normal)\cf6 $1\par +.pre=$(reset)$(rmh)\cf6 To Do\par +.format=$(reset)$(normal)\cf6 $1\par .tag=syntax, both, 1, 1 -.pre=\pard\plain $(rmh)Syntax\par -.format=\pard\plain $(normal)$1\par +.pre=\pard\plain $(rmh)Syntax\par +.format=\pard\plain $(normal)$1\par ; ; *********************************************************** @@ -1081,19 +1081,19 @@ $(reset)$(ex)\par ; *********************************************************** .tag=access, both, 1, 1 -.pre=$(reset)$(rmh)Class Members\par -.format=$(reset)$(normal){\b $1}\par +.pre=$(reset)$(rmh)Class Members\par +.format=$(reset)$(normal){\b $1}\par .tag=fr, help, 2, 1 .parsesource=friend -.pre=$(reset)$(rmh)Class Friends\par -.format=$(reset)$(normal){\uldb $1}{\v #1}{\b :} $2\par +.pre=$(reset)$(rmh)Class Friends\par +.format=$(reset)$(normal){\uldb $1}{\v #1}{\b :} $2\par .if=exists($1) .tag=fr, both, 2, 1 .parsesource=friend -.pre=$(reset)$(rmh)Class Friends\par -.format=$(reset)$(normal){\b $1:} $2\par +.pre=$(reset)$(rmh)Class Friends\par +.format=$(reset)$(normal){\b $1:} $2\par ;@CMEMBER ; Replacement for @member - uses automatic parsing, 4 fields @@ -1102,8 +1102,8 @@ $(reset)$(ex)\par .tag=cmember, help, 4, 2 .pre=$[classhdr] -.format=$(reset)$(term1){\uldb $1}{\v #1} {\uldb $2}{\v #class.1__#2}\par -$(reset)$(def1)$4\par +.format=$(reset)$(term1){\uldb $1}{\v #1} {\uldb $2}{\v #class.1__#2}\par +$(reset)$(def1)$4\par .if=exists($class.1::$<2),fieldempty(3),exists($1) .parsesource=classmember @@ -1116,8 +1116,8 @@ $(reset)$(def1)$4\par .tag=cmember, help, 4, 2 .pre=$[classhdr] -.format=$(reset)$(term1){\uldb $1}{\v #1} {\uldb $2}{\v #class.1__#2}{\b $3}\par -$(reset)$(def1)$4\par +.format=$(reset)$(term1){\uldb $1}{\v #1} {\uldb $2}{\v #class.1__#2}{\b $3}\par +$(reset)$(def1)$4\par .if=exists($class.1::$<2),exists($1) .parsesource=classmember @@ -1126,8 +1126,8 @@ $(reset)$(def1)$4\par .tag=cmember, help, 4, 2 .pre=$[classhdr] -.format=$(reset)$(term1){\b $1} {\uldb $2}{\v #class.1__#2}\par -$(reset)$(def1)$4\par +.format=$(reset)$(term1){\b $1} {\uldb $2}{\v #class.1__#2}\par +$(reset)$(def1)$4\par .if=exists($class.1::$<2),fieldempty(3) .parsesource=classmember @@ -1136,8 +1136,8 @@ $(reset)$(def1)$4\par .tag=cmember, help, 4, 2 .pre=$[classhdr] -.format=$(reset)$(term1){\uldb $2}{\v #class.1__#2}{\b $3}\par -$(reset)$(def1)$4\par +.format=$(reset)$(term1){\uldb $2}{\v #class.1__#2}{\b $3}\par +$(reset)$(def1)$4\par .if=exists($class.1::$<2),fieldempty(1) .parsesource=classmember @@ -1146,8 +1146,8 @@ $(reset)$(def1)$4\par .tag=cmember, help, 4, 2 .pre=$[classhdr] -.format=$(reset)$(term1){\b $1} {\uldb $2}{\v #class.1__#2}{\b $3}\par -$(reset)$(def1)$4\par +.format=$(reset)$(term1){\b $1} {\uldb $2}{\v #class.1__#2}{\b $3}\par +$(reset)$(def1)$4\par .if=exists($class.1::$<2) .parsesource=classmember @@ -1156,8 +1156,8 @@ $(reset)$(def1)$4\par .tag=cmember, both, 4, 2 .pre=$[classhdr] -.format=$(reset)$(term1){\b $1 $2}\par -$(reset)$(def1)$4\par +.format=$(reset)$(term1){\b $1 $2}\par +$(reset)$(def1)$4\par .parsesource=classmember .if=fieldempty(3) @@ -1170,8 +1170,8 @@ $(reset)$(def1)$4\par .tag=cmember, both, 4, 2 .pre=$[classhdr] -.format=$(reset)$(term1){\b $2$3}\par -$(reset)$(def1)$4\par +.format=$(reset)$(term1){\b $2$3}\par +$(reset)$(def1)$4\par .parsesource=classmember .if=fieldempty(1) @@ -1180,21 +1180,21 @@ $(reset)$(def1)$4\par .tag=cmember, both, 4, 2 .pre=$[classhdr] -.format=$(reset)$(term1){\b $1 $2$3}\par -$(reset)$(def1)$4\par +.format=$(reset)$(term1){\b $1 $2$3}\par +$(reset)$(def1)$4\par .parsesource=classmember ; Old @member tag .tag=member, help, 2, 2 -.format=$(reset)$(term1){\uldb $1}{\v #class.1__#1}\par -$(reset)$(def1)$2\par +.format=$(reset)$(term1){\uldb $1}{\v #class.1__#1}\par +$(reset)$(def1)$2\par .if=exists($class.1::$1) .tag=member, both, 2, 2 -.format=$(reset)$(term1){\b $1}\par -$(reset)$(def1)$2\par +.format=$(reset)$(term1){\b $1}\par +$(reset)$(def1)$2\par ; used to specify base classes for a C++ class ; @@ -1202,13 +1202,13 @@ $(reset)$(def1)$2\par ; in an "@class" topic the base class shows up in the diagram. .tag=base, help, 2, 1 -.pre=$(reset)$(rmh)Based On\par -.format=$(reset)$(normal){\uldb $2}{\v $2_int}\par +.pre=$(reset)$(rmh)Based On\par +.format=$(reset)$(normal){\uldb $2}{\v $2_int}\par .if=exists($2_int), tagexists(interface) .tag=base, both, 2, 1 -.pre=$(reset)$(rmh)Based On\par -.format=$(reset)$(normal){\b $2}\par +.pre=$(reset)$(rmh)Based On\par +.format=$(reset)$(normal){\b $2}\par .if=tagexists(interface) .tag=base, both, 2, 1 @@ -1231,27 +1231,27 @@ $(reset)$(def1)$2\par .tag=meth, help, 3, 1 .map=method,$1,$t.1,$2,$3 .parsesource=method -.pre=$(reset)$(rmh)Methods\par -.format=$(reset)$(term1){\uldb $1}{\v #1} {\uldb $2}{\v I#interface.1__#2_meth}\par -$(reset)$(def1)$3\par +.pre=$(reset)$(rmh)Methods\par +.format=$(reset)$(term1){\uldb $1}{\v #1} {\uldb $2}{\v I#interface.1__#2_meth}\par +$(reset)$(def1)$3\par .if=exists($1),exists($interface.1::$2_meth) ; link name .tag=meth, help, 3, 1 .parsesource=method -.pre=$(reset)$(rmh)Methods\par -.format=$(reset)$(term1){\b $1} {\uldb $2}{\v #interface.1__#2_meth}\par -$(reset)$(def1)$3\par +.pre=$(reset)$(rmh)Methods\par +.format=$(reset)$(term1){\b $1} {\uldb $2}{\v #interface.1__#2_meth}\par +$(reset)$(def1)$3\par .if=exists($interface.1::$2_meth) ; link type only .tag=meth, help, 3, 1 .parsesource=method -.pre=$(reset)$(rmh)Methods\par -.format=$(reset)$(term1){\uldb $1}{\v #1} {\b $2}\par -$(reset)$(def1)$3\par +.pre=$(reset)$(rmh)Methods\par +.format=$(reset)$(term1){\uldb $1}{\v #1} {\b $2}\par +$(reset)$(def1)$3\par .if=exists($1) ; no links or doc @@ -1259,9 +1259,9 @@ $(reset)$(def1)$3\par .tag=meth, both, 3, 1 .parsesource=method .map=method,$1,$t.1,$2,$3 -.pre=$(reset)$(rmh)Methods\par -.format=$(reset)$(term1){\b $1 $2}\par -$(reset)$(def1)$3\par +.pre=$(reset)$(rmh)Methods\par +.format=$(reset)$(term1){\b $1 $2}\par +$(reset)$(def1)$3\par ; *** Properties *** @@ -1270,45 +1270,45 @@ $(reset)$(def1)$3\par .tag=prop, help, 3, 1 .map=property,$1,$t.1,$2,$3 .parsesource=method -.pre=$(reset)$(rmh)Properties\par -.format=$(reset)$(term1){\uldb $1}{\v #1_int} {\uldb $2}{\v #interface.1__#2_prop}\par -$(reset)$(def1)$3\par +.pre=$(reset)$(rmh)Properties\par +.format=$(reset)$(term1){\uldb $1}{\v #1_int} {\uldb $2}{\v #interface.1__#2_prop}\par +$(reset)$(def1)$3\par .if=tagexists(interface),exists($1_int),exists($interface.1::$2_prop) ;link type and name .tag=prop, help, 3, 1 .parsesource=method -.pre=$(reset)$(rmh)Properties\par -.format=$(reset)$(term1){\uldb $1}{\v #1} {\uldb $2}{\v #interface.1__#2_prop}\par -$(reset)$(def1)$3\par +.pre=$(reset)$(rmh)Properties\par +.format=$(reset)$(term1){\uldb $1}{\v #1} {\uldb $2}{\v #interface.1__#2_prop}\par +$(reset)$(def1)$3\par .if=exists($1),exists($interface.1::$2_prop) ;link name only .tag=prop, help, 3, 1 .parsesource=method -.pre=$(reset)$(rmh)Properties\par -.format=$(reset)$(term1){\b $1} {\uldb $2}{\v #interface.1__#2_prop}\par -$(reset)$(def1)$3\par +.pre=$(reset)$(rmh)Properties\par +.format=$(reset)$(term1){\b $1} {\uldb $2}{\v #interface.1__#2_prop}\par +$(reset)$(def1)$3\par .if=exists($interface.1::$2_prop) ; link type only, if type is an interface .tag=prop, help, 3, 1 .parsesource=method -.pre=$(reset)$(rmh)Properties\par -.format=$(reset)$(term1){\uldb $1}{\v #1_int} {\b $2}\par -$(reset)$(def1)$3\par +.pre=$(reset)$(rmh)Properties\par +.format=$(reset)$(term1){\uldb $1}{\v #1_int} {\b $2}\par +$(reset)$(def1)$3\par .if=exists($1_int) ; link type only .tag=prop, help, 3, 1 .parsesource=method -.pre=$(reset)$(rmh)Properties\par -.format=$(reset)$(term1){\uldb $1}{\v #1} {\b $2}\par -$(reset)$(def1)$3\par +.pre=$(reset)$(rmh)Properties\par +.format=$(reset)$(term1){\uldb $1}{\v #1} {\b $2}\par +$(reset)$(def1)$3\par .if=exists($1) ; link neither, or doc @@ -1316,20 +1316,20 @@ $(reset)$(def1)$3\par .tag=prop, both, 3, 1 .parsesource=method .map=property,$1,$t.1,$2,$3 -.pre=$(reset)$(rmh)Properties\par -.format=$(reset)$(term1){\b $1 $2}\par -$(reset)$(def1)$3\par +.pre=$(reset)$(rmh)Properties\par +.format=$(reset)$(term1){\b $1 $2}\par +$(reset)$(def1)$3\par -; *** Events *** +; *** Events *** ;link name .tag=eve, help, 2, 1 .parsesource=method .map=event,$t.1,$1,$2 -.pre=$(reset)$(rmh)Events\par -.format=$(reset)$(term1){\uldb $1}{\v #interface.1__#1_event}\par -$(reset)$(def1)$2\par +.pre=$(reset)$(rmh)Events\par +.format=$(reset)$(term1){\uldb $1}{\v #interface.1__#1_event}\par +$(reset)$(def1)$2\par .if= exists($interface.1::$1_event) ; no link, or doc @@ -1337,135 +1337,135 @@ $(reset)$(def1)$2\par .tag=eve, both, 2, 1 .parsesource=method .map=event,$t.1,$1,$2 -.pre=$(reset)$(rmh)Events\par -.format=$(reset)$(term1){\b $1}\par -$(reset)$(def1)$2\par +.pre=$(reset)$(rmh)Events\par +.format=$(reset)$(term1){\b $1}\par +$(reset)$(def1)$2\par .tag=rvalue, doc, 2, 1 .pre=$(reset)$(rmh)Return Codes\par -\trowd \trgaph72\trleft-72 \cellx3078\cellx7038 -.format=$(reset)\intbl$(table_text){\fs18 $1\cell $2\cell }\pard \intbl \row -.post=$(reset)\li240\sa0\sl240 \f2\fs20\lang1033 \par +\trowd \trgaph72\trleft-72 \cellx3078\cellx7038 +.format=$(reset)\intbl$(table_text){\fs18 $1\cell $2\cell }\pard \intbl \row +.post=$(reset)\li240\sa0\sl240 \f2\fs20\lang1033 \par .tag=rvalue, help, 2, 1 .pre=$(reset)$(rmh)Return Codes\par -\trowd \trgaph108\trleft162 \cellx2430\cellx8748 -.format=$(reset)\intbl $(table_text){\fs16 $1}\cell $2\cell \pard \intbl \row -.post=$(reset)$(normal)\par +\trowd \trgaph108\trleft162 \cellx2430\cellx8748 +.format=$(reset)\intbl $(table_text){\fs16 $1}\cell $2\cell \pard \intbl \row +.post=$(reset)$(normal)\par ; link interface name .tag=supint, help, 2, 1 -.pre=$(reset)$(rmh)Supported Interfaces\par -.format=$(reset)$(term1){\uldb $1}{\v #1_int}\par -$(reset)$(def1)$2\par +.pre=$(reset)$(rmh)Supported Interfaces\par +.format=$(reset)$(term1){\uldb $1}{\v #1_int}\par +$(reset)$(def1)$2\par .if=exists($1_int) ; no link, or doc .tag=supint, both, 2, 1 -.pre=$(reset)$(rmh)Supported Interfaces\par -.format=$(reset)$(term1){\b $1}\par -$(reset)$(def1)$2\par +.pre=$(reset)$(rmh)Supported Interfaces\par +.format=$(reset)$(term1){\b $1}\par +$(reset)$(def1)$2\par ; link interface name .tag=reqint, help, 2, 1 -.pre=$(reset)$(rmh)Required Interfaces\par -.format=$(reset)$(term1){\uldb $1}{\v #1_int}\par -$(reset)$(def1)$2\par +.pre=$(reset)$(rmh)Required Interfaces\par +.format=$(reset)$(term1){\uldb $1}{\v #1_int}\par +$(reset)$(def1)$2\par .if=exists($1_int) ; no link, or doc .tag=reqint, both, 2, 1 -.pre=$(reset)$(rmh)Required Interfaces\par -.format=$(reset)$(term1){\b $1}\par -$(reset)$(def1)$2\par +.pre=$(reset)$(rmh)Required Interfaces\par +.format=$(reset)$(term1){\b $1}\par +$(reset)$(def1)$2\par ; link interface name .tag=optint, help, 2, 1 -.pre=$(reset)$(rmh)Optional Interfaces\par -.format=$(reset)$(term1){\uldb $1}{\v #1_int}\par -$(reset)$(def1)$2\par +.pre=$(reset)$(rmh)Optional Interfaces\par +.format=$(reset)$(term1){\uldb $1}{\v #1_int}\par +$(reset)$(def1)$2\par .if=exists($1_int) ; no link, or doc .tag=optint, both, 2, 1 -.pre=$(reset)$(rmh)Optional Interfaces\par -.format=$(reset)$(term1){\b $1}\par -$(reset)$(def1)$2\par +.pre=$(reset)$(rmh)Optional Interfaces\par +.format=$(reset)$(term1){\b $1}\par +$(reset)$(def1)$2\par ; Interfaces/objects that support a property or method .tag=supby, both, 1, 1 -.pre=$(reset)$(rmh)Supported By\par -.format=$(reset)$(normal){\b $1}\par +.pre=$(reset)$(rmh)Supported By\par +.format=$(reset)$(normal){\b $1}\par ; Interfaces that an object expects to consume .tag=consumes, both, 1, 1 -.pre=$(reset)$(rmh)Consumes\par -.format=$(reset)$(normal){\b $1}\par +.pre=$(reset)$(rmh)Consumes\par +.format=$(reset)$(normal){\b $1}\par ; Abstract object types to which an abstract object type belongs .tag=is, both, 1, 1 -.pre=$(reset)$(rmh)Is A\par -.format=$(reset)$(normal){\b $1}\par +.pre=$(reset)$(rmh)Is A\par +.format=$(reset)$(normal){\b $1}\par ; Aggregates ; link interface name .tag=aggregates, help, 2, 1 -.pre=$(reset)$(rmh)Aggregated Objects\par -.format=$(reset)$(term1){\uldb $1}{\v #1}\par -$(reset)$(def1)$2\par +.pre=$(reset)$(rmh)Aggregated Objects\par +.format=$(reset)$(term1){\uldb $1}{\v #1}\par +$(reset)$(def1)$2\par .if=exists($1) ; no link, or doc .tag=aggregates, both, 2, 1 -.pre=$(reset)$(rmh)Aggregated Objects\par -.format=$(reset)$(term1){\b $1}\par -$(reset)$(def1)$2\par +.pre=$(reset)$(rmh)Aggregated Objects\par +.format=$(reset)$(term1){\b $1}\par +$(reset)$(def1)$2\par ; ****************************************** ; Miscellaneous tags ; ****************************************** .tag=normal,both,1,1 -.format=$(reset)$(normal)$1\par +.format=$(reset)$(normal)$1\par .tag=head1, both, 2, 1 .if=fieldempty(2) -.format=$(reset)$(heading_1)$1\par +.format=$(reset)$(heading_1)$1\par .tag=head2, both, 2, 1 .if=fieldempty(2) -.format=$(reset)$(heading_1)$1\par +.format=$(reset)$(heading_1)$1\par .tag=head3, both, 2, 1 .if=fieldempty(2) -.format=$(reset)$(heading_3)$1\par +.format=$(reset)$(heading_3)$1\par .tag=head1, both, 2, 1 -.format=$(reset)$(heading_1)$1\par -$(reset)$(normal)$2\par +.format=$(reset)$(heading_1)$1\par +$(reset)$(normal)$2\par .tag=head2, both, 2, 1 -.format=$(reset)$(heading_1)$1\par -$(reset)$(normal)$2\par +.format=$(reset)$(heading_1)$1\par +$(reset)$(normal)$2\par .tag=head3, both, 2, 1 -.format=$(reset)$(heading_3)$1\par -$(reset)$(normal)$2\par +.format=$(reset)$(heading_3)$1\par +$(reset)$(normal)$2\par .tag=group, both, 1, 8 -.format=$(reset)$(heading_3)$1\par +.format=$(reset)$(heading_3)$1\par .tag=end, both, 0, 8 .format= @@ -1475,14 +1475,14 @@ $(reset)$(normal)$2\par ; ****************************************** .tag=index, both, 2, 1 -.format=$(reset)$(indexlink)$[index:$1:$2]\par +.format=$(reset)$(indexlink)$[index:$1:$2]\par .tag=subindex,help,1,1 -.format=$(reset)$(indexlink){\uldb $1}{\v #1}\par -.post=$(reset)\li140\sl240 \f2\fs10\lang1033 \par +.format=$(reset)$(indexlink){\uldb $1}{\v #1}\par +.post=$(reset)\li140\sl240 \f2\fs10\lang1033 \par .tag=subindex,doc,1,1 -.format=$(reset)$(indexlink)$1\par +.format=$(reset)$(indexlink)$1\par [text] @@ -1491,35 +1491,35 @@ $(reset)$(normal)$2\par ; ****************************************** .tag=cp, both, 0 -.format=\'a9 +.format=\'a9 .tag=tm, both, 0 -.format=\'99 +.format=\'99 .tag=rtm, both, 0 -.format=\'ae +.format=\'ae .tag=en-, doc, 0 -.format=\endash +.format=\endash .tag=en-, help, 0 -.format=\'97 +.format=\'97 .tag=em-, doc, 0 -.format=\emdash +.format=\emdash .tag=em-, help, 0 -.format=\'96 +.format=\'96 .tag=lq, doc, 0 -.format=\ldblquote +.format=\ldblquote .tag=lq, help, 0 -.format=\'91 +.format=\'91 .tag=rq, doc, 0 -.format=\rdblquote +.format=\rdblquote .tag=rq, help, 0 -.format=\'92 +.format=\'92 .tag=gt, both, 0 .format=> .tag=lt, both, 0 .format=< .tag=tab, both, 0 -.format=\tab +.format=\tab .tag=nl, both, 0 -.format=\line +.format=\line .tag=cmt, both, 0 .format=// ; @@ -1766,7 +1766,7 @@ $(reset)$(normal)$2\par .if=tagexists(method),fieldempty(1),$2=$method.3 .if=$1=$method.2,$2=$method.3 -; @abstract or @object tag, empty field, link +; @abstract or @object tag, empty field, link ; example: appearing in @abstract Foo or @object Foo .tag=om, help, 2 @@ -1814,7 +1814,7 @@ $(reset)$(normal)$2\par .if=$1=$method.2$property.2$interface.1$event.1 .if=fieldempty(1) -; default: both fields, +; default: both fields, ; example: output with "IFoo.Bar" in bold .tag=om, both, 2 .format={\b $1::$2} @@ -1832,7 +1832,7 @@ $(reset)$(normal)$2\par .if=tagexists(property),fieldempty(1),$2=$property.3 .if=$1=$property.2,$2=$property.3 -; @abstract or @object tag, empty field, link +; @abstract or @object tag, empty field, link ; example: appearing in @abstract Foo or @object Foo .tag=op, help, 2 @@ -1880,7 +1880,7 @@ $(reset)$(normal)$2\par .if=$1=$method.2$property.2$interface.1$event.1 .if=fieldempty(1) -; default: both fields, +; default: both fields, ; example: output with "IFoo.Bar" in bold .tag=op, both, 2 .format={\b $1::$2} @@ -1897,7 +1897,7 @@ $(reset)$(normal)$2\par .if=fieldempty(1),$2=$event.1 .if=$1=$event.1,$2=$event.2 -; link, ref. same interface within @object, @abstract, +; link, ref. same interface within @object, @abstract, ; omit interface prefix .tag=oe, help, 2 @@ -1955,10 +1955,10 @@ $(reset)$(normal)$2\par ; Visual Basic type diagram .tag=bstruct, both, bfield -.pre=\pard \plain $(ex)$[bmod]Type\par -.post=End Type\par -\par -.format=$[bfield]\par +.pre=\pard \plain $(ex)$[bmod]Type\par +.post=End Type\par +\par +.format=$[bfield]\par .tag=bfield, both, none .if=fieldempty(2) @@ -2009,7 +2009,7 @@ $(reset)$(normal)$2\par .tag=bmod, both, bmod .format= -.pre={\b $1} +.pre={\b $1} .tag=btype, both, btype .if=fieldempty(3) @@ -2022,7 +2022,7 @@ $(reset)$(normal)$2\par .tag=parmopthead, both, parm .cancelifpresent=parm -.pre=$(reset)$(rmh)Parameters\par +.pre=$(reset)$(rmh)Parameters\par .format= .tag=parmopt, both, parmopt @@ -2140,21 +2140,21 @@ $(reset)$(normal)$2\par ; **** Structure ******** .tag=structure, both, field -.pre=$(reset)$(ex)typedef struct \{\par -.format=$(reset)$(ex)\tab $1 $2;\par -.post=$(reset)$(ex)\} $1;\par -$(reset)$(ex)\par +.pre=$(reset)$(ex)typedef struct \{\par +.format=$(reset)$(ex)\tab $1 $2;\par +.post=$(reset)$(ex)\} $1;\par +$(reset)$(ex)\par ; **** Enumeration ******** .tag=enum, both, emem -.pre=$(reset)$(ex)enum $1 \{\par +.pre=$(reset)$(ex)enum $1 \{\par .formatfirst=$(reset)$(ex)\tab $1 -.format=,\par +.format=,\par $(reset)$(ex)\tab $1 -.post=\par -$(reset)$(ex)\};\par -$(reset)$(ex)\par +.post=\par +$(reset)$(ex)\};\par +$(reset)$(ex)\par ; **** Class ***************** @@ -2162,7 +2162,7 @@ $(reset)$(ex)\par .pre=$(reset)$(normal)$[template]{\b class $1} .formatfirst={\b : $1 $2} .format={\b , $1 $2} -.post=\par +.post=\par ; **** Member Class ***************** @@ -2170,7 +2170,7 @@ $(reset)$(ex)\par .pre=$(reset)$(normal)$[template]{\b class $1::$2} .formatfirst={\b : $1 $2} .format={\b , $1 $2} -.post=\par +.post=\par ; **** Template specification for classes or member functions @@ -2178,7 +2178,7 @@ $(reset)$(ex)\par .pre={\b template <} .formatfirst={\b $1 }{\i $2} .format=, {\b $1 }{\i $2} -.post={\b >}\line +.post={\b >}\line .if=tagexists(tcarg) .tag=template, both, tcarg @@ -2190,7 +2190,7 @@ $(reset)$(ex)\par .pre={\b template <} .formatfirst={\b $1 }{\i $2} .format=, {\b $1 }{\i $2} -.post={\b >}\line +.post={\b >}\line .if=tagexists(tfarg) .tag=ftemplate, both, tfarg @@ -2260,7 +2260,7 @@ $(reset)$(ex)\par .tag=classhdr, both, parm .cancelifpresent=access -.pre=$(reset)$(rmh)Class Members\par +.pre=$(reset)$(rmh)Class Members\par .format= .tag=constant, both, parm @@ -2289,7 +2289,7 @@ $(reset)$(ex)\par .if=fieldempty(1) .tag=jmodifier, both, parm ; is unused -.pre=$1 +.pre=$1 .format= .tag=jextends, both, parm ; is unused @@ -2310,7 +2310,7 @@ $(reset)$(ex)\par ;--------------------------------------------- ; for diagram in jmethod topic tag -; +; .tag=jthrows, both, parm ; is unused .format= .if=fieldempty(5) @@ -2322,7 +2322,7 @@ $(reset)$(ex)\par ;--------------------------------------------- ; for diagram in jmethod paragraph tag -; +; .tag=jthrowsp, both, parm ; is unused .format= .if=fieldempty(4) @@ -2346,11 +2346,11 @@ $(reset)$(ex)\par .post=$(cb))$(cbe) .tag=jmtype, both, parm ; is unused -.pre= +.pre= .if=fieldempty(2) .tag=jmtype, both, parm ; is unused -.pre=$2 +.pre=$2 .tag=jmlinkname, help, parm ; is unused .if=exists($jclass.2::$3) @@ -2370,8 +2370,7 @@ $(reset)$(ex)\par [index] .output=help -.format=$(reset)$(indexlink){\uldb $!n}{\v $!c}\par +.format=$(reset)$(indexlink){\uldb $!n}{\v $!c}\par .output=doc -.format=$(reset)$(indexlink)$!n\par - +.format=$(reset)$(indexlink)$!n\par diff --git a/AutoDuck/common.mak b/AutoDuck/common.mak index d09dba5f3..cc974e557 100644 --- a/AutoDuck/common.mak +++ b/AutoDuck/common.mak @@ -17,7 +17,7 @@ cleanad: $(PYTHON) fixHelpCompression.py "$(GENDIR)\$(TARGET).hpj" cd "$(GENDIR)" $(HC) $(TARGET).hpj - if exist "..\..\..\$(TARGET).hlp" del "..\..\..\$(TARGET).hlp" + if exist "..\..\..\$(TARGET).hlp" del "..\..\..\$(TARGET).hlp" move "$(TARGET).hlp" "..\..\..\$(TARGET).hlp" cd $(MYDIR_FROM_GENDIR) @@ -42,7 +42,7 @@ cleanad: "$(GENDIR)\$(TARGET).hhp" : BuildHHP.py $(DOCUMENT_FILE) $(HTML_FILES) $(PYTHON) BuildHHP.py "$(GENDIR)\$(TARGET)" "$(TARGET)" "$(GENDIR)" $(HTML_FILES) -"$(GENDIR)\$(TARGET).html" "$(GENDIR)\$(TARGET).dump" "$(GENDIR)\$(TARGET).idx" : $(SOURCE) pyhtml.fmt "$(GENDIR)\$(TARGET).hhlog" InsertExternalOverviews.py $(DOCUMENT_FILE) +"$(GENDIR)\$(TARGET).html" "$(GENDIR)\$(TARGET).dump" "$(GENDIR)\$(TARGET).idx" : $(SOURCE) pyhtml.fmt "$(GENDIR)\$(TARGET).hhlog" InsertExternalOverviews.py $(DOCUMENT_FILE) @echo Running autoduck for the .html @$(ADHTMLFMT) $(ADHTML) /t$(ADTAB) $(SOURCE) $(PYTHON) InsertExternalOverviews.py "$(GENDIR)\$(TARGET).html" @@ -57,5 +57,3 @@ cleanad: -$(HHC) "$(GENDIR)\$(TARGET).hhp" if exist "..\$(TARGET).chm" del "..\$(TARGET).chm" move "$(GENDIR)\$(TARGET).chm" "..\$(TARGET).chm" - - diff --git a/AutoDuck/common_top.mak b/AutoDuck/common_top.mak index 5341726f4..a76ffcda9 100644 --- a/AutoDuck/common_top.mak +++ b/AutoDuck/common_top.mak @@ -11,4 +11,3 @@ ADTAB = 8 HC = hcw /a /c /e HHC = hhc PYTHON = py -2.7 - diff --git a/AutoDuck/pyhtml.fmt b/AutoDuck/pyhtml.fmt index 4d4a98598..f13974013 100644 --- a/AutoDuck/pyhtml.fmt +++ b/AutoDuck/pyhtml.fmt @@ -37,9 +37,9 @@ .define=cbe, .define=ci, .define=cie, -.define=cul, +.define=cul, .define=cule, -.define=culd,{\uldb +.define=culd,{\uldb .define=culde,} .define=par,

.define=line,
@@ -73,7 +73,7 @@ .define=deflist,

.define=deflist_e,
.define=rule,
-.define=indexlink, +.define=indexlink, .define=node_b0, @@ -502,7 +502,7 @@ $(def1)$3$(par) .tag=prop, html, 3, 1 .pre=$(rmh)Properties$(rmhe)$(par) -.format=$(term1)$1$(cb)$2$(cbe)$(par) +.format=$(term1)$1$(cb)$2$(cbe)$(par) $(def1)$3$(par) .if=exists($1) @@ -623,7 +623,7 @@ $(exe) .if=tagexists(method),fieldempty(1),$2=$method.3 .if=$1=$method.2,$2=$method.3 -; @abstract or @object tag, empty field, link +; @abstract or @object tag, empty field, link ; example: appearing in @abstract Foo or @object Foo .tag=om, html, 2 @@ -671,7 +671,7 @@ $(exe) .if=$1=$method.2$property.2$interface.1$event.1 .if=fieldempty(1) -; default: html fields, +; default: html fields, ; example: output with "IFoo.Bar" in bold .tag=om, html, 2 .format=$(cb)$1::$2$(cbe) @@ -716,19 +716,19 @@ $(exe) .tag=cp, html, 0 -.format=\'a9 +.format=\'a9 .tag=tm, html, 0 -.format=\'99 +.format=\'99 .tag=rtm, html, 0 -.format=\'ae +.format=\'ae .tag=en-, html, 0 -.format=\'97 +.format=\'97 .tag=em-, html, 0 -.format=\'96 +.format=\'96 .tag=lq, html, 0 -.format=\'91 +.format=\'91 .tag=rq, html, 0 -.format=\'92 +.format=\'92 .tag=gt, html, 0 .format=> .tag=lt, html, 0 @@ -848,4 +848,3 @@ $(exe) [index] .output=html .format=
  • $!n - diff --git a/AutoDuck/pythonwin.fmt b/AutoDuck/pythonwin.fmt index 76a456a1c..d5961d677 100644 --- a/AutoDuck/pythonwin.fmt +++ b/AutoDuck/pythonwin.fmt @@ -89,153 +89,153 @@ $(reset)$(heading_1) $${\footnote $$ Contents} -+{\footnote + Contents:0000} -$(title) Contents\par ++{\footnote + Contents:0000} +$(title) Contents\par -$(reset)$(normal)To display a list of topics by category, click any -of the contents entries below. To display an alphabetical list of -topics, choose the Index button.\par +$(reset)$(normal)To display a list of topics by category, click any +of the contents entries below. To display an alphabetical list of +topics, choose the Index button.\par -$(reset)$(heading_3)Python Objects\par -$(reset)$(indexlink){\uldb Modules}{\v ctx_commod}\par -$(reset)$(indexlink){\uldb Objects}{\v ctx_comobj}\par -$(reset)\sl-240 \fs21\lang1033 \par +$(reset)$(heading_3)Python Objects\par +$(reset)$(indexlink){\uldb Modules}{\v ctx_commod}\par +$(reset)$(indexlink){\uldb Objects}{\v ctx_comobj}\par +$(reset)\sl-240 \fs21\lang1033 \par -$(reset)$(heading_3)Overviews and other documentation\par +$(reset)$(heading_3)Overviews and other documentation\par $[index:topic] -$(reset)$(indexlink){\uldb Constants}{\v ctx_constants}\par -$(reset)\sl-240 \fs21\lang1033 \par -$(reset)\sl-240 \fs21\lang1033 \par +$(reset)$(indexlink){\uldb Constants}{\v ctx_constants}\par +$(reset)\sl-240 \fs21\lang1033 \par +$(reset)\sl-240 \fs21\lang1033 \par $(reset)$(normal)Help file built: $!d\par -$(reset)\sl-240 \fs21\lang1033 \par -$(reset)$(normal)\fs16{\ul About this Help File}{\v abouthelp}\par -\par +$(reset)\sl-240 \fs21\lang1033 \par +$(reset)$(normal)\fs16{\ul About this Help File}{\v abouthelp}\par +\par -\page +\page $(reset)$(heading_3) #{\footnote \pard\plain \f2\fs20 # abouthelp} $${\footnote \pard\plain \f2\fs20 $$ About this Help File} About this Help File -\par \trowd \trgaph108\trleft-108 -\cellx5580 \pard\plain \li144\ri144\sa160\sl240\slmult0\intbl \f2\fs20 -The sources for this Help file were generated by Autoduck, the source -code documentation tool that generates Print or Help files from tagged -comments in C, C++, Assembly, and Basic source files. This tool was once -available on the Microsoft Developers Network CD's, and is now distributed -in the BuidTools archive.\par +\par \trowd \trgaph108\trleft-108 +\cellx5580 \pard\plain \li144\ri144\sa160\sl240\slmult0\intbl \f2\fs20 +The sources for this Help file were generated by Autoduck, the source +code documentation tool that generates Print or Help files from tagged +comments in C, C++, Assembly, and Basic source files. This tool was once +available on the Microsoft Developers Network CD's, and is now distributed +in the BuidTools archive.\par -Help files generated by $(MARK_HAMMOND).\cell \row +Help files generated by $(MARK_HAMMOND).\cell \row -\page +\page $(reset)$(heading_1) #{\footnote # ctx_commod} $${\footnote $$ Contents: Modules} -+{\footnote + Contents:0000} -Modules\par ++{\footnote + Contents:0000} +Modules\par $[index:module] -\page +\page $(reset)$(heading_1) #{\footnote # ctx_comobj} $${\footnote $$ Contents: Objects} -+{\footnote + Contents:0000} -Objects\par ++{\footnote + Contents:0000} +Objects\par $[index:pyobject,object] -\page +\page $(reset)$(heading_1) #{\footnote # ctx_commeth} $${\footnote $$ Contents: Object and Module Methods} -+{\footnote + Contents:0000} -Object and Module Methods\par ++{\footnote + Contents:0000} +Object and Module Methods\par $[index:method,pymethod,pyvirtual] -\page +\page $(reset)$(heading_1) #{\footnote # ctx_comprop} $${\footnote $$ Contents: Object and Module Properties} -+{\footnote + Contents:0000} -Object and Module Properties\par ++{\footnote + Contents:0000} +Object and Module Properties\par $[index:property] -\page +\page $(reset)$(heading_1) #{\footnote # ctx_comevent} $${\footnote $$ Contents: Object Events} -+{\footnote + Contents:0000} -Object Events\par ++{\footnote + Contents:0000} +Object Events\par $[index:event] -\page +\page $(reset)$(heading_1) #{\footnote # ctx_Classes} $${\footnote $$ Contents: Classes and Class Members} -+{\footnote + Contents:0000} -Classes and Class Members\par ++{\footnote + Contents:0000} +Classes and Class Members\par $[index:class,mfunc,mdata] -\page +\page $(reset)$(heading_1) #{\footnote # ctx_Functions} $${\footnote $$ Contents: Functions} -+{\footnote + Contents:0000} -Functions\par ++{\footnote + Contents:0000} +Functions\par $[index:func,cb] -\page +\page $(reset)$(heading_1) #{\footnote # ctx_Messages} $${\footnote $$ Contents: Messages} -+{\footnote + Contents:0000} -Messages\par ++{\footnote + Contents:0000} +Messages\par $[index:msg] -\par \page +\par \page $(reset)$(heading_1) #{\footnote # ctx_Types} $${\footnote $$ Contents: Structures and Enums} -+{\footnote + Contents:0000} -Structures and Enums\par ++{\footnote + Contents:0000} +Structures and Enums\par $[index:struct,enum] -\page +\page $(reset)$(heading_1) #{\footnote # ctx_overviews} $${\footnote $$ Contents: Overviews} -+{\footnote + Contents:0000} -Overviews\par ++{\footnote + Contents:0000} +Overviews\par $[index:topic] -\page +\page $(reset)$(heading_1) #{\footnote # ctx_constants} $${\footnote $$ Contents: Constants} -+{\footnote + Contents:0000} -Constants\par ++{\footnote + Contents:0000} +Constants\par $[index:const] -\page +\page .post=} @@ -249,7 +249,7 @@ $[index:const] ;.tag=vm, help, 2 ;.format={\b $1::$2} virtual method -; default: both fields, +; default: both fields, ; example: output with "IFoo.Bar" in bold ; Leave it commented - generates an error, which is better then ; bolding. @@ -266,17 +266,17 @@ $[index:const] ; *********************************************************** .tag=topic, doc, 2, 5, $1 -.pre=\pard\plain $(heading_1)$1\par -\pard\plain $(normal)$2\par +.pre=\pard\plain $(heading_1)$1\par +\pard\plain $(normal)$2\par .tag=topic, help, 2, 5, $1 .pre=\page \pard\plain $(heading_1) ##{\footnote ## #1} $${\footnote $$ $1} K{\footnote K $1} -+{\footnote + overviews:0000} -$1\par -\pard\plain $(normal)$2\par ++{\footnote + overviews:0000} +$1\par +\pard\plain $(normal)$2\par ; ; *********************************************************** @@ -284,81 +284,81 @@ $1\par ; *********************************************************** .tag=Contents1, doc, 2, 0, __aaa$1 -.pre=$(reset)$(heading_1)$1\par -$(reset)$(indexlink)$2\par +.pre=$(reset)$(heading_1)$1\par +$(reset)$(indexlink)$2\par .tag=contents1, help, 2, 0, __aaa$1 .pre=\pard\plain $(heading_1) ##{\footnote ## #1} $${\footnote $$ $1} K{\footnote K $1} -+{\footnote + Contents:0000} -$1\par -$(reset)$(indexlink)$2\par ++{\footnote + Contents:0000} +$1\par +$(reset)$(indexlink)$2\par .tag=Contents2, doc, 2, 0, _aaa$1 -.pre=$(reset)$(heading_1)$1\par -$(reset)$(indexlink)$2\par +.pre=$(reset)$(heading_1)$1\par +$(reset)$(indexlink)$2\par .tag=contents2, help, 2, 0, _aaa$1 .pre=\page $(reset)$(heading_1) ##{\footnote ## #1} $${\footnote $$ $1} K{\footnote K $1} -+{\footnote + Contents:0000} -$1\par -$(reset)$(indexlink)$2\par ++{\footnote + Contents:0000} +$1\par +$(reset)$(indexlink)$2\par .tag=module, help, 2, 20, $1 -.pre=\page +.pre=\page ##{\footnote ## #1} $${\footnote $$ $1} K{\footnote K Python modules; modules; $1} -+{\footnote + Python:0000} ++{\footnote + Python:0000} $(reset)$(heading_1)$1 Module\par -$(reset)$(normal)$2\par +$(reset)$(normal)$2\par .tag=object, help, 2, 20, $1 -.pre=\page +.pre=\page ##{\footnote ## #1} $${\footnote $$ $1} K{\footnote K Python objects; objects; $1} -+{\footnote + Python:0000} ++{\footnote + Python:0000} $(reset)$(heading_1)$1 Object\par -$(reset)$(normal)$2\par +$(reset)$(normal)$2\par .tag=pymethod, both, 4, 1, $2.$3 .context=$2::$3_meth .order=pyparm pyparmalt1 pyparmalt2 pyparmalt3 rvalue comm ex xref pyseemfc pyseeapi pyundocmfc -.pre=\page +.pre=\page ##{\footnote ## #2__#3_meth} $${\footnote $$ $2::$3} K{\footnote K Object Methods; methods; $3; $2 object} -+{\footnote + OM:0000} ++{\footnote + OM:0000} $(reset)$(heading_1){\uldb $2}{\v #2}.$3\par $[pymethod] -$(reset)$(normal)$4\par +$(reset)$(normal)$4\par .tag=pyvirtual, both, 4, 1, $2.$3 .context=$2::$3_virtual .order=pyparm pyparmalt1 pyparmalt2 pyparmalt3 rvalue comm ex xref pyseemfc pyseeapi pyundocmfc -.pre=\page +.pre=\page ##{\footnote ## #2__#3_virtual} $${\footnote $$ $2::$3 virtual} K{\footnote K object virtuals; virtuals; $3; $2 object} -+{\footnote + OM:0000} ++{\footnote + OM:0000} $(reset)$(heading_1)$3 ({\uldb $2}{\v #2} Virtual)\par $[pyvirtual] -$(reset)$(normal)$4\par +$(reset)$(normal)$4\par ; Constants .tag=const, doc, 3, 30, $2 .parsesource=constant -.pre=$(reset)$(rule)\par -$(reset)$(heading_1)$2 constant\par -$(reset)$(normal){\b const $1.$2;}\par -$(reset)$(normal)$3\par +.pre=$(reset)$(rule)\par +$(reset)$(heading_1)$2 constant\par +$(reset)$(normal){\b const $1.$2;}\par +$(reset)$(normal)$3\par .tag=const, help, 3, 30, $2 .parsesource=constant @@ -366,23 +366,23 @@ $(reset)$(normal)$3\par ##{\footnote ## #2} $${\footnote $$ $2} K{\footnote K constants; $2} -+{\footnote + constants:0000} -$2 constant\par -$(reset)$(normal){\b const $1.$2;}\par -$(reset)$(normal)$3\par ++{\footnote + constants:0000} +$2 constant\par +$(reset)$(normal){\b const $1.$2;}\par +$(reset)$(normal)$3\par .tag=property, help, 4, 20, $2.$3 .context=$2::$3_prop -.pre=\page +.pre=\page ##{\footnote ## $!c} $${\footnote $$ $!n Property} K{\footnote K object properties; properties; $2 object; $3} -+{\footnote + OLE:0000} -$(reset)$(heading_1){\uldb $2}{\v #2}.$3\par -$(reset)$(rmh)Data Type\par -$(reset)$(normal){\b $1}\par -$(reset)$(rmh)Description\par -$(reset)$(normal)$4\par ++{\footnote + OLE:0000} +$(reset)$(heading_1){\uldb $2}{\v #2}.$3\par +$(reset)$(rmh)Data Type\par +$(reset)$(normal){\b $1}\par +$(reset)$(rmh)Description\par +$(reset)$(normal)$4\par ;------------------------------------------- @@ -393,141 +393,141 @@ $(reset)$(normal)$4\par ; Parameters .tag=pymeth, both, 2, 2 .if=exists($object.1) -.pre=$(reset)$(rmh)Methods\par +.pre=$(reset)$(rmh)Methods\par .format=$(reset)$(term1){\uldb $1}{\v #object.1__#1_meth}\par $(reset)$(def1)$2\par .tag=pymeth, both, 2, 2 .if=exists($module.1) -.pre=$(reset)$(rmh)Methods\par +.pre=$(reset)$(rmh)Methods\par .format=$(reset)$(term1){\uldb $1}{\v #module.1__#1_meth}\par $(reset)$(def1)$2\par ; Parameters .tag=pymethod, both, 4, 1 -.format=$(reset)$(term1){\i $1 $2::$3}\par +.format=$(reset)$(term1){\i $1 $2::$3}\par $(reset)$(def1)$2 $4\par ; tuple item ; @tupleitem tuple_index|name|type|description .tag=tupleitem, both, 4, 1 -.pre=$(reset)$(rmh)Items\par +.pre=$(reset)$(rmh)Items\par .format=$(reset)$(term1)[$1] {\i $2} : $3\par -$(reset)$(def1)$4\par +$(reset)$(def1)$4\par ; flags .tag=flagh, both, 2, 2 -.format=$(reset)\trowd \trgaph72\trleft-72 \cellx3078\cellx7038 -\intbl$(table_text){\b\fs18 $1\cell $2\cell }\pard \intbl \row +.format=$(reset)\trowd \trgaph72\trleft-72 \cellx3078\cellx7038 +\intbl$(table_text){\b\fs18 $1\cell $2\cell }\pard \intbl \row .tag=flag, both, 2, 2 -.format=$(reset)\intbl$(table_text){\fs18 $1\cell $2\cell }\par \intbl \row -.post=$(reset)\li240\sa0\sl240 \f2\fs20\lang1033 \par +.format=$(reset)\intbl$(table_text){\fs18 $1\cell $2\cell }\par \intbl \row +.post=$(reset)\li240\sa0\sl240 \f2\fs20\lang1033 \par ; used to specify base classes for Python objects ; in an "@object" topic we actually show the base class. .tag=base, help, 2, 1 -.pre=$(reset)$(rmh)Based On\par -;;;;;;.format=$(reset)$(normal){\uldb $2}{\v $2_int}\par -.format=$(reset)$(normal){\uldb $2}{\v $2}\par +.pre=$(reset)$(rmh)Based On\par +;;;;;;.format=$(reset)$(normal){\uldb $2}{\v $2_int}\par +.format=$(reset)$(normal){\uldb $2}{\v $2}\par ;.if=exists($2_int), tagexists(object) ;.tag=base, both, 2, 1 -;.pre=$(reset)$(rmh)Based On\par -;.format=$(reset)$(normal){\b $2}\par +;.pre=$(reset)$(rmh)Based On\par +;.format=$(reset)$(normal){\b $2}\par ;.if=tagexists(object) ; Parameters .tag=pyvirtual, both, 4, 1 -.format=$(reset)$(term1){\i $1 $2::$3}\par +.format=$(reset)$(term1){\i $1 $2::$3}\par $(reset)$(def1)$2 $4\par .tag=pyparm, both, 4, 1 -.pre=$(reset)$(rmh)Parameters\par +.pre=$(reset)$(rmh)Parameters\par .format=$(reset)$(term1){\i $2} : $1\par -$(reset)$(def1)$4\par +$(reset)$(def1)$4\par .if=fieldempty(3) .tag=pyparm, both, 4, 1 -.pre=$(reset)$(rmh)Parameters\par +.pre=$(reset)$(rmh)Parameters\par .format=$(reset)$(term1){\i $2=$3} : $1\par -$(reset)$(def1)$4\par +$(reset)$(def1)$4\par .tag=pyparmalt1, both, 4, 1 -.pre=$(reset)$(rmh)Alternative Parameters\par -.format=$(reset)$(term1){\i $2=$3}\par -$(reset)$(def1)$4\par +.pre=$(reset)$(rmh)Alternative Parameters\par +.format=$(reset)$(term1){\i $2=$3}\par +$(reset)$(def1)$4\par .if=exists($3) .tag=pyparmalt1, both, 4, 1 -.pre=$(reset)$(rmh)Alternative Parameters\par -.format=$(reset)$(term1){\i $2}\par -$(reset)$(def1)$4\par +.pre=$(reset)$(rmh)Alternative Parameters\par +.format=$(reset)$(term1){\i $2}\par +$(reset)$(def1)$4\par .tag=pyparmalt2, both, 4, 1 -.pre=$(reset)$(rmh)Alternative Parameters\par -.format=$(reset)$(term1){\i $2=$3}\par -$(reset)$(def1)$4\par +.pre=$(reset)$(rmh)Alternative Parameters\par +.format=$(reset)$(term1){\i $2=$3}\par +$(reset)$(def1)$4\par .if=exists($3) .tag=pyparmalt2, both, 4, 1 -.pre=$(reset)$(rmh)Alternative Parameters\par -.format=$(reset)$(term1){\i $2}\par -$(reset)$(def1)$4\par +.pre=$(reset)$(rmh)Alternative Parameters\par +.format=$(reset)$(term1){\i $2}\par +$(reset)$(def1)$4\par .tag=pyparmalt3, both, 4, 1 -.pre=$(reset)$(rmh)Alternative Parameters\par -.format=$(reset)$(term1){\i $2=$3}\par -$(reset)$(def1)$4\par +.pre=$(reset)$(rmh)Alternative Parameters\par +.format=$(reset)$(term1){\i $2=$3}\par +$(reset)$(def1)$4\par .if=exists($3) .tag=pyparmalt3, both, 4, 1 -.pre=$(reset)$(rmh)Alternative Parameters\par -.format=$(reset)$(term1){\i $2}\par -$(reset)$(def1)$4\par +.pre=$(reset)$(rmh)Alternative Parameters\par +.format=$(reset)$(term1){\i $2}\par +$(reset)$(def1)$4\par .tag=pyseemfc, both, 2, 1 -.pre=$(reset)$(rmh)MFC References\par -.format=$(reset)$(term1){$1::$2}\par +.pre=$(reset)$(rmh)MFC References\par +.format=$(reset)$(term1){$1::$2}\par .tag=pyseeapi, both, 1, 1 -.pre=$(reset)$(rmh)Win32 API References\par -.format=$(reset)$(term1){$1}\par +.pre=$(reset)$(rmh)Win32 API References\par +.format=$(reset)$(term1){$1}\par .tag=pyundocmfc, both, 2, 1 -.pre=$(reset)$(rmh)Undocumented MFC References\par -.format=$(reset)$(term1){$1::$2}\par +.pre=$(reset)$(rmh)Undocumented MFC References\par +.format=$(reset)$(term1){$1::$2}\par .tag=xref, both, 1, 1 -.pre=$(reset)$(rmh)See Also\par -.format=$(reset)$(term1){$1}\par +.pre=$(reset)$(rmh)See Also\par +.format=$(reset)$(term1){$1}\par ;Properties ;link type and name .tag=prop, help, 3, 1 -.pre=$(reset)$(rmh)Properties\par -.format=$(reset)$(term1){\uldb $1}{\v #1} {\uldb $2}{\v #object.1__#2_prop}\par -$(reset)$(def1)$3\par +.pre=$(reset)$(rmh)Properties\par +.format=$(reset)$(term1){\uldb $1}{\v #1} {\uldb $2}{\v #object.1__#2_prop}\par +$(reset)$(def1)$3\par .if=exists($1),exists($object.1::$2_prop) ;link name only .tag=prop, help, 3, 1 -.pre=$(reset)$(rmh)Properties\par -.format=$(reset)$(term1){\b $1} {\uldb $2}{\v #object.1__#2_prop}\par -$(reset)$(def1)$3\par +.pre=$(reset)$(rmh)Properties\par +.format=$(reset)$(term1){\b $1} {\uldb $2}{\v #object.1__#2_prop}\par +$(reset)$(def1)$3\par .if=exists($object.1::$2_prop) ; link type only .tag=prop, help, 3, 1 -.pre=$(reset)$(rmh)Properties\par -.format=$(reset)$(term1){\uldb $1}{\v #1} {\b $2}\par -$(reset)$(def1)$3\par +.pre=$(reset)$(rmh)Properties\par +.format=$(reset)$(term1){\uldb $1}{\v #1} {\b $2}\par +$(reset)$(def1)$3\par .if=exists($1) ;------------------------------------------- @@ -554,5 +554,3 @@ $(reset)$(def1)$3\par .post={\b )}\par .formatfirst={\i $2 } .format={\i, $2 } - - diff --git a/AutoDuck/pywin32.mak b/AutoDuck/pywin32.mak index ea4cf6bca..7245cfb2e 100644 --- a/AutoDuck/pywin32.mak +++ b/AutoDuck/pywin32.mak @@ -125,7 +125,7 @@ $(GENDIR)\sspi.d: py2d.py pseudo $(GENDIR)\win32timezone.d: py2d.py pseudo $(PYTHON) py2d.py win32timezone > $(GENDIR)\win32timezone.d -"$(GENDIR)\$(TARGET).hhc" : $(SOURCE) Dump2HHC.py $(DOCUMENT_FILE) +"$(GENDIR)\$(TARGET).hhc" : $(SOURCE) Dump2HHC.py $(DOCUMENT_FILE) rem Run autoduck over each category so we can create a nested TOC. $(ADHTMLFMT) /r html "/O$(GENDIR)\temp.html" "/G$(GENDIR)\win32.dump" /t8 $(WIN32_SOURCE) $(ADHTMLFMT) /r html "/O$(GENDIR)\temp.html" "/G$(GENDIR)\pythonwin.dump" /t8 $(PYTHONWIN_SOURCE) @@ -139,7 +139,7 @@ $(GENDIR)\win32timezone.d: py2d.py pseudo ## $(GENDIR)/win32inet.d: $(WIN32_SOURCE_DIR)/win32inet.i $(PYTHON) makedfromi.py -o$*.d $(WIN32_SOURCE_DIR)/$(*B).i - + $(GENDIR)/win32file.d: $(WIN32_SOURCE_DIR)/win32file.i $(PYTHON) makedfromi.py -o$*.d $(WIN32_SOURCE_DIR)/$(*B).i @@ -255,4 +255,3 @@ $(GENDIR)\PyIDsObjectPicker.d: $(ADSI_DIR)/src/$(*B).i $(PYTHON) makedfromi.py -o$*.d -p PyIUnknown $(ADSI_DIR)/src/$(*B).i !include "common.mak" - diff --git a/CHANGES.txt b/CHANGES.txt index 3a04862bd..fda87832c 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -83,7 +83,7 @@ Coming in build 307, as yet unreleased * Fixed passing a `float` to `range` in `win32pdhquery.Query.collectdatafor` (#2170, @Avasam) * Check that the filename w/o extension ends with `_d` rather than checking for `_d` anywhere in the file path (#2169, @Avasam) * Cleaned up and fixed Axdebug (#2126, @Avasam) - * `win32comext.axdebug.codecontainer.SourceCodeContainer` now uses the `debugDocument` parameter + * `win32comext.axdebug.codecontainer.SourceCodeContainer` now uses the `debugDocument` parameter * `win32comext.axdebug.codecontainer` script can now be run independent of location * Fixed Method Resolution Order issue in `win32comext.axdebug.documents` (also #2071, @wxinix-2022) * Fixed undefined names (`NameError`) in `win32comext.axdebug.expressions.DebugProperty.GetPropertyInfo` diff --git a/Pythonwin/License.txt b/Pythonwin/License.txt index fa340d745..dac2352f0 100644 --- a/Pythonwin/License.txt +++ b/Pythonwin/License.txt @@ -1,21 +1,21 @@ Unless stated in the specfic source file, this work is -Copyright (c) 1994-2008, Mark Hammond +Copyright (c) 1994-2008, Mark Hammond All rights reserved. -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: -Redistributions of source code must retain the above copyright notice, +Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. -Redistributions in binary form must reproduce the above copyright -notice, this list of conditions and the following disclaimer in +Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. -Neither name of Mark Hammond nor the name of contributors may be used -to endorse or promote products derived from this software without -specific prior written permission. +Neither name of Mark Hammond nor the name of contributors may be used +to endorse or promote products derived from this software without +specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED @@ -27,4 +27,4 @@ PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/Pythonwin/Win32uiHostGlue.h b/Pythonwin/Win32uiHostGlue.h index cdf60f706..fe942090e 100644 --- a/Pythonwin/Win32uiHostGlue.h +++ b/Pythonwin/Win32uiHostGlue.h @@ -254,4 +254,4 @@ inline BOOL Win32uiHostGlue::ApplicationInit(const TCHAR *cmd, const TCHAR *addi return Win32uiApplicationInit(this, cmd, additionalPaths); } -#endif \ No newline at end of file +#endif diff --git a/Pythonwin/contents.d b/Pythonwin/contents.d index 0e4906ca7..b2d955e6c 100644 --- a/Pythonwin/contents.d +++ b/Pythonwin/contents.d @@ -5,7 +5,7 @@ Documentation File for Pythonwin @topic Keyboard Bindings|Pythonwin has a new, flexible keyboard binding mechanism. Bindings (and even code) can be defined in a -configuration file, stored in the pywin directory. +configuration file, stored in the pywin directory. Many bindings are still builtin to Python using Window's accelerators - see the Pythonwin menus for the specific keyboard shortcuts. @@ -113,9 +113,9 @@ then the indentation should always follow your preferences, regardless of any existing indentation in the source. Otherwise, the preferences for tab settings are only used when a new file is created. -If smart-tabs are enabled and an existing file is opened, its first +If smart-tabs are enabled and an existing file is opened, its first block is located, and the indentation -it uses overrides the default. Thus, regardless of your preferences, if the first +it uses overrides the default. Thus, regardless of your preferences, if the first indent in the file is a tab, Pythonwin uses tabs for the entire file (and similarly, uses spaces if the first block is indented with spaces) @@ -140,7 +140,7 @@ Before using the VSS integration, you must create a "mssccprj.scc" file in the directory, or a parent directory, of the files you wish to integrate. There are no limits on how many of these files exist. This is the same name and format as VB uses for VSS integration - a Windows INI -file. +file. This file must have a section [Python] with entry "Project=ProjectName". The project name is the name of the VSS project used to check the out diff --git a/Pythonwin/dbgthread.cpp b/Pythonwin/dbgthread.cpp index 771a462c3..cd0990d19 100644 --- a/Pythonwin/dbgthread.cpp +++ b/Pythonwin/dbgthread.cpp @@ -135,4 +135,4 @@ DWORD DebuggerThreadFunc(LPDWORD lpdwWhatever) DispatchMessage(&msg); } return 0; -} \ No newline at end of file +} diff --git a/Pythonwin/doc/EmbeddingWin32ui.html b/Pythonwin/doc/EmbeddingWin32ui.html index a70bbe9af..50996cd72 100644 --- a/Pythonwin/doc/EmbeddingWin32ui.html +++ b/Pythonwin/doc/EmbeddingWin32ui.html @@ -26,30 +26,30 @@

    Embedding win32ui Architecture

    win32uihostglue.h

    The win32uihostglue.h module defines a class which makes interfacing fairly simple. This Win32uiHostGlue class is used as a glue between win32ui.pyd and the host .exe. In the most simple case, you need to instantiate one of the classes, and at certain key points in your CWinApp derived class, call the appropriate methods. You may choose to provide your own glue class derived from Win32uiHostGlue in certain cases.

    Below is an example class, which overrides the "SetStatusText" method, so that status information displays in the applications status bar (this is only necessary if your application has a "non standard" status bar - normally you could omit this.).

    -
    GameApp NEAR theApp; // My existing CWinApp derived class. 
    -// HostGlue class. 
    +
    GameApp NEAR theApp; // My existing CWinApp derived class.
    +// HostGlue class.
     
    -class GameHostGlue : public Win32uiHostGlue 
    -{ 
    -  virtual void SetStatusText(const char *text, BOOL bForce) 
    -    // Assuming our GameApp above defines a SetStatusText method 
    -    {GetApp()->SetStatusText(text, bForce);} 
    +class GameHostGlue : public Win32uiHostGlue
    +{
    +  virtual void SetStatusText(const char *text, BOOL bForce)
    +    // Assuming our GameApp above defines a SetStatusText method
    +    {GetApp()->SetStatusText(text, bForce);}
     };
     
    -// The one and only Glue object. 
    +// The one and only Glue object.
     GameHostGlue NEAR glue; 

    And now we are well on our way.

    Delegating to win32uiHostGlue

    You need to either implement, or modify, certain key methods of your Application object. Probably the most important is the call to initialise win32ui. You need to modify your CWinApp::InitInstance method (it is almost certain you already have one). The following code needs to be executed in this method:

    InitInstance

    -
    BOOL GameApp::InitInstance() 
    -{ 
    -... 
    -  if (!glue.DynamicApplicationInit("import initscore", csScripts)) { 
    -  // Assuming you have a ReportError method - do whatever makes sense! 
    -    ReportError("Could not attach to the Python win32ui extensions"); 
    -    return FALSE; 
    -  } 
    +
    BOOL GameApp::InitInstance()
    +{
    +...
    +  if (!glue.DynamicApplicationInit("import initscore", csScripts)) {
    +  // Assuming you have a ReportError method - do whatever makes sense!
    +    ReportError("Could not attach to the Python win32ui extensions");
    +    return FALSE;
    +  }
     ... 

    Note the following:

    @@ -60,57 +60,57 @@

    InitInstance

    And the Rest

    Below is the rest of the code you need to implement. You may need to create these methods, as the AppWizard generated MFC application does not have some.

    -
    BOOL 
    -GameApp::OnCmdMsg (UINT nID, int nCode, 
    -void* pExtra, AFX_CMDHANDLERINFO*pHandlerInfo) 
    -{ 
    -  // yield to Python first - send to the main frame, as there is no Python app object. 
    -  if (glue.OnCmdMsg (m_pMainWnd, nID, nCode, pExtra, pHandlerInfo)) 
    -    return TRUE; 
    -  else 
    -    return CWinApp::OnCmdMsg (nID, nCode, pExtra, pHandlerInfo); 
    -} 
    +
    BOOL
    +GameApp::OnCmdMsg (UINT nID, int nCode,
    +void* pExtra, AFX_CMDHANDLERINFO*pHandlerInfo)
    +{
    +  // yield to Python first - send to the main frame, as there is no Python app object.
    +  if (glue.OnCmdMsg (m_pMainWnd, nID, nCode, pExtra, pHandlerInfo))
    +    return TRUE;
    +  else
    +    return CWinApp::OnCmdMsg (nID, nCode, pExtra, pHandlerInfo);
    +}
     
    -BOOL GameApp::PreTranslateMessage(MSG *pMsg) 
    -{ 
    -  if (glue.PreTranslateMessage(pMsg)) 
    -    return TRUE; 
    -  else 
    -    return CWinApp::PreTranslateMessage(pMsg); 
    -} 
    -BOOL GameApp::OnIdle( LONG lCount ) 
    -{ 
    -  // call base class idle first 
    -  if (CWinApp::OnIdle(lCount)) 
    -    return TRUE; 
    -  return glue.OnIdle(lCount); 
    +BOOL GameApp::PreTranslateMessage(MSG *pMsg)
    +{
    +  if (glue.PreTranslateMessage(pMsg))
    +    return TRUE;
    +  else
    +    return CWinApp::PreTranslateMessage(pMsg);
    +}
    +BOOL GameApp::OnIdle( LONG lCount )
    +{
    +  // call base class idle first
    +  if (CWinApp::OnIdle(lCount))
    +    return TRUE;
    +  return glue.OnIdle(lCount);
     } 

    • initscore.py
    • Below is the code for initscore.py. Obviously your code will vary, depending on your requirements.
    -
    import sys 
    -import win32ui 
    -# First step - redirect python output to the debugging device, until we 
    -# can create a window to capture it. 
    +
    import sys
    +import win32ui
    +# First step - redirect python output to the debugging device, until we
    +# can create a window to capture it.
     
    -# Note that this is only useful while debugging, and simply sends any 
    -# Python output (ie, exceptions while developing the startup code) is 
    -# printed to the MSVC debugger. Note that since this code was written, 
    -# the win32trace module has appeared, giving another alternative to 
    -# debugging this code. 
    -class DebugOutput: 
    -  softspace=1 
    -  def write(self,message): 
    -    win32ui.OutputDebug(message) 
    -sys.stderr=sys.stdout=DebugOutput() 
    +# Note that this is only useful while debugging, and simply sends any
    +# Python output (ie, exceptions while developing the startup code) is
    +# printed to the MSVC debugger. Note that since this code was written,
    +# the win32trace module has appeared, giving another alternative to
    +# debugging this code.
    +class DebugOutput:
    +  softspace=1
    +  def write(self,message):
    +    win32ui.OutputDebug(message)
    +sys.stderr=sys.stdout=DebugOutput()
     
     # One of your first priorities should be to set sys.stdout to somewhere useful,
    -# depending on what useful means to your application. This code simply creates 
    -# the Pythonwin Interactive Window, which handles this automatically. 
    +# depending on what useful means to your application. This code simply creates
    +# the Pythonwin Interactive Window, which handles this automatically.
     
    -# Now here is the code that does the real work. 
    +# Now here is the code that does the real work.
     import win32con 

    from pywin.framework import intpyapp, app

    @@ -126,7 +126,7 @@ 

  • initscore.py
  • # def OnExitInstance(self): # return 0 - + app = ScoreApp()

    And we are done

    diff --git a/Pythonwin/pythondoc.h b/Pythonwin/pythondoc.h index 4c553cdb1..d0c2811d2 100644 --- a/Pythonwin/pythondoc.h +++ b/Pythonwin/pythondoc.h @@ -189,7 +189,7 @@ void CPythonDocTemp

    ::OnCloseDocument() } else { helper.release_full(); - P::OnCloseDocument(); + P::OnCloseDocument(); } } diff --git a/Pythonwin/pythonwin.rc b/Pythonwin/pythonwin.rc index 1594f537a..e51b5f093 100644 --- a/Pythonwin/pythonwin.rc +++ b/Pythonwin/pythonwin.rc @@ -27,18 +27,18 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US // TEXTINCLUDE // -1 TEXTINCLUDE DISCARDABLE +1 TEXTINCLUDE DISCARDABLE BEGIN "respw.h\0" END -2 TEXTINCLUDE DISCARDABLE +2 TEXTINCLUDE DISCARDABLE BEGIN "#include ""afxres.h""\r\n" "\0" END -3 TEXTINCLUDE DISCARDABLE +3 TEXTINCLUDE DISCARDABLE BEGIN "\0" END @@ -65,12 +65,12 @@ END // String Table // -STRINGTABLE DISCARDABLE +STRINGTABLE DISCARDABLE BEGIN IDR_MAINFRAME "PythonWin" END -STRINGTABLE DISCARDABLE +STRINGTABLE DISCARDABLE BEGIN AFX_IDS_APP_TITLE "Python for Win32" AFX_IDS_IDLEMESSAGE "Ready" @@ -79,5 +79,3 @@ END #endif // English (U.S.) resources ///////////////////////////////////////////////////////////////////////////// - - diff --git a/Pythonwin/pywin/Demos/app/readme.txt b/Pythonwin/pywin/Demos/app/readme.txt index 7d58a4f9a..c20b5b28f 100644 --- a/Pythonwin/pywin/Demos/app/readme.txt +++ b/Pythonwin/pywin/Demos/app/readme.txt @@ -4,4 +4,4 @@ To run these demos, you should use the command line: pythonwin /app filename.py -where filename.py is one of the demos in this directory. \ No newline at end of file +where filename.py is one of the demos in this directory. diff --git a/Pythonwin/pywin/Demos/readme.txt b/Pythonwin/pywin/Demos/readme.txt index 1917fd797..6cd5625a0 100644 --- a/Pythonwin/pywin/Demos/readme.txt +++ b/Pythonwin/pywin/Demos/readme.txt @@ -1,3 +1,2 @@ -For a good example of all the demos, start Pythonwin, and run the +For a good example of all the demos, start Pythonwin, and run the script guidemo.py - diff --git a/Pythonwin/pywin/IDLE.cfg b/Pythonwin/pywin/IDLE.cfg index b1987b14c..31342a106 100644 --- a/Pythonwin/pywin/IDLE.cfg +++ b/Pythonwin/pywin/IDLE.cfg @@ -26,4 +26,3 @@ Ctrl+] = <> [Keys:Interactive] Alt+P = <> Alt+N = <> - diff --git a/Pythonwin/pywin/default.cfg b/Pythonwin/pywin/default.cfg index 55371f6b2..1d08809d6 100644 --- a/Pythonwin/pywin/default.cfg +++ b/Pythonwin/pywin/default.cfg @@ -10,7 +10,7 @@ # [General] # BasedOn = Default # -# and add your customisations. Then select your new configuration +# and add your customisations. Then select your new configuration # from the Pythonwin View/Options/Editor dialog. # This way you get to add your own customisations, # but still take advantage of changes to the default @@ -32,10 +32,10 @@ CallTips [Keys] -# The list of _default_ key definitions. +# The list of _default_ key definitions. # See [Keys:Interactive] and [Keys:Editor] below for further defs. -#Events of the format <> +#Events of the format <> # are events defined in IDLE extensions. Alt+Q = <> @@ -212,4 +212,3 @@ def DoNothing(editor_window, event): def ContinueEvent(editor_window, event): # Almost an "unbind" - allows Pythonwin/MFC to handle the keystroke return 1 - diff --git a/Pythonwin/pywin/idle/readme.txt b/Pythonwin/pywin/idle/readme.txt index 9a28195a2..a70e150b4 100644 --- a/Pythonwin/pywin/idle/readme.txt +++ b/Pythonwin/pywin/idle/readme.txt @@ -3,13 +3,13 @@ Pythonwin IDLE directory This directory contains IDLE extensions used by Pythonwin. The files in this directory that also appear in the main IDLE -directory are intended be indentical to the latest available for IDLE. +directory are intended be indentical to the latest available for IDLE. If you use IDLE from the CVS sources, then the files should be identical. If you have a Python version installed that is more recent -than when this release was made, then you may notice differences. +than when this release was made, then you may notice differences. Pythonwin will look for IDLE extensions first in this directory, then on the global sys.path. Thus, if you have IDLE installed and run it from the CVS sources, you may remove most of the extensions from this -directory, and the latest CVS version will then be used. +directory, and the latest CVS version will then be used. diff --git a/Pythonwin/pywin/tools/__init__.py b/Pythonwin/pywin/tools/__init__.py index 8b1378917..e69de29bb 100644 --- a/Pythonwin/pywin/tools/__init__.py +++ b/Pythonwin/pywin/tools/__init__.py @@ -1 +0,0 @@ - diff --git a/Pythonwin/win32splitter.cpp b/Pythonwin/win32splitter.cpp index f3c5d24b7..9d9c03e9f 100644 --- a/Pythonwin/win32splitter.cpp +++ b/Pythonwin/win32splitter.cpp @@ -331,4 +331,4 @@ void CPythonSplitter::OnSize(UINT nType, int cx, int cy) CSplitterWnd::OnSize(nType, cx, cy); else OutputDebugString(_T("Warning - Ignoring OnSize for splitter, due to missing children\n")); -} \ No newline at end of file +} diff --git a/Pythonwin/win32toolbar.h b/Pythonwin/win32toolbar.h index 71f8bde13..70676c192 100644 --- a/Pythonwin/win32toolbar.h +++ b/Pythonwin/win32toolbar.h @@ -44,4 +44,4 @@ class PyCToolBarCtrl : public PyCWnd { ~PyCToolBarCtrl(); private: -}; \ No newline at end of file +}; diff --git a/Pythonwin/win32ui.rc b/Pythonwin/win32ui.rc index 50f6e2f11..be8896b2c 100644 --- a/Pythonwin/win32ui.rc +++ b/Pythonwin/win32ui.rc @@ -27,18 +27,18 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US // TEXTINCLUDE // -1 TEXTINCLUDE DISCARDABLE +1 TEXTINCLUDE DISCARDABLE BEGIN "reswin32ui.h\0" END -2 TEXTINCLUDE DISCARDABLE +2 TEXTINCLUDE DISCARDABLE BEGIN "#include ""afxres.h""\r\n" "\0" END -3 TEXTINCLUDE DISCARDABLE +3 TEXTINCLUDE DISCARDABLE BEGIN "#include ""afxres.rc"" // Standard components\r\n" "#include ""afxprint.rc"" // printing/print preview resources\r\n" @@ -80,7 +80,7 @@ IDB_DEBUGGER_HIER BITMAP DISCARDABLE "RES\\debugger_stack.BMP" // Menu // -IDR_MAINFRAME MENU PRELOAD DISCARDABLE +IDR_MAINFRAME MENU PRELOAD DISCARDABLE BEGIN POPUP "&File" BEGIN @@ -128,7 +128,7 @@ BEGIN END END -IDR_TEXTTYPE MENU DISCARDABLE +IDR_TEXTTYPE MENU DISCARDABLE BEGIN POPUP "&File" BEGIN @@ -197,7 +197,7 @@ BEGIN MENUITEM "E&xpand\tKeypad-Plus", ID_VIEW_FOLD_EXPAND MENUITEM "&Collapse\tKeypad-Minus", ID_VIEW_FOLD_COLLAPSE MENUITEM "&Expand all\tAlt-Keypad-Plus", ID_VIEW_FOLD_EXPAND_ALL - MENUITEM "Collapse &all\tAlt-Keypad-Minus", + MENUITEM "Collapse &all\tAlt-Keypad-Minus", ID_VIEW_FOLD_COLLAPSE_ALL MENUITEM "Toggle top-level\tKeypad-*", ID_VIEW_FOLD_TOPLEVEL @@ -224,7 +224,7 @@ BEGIN END END -IDR_PYTHONTYPE MENU DISCARDABLE +IDR_PYTHONTYPE MENU DISCARDABLE BEGIN POPUP "&File" BEGIN @@ -310,7 +310,7 @@ BEGIN END END -IDR_PYTHONTYPE_CNTR_IP MENU DISCARDABLE +IDR_PYTHONTYPE_CNTR_IP MENU DISCARDABLE BEGIN POPUP "&File" BEGIN @@ -340,7 +340,7 @@ BEGIN END END -IDR_SHELLTRAY MENU DISCARDABLE +IDR_SHELLTRAY MENU DISCARDABLE BEGIN POPUP "Shell Icon" BEGIN @@ -349,7 +349,7 @@ BEGIN END END -IDR_CNTR_INPLACE MENU PRELOAD DISCARDABLE +IDR_CNTR_INPLACE MENU PRELOAD DISCARDABLE BEGIN POPUP "&File" BEGIN @@ -370,7 +370,7 @@ BEGIN MENUITEM SEPARATOR END -IDR_DEBUGGER MENU PRELOAD DISCARDABLE +IDR_DEBUGGER MENU PRELOAD DISCARDABLE BEGIN POPUP "&File" BEGIN @@ -424,7 +424,7 @@ END // Accelerator // -IDR_MAINFRAME ACCELERATORS PRELOAD MOVEABLE PURE +IDR_MAINFRAME ACCELERATORS PRELOAD MOVEABLE PURE BEGIN "B", ID_VIEW_BROWSE, VIRTKEY, CONTROL, NOINVERT "C", ID_EDIT_COPY, VIRTKEY, CONTROL, NOINVERT @@ -435,7 +435,7 @@ BEGIN "O", ID_FILE_OPEN, VIRTKEY, CONTROL, NOINVERT "P", ID_FILE_PRINT, VIRTKEY, CONTROL, NOINVERT "R", ID_FILE_RUN, VIRTKEY, CONTROL, NOINVERT - "R", ID_FILE_RUN, VIRTKEY, SHIFT, CONTROL, + "R", ID_FILE_RUN, VIRTKEY, SHIFT, CONTROL, NOINVERT "S", ID_FILE_SAVE, VIRTKEY, CONTROL, NOINVERT "V", ID_EDIT_PASTE, VIRTKEY, CONTROL, NOINVERT @@ -451,11 +451,11 @@ BEGIN "Z", ID_EDIT_UNDO, VIRTKEY, CONTROL, NOINVERT END -IDR_PYTHONTYPE ACCELERATORS PRELOAD MOVEABLE PURE +IDR_PYTHONTYPE ACCELERATORS PRELOAD MOVEABLE PURE BEGIN "B", ID_VIEW_BROWSE, VIRTKEY, CONTROL, NOINVERT "C", ID_EDIT_COPY, VIRTKEY, CONTROL, NOINVERT - "C", ID_FILE_CHECK, VIRTKEY, SHIFT, CONTROL, + "C", ID_FILE_CHECK, VIRTKEY, SHIFT, CONTROL, NOINVERT "F", ID_EDIT_FIND, VIRTKEY, CONTROL, NOINVERT "H", ID_EDIT_REPLACE, VIRTKEY, CONTROL, NOINVERT @@ -465,10 +465,10 @@ BEGIN "O", ID_FILE_OPEN, VIRTKEY, CONTROL, NOINVERT "P", ID_FILE_PRINT, VIRTKEY, CONTROL, NOINVERT "R", ID_FILE_RUN, VIRTKEY, CONTROL, NOINVERT - "R", ID_FILE_RUN, VIRTKEY, SHIFT, CONTROL, + "R", ID_FILE_RUN, VIRTKEY, SHIFT, CONTROL, NOINVERT "S", ID_FILE_SAVE, VIRTKEY, CONTROL, NOINVERT - "S", ID_FILE_SAVE_ALL, VIRTKEY, SHIFT, CONTROL, + "S", ID_FILE_SAVE_ALL, VIRTKEY, SHIFT, CONTROL, NOINVERT "V", ID_EDIT_PASTE, VIRTKEY, CONTROL, NOINVERT VK_BACK, ID_EDIT_UNDO, VIRTKEY, ALT, NOINVERT @@ -483,11 +483,11 @@ BEGIN "Z", ID_EDIT_UNDO, VIRTKEY, CONTROL, NOINVERT END -IDR_TEXTTYPE ACCELERATORS PRELOAD MOVEABLE PURE +IDR_TEXTTYPE ACCELERATORS PRELOAD MOVEABLE PURE BEGIN "B", ID_VIEW_BROWSE, VIRTKEY, CONTROL, NOINVERT "C", ID_EDIT_COPY, VIRTKEY, CONTROL, NOINVERT - "C", ID_FILE_CHECK, VIRTKEY, SHIFT, CONTROL, + "C", ID_FILE_CHECK, VIRTKEY, SHIFT, CONTROL, NOINVERT "F", ID_EDIT_FIND, VIRTKEY, CONTROL, NOINVERT "H", ID_EDIT_REPLACE, VIRTKEY, CONTROL, NOINVERT @@ -497,10 +497,10 @@ BEGIN "O", ID_FILE_OPEN, VIRTKEY, CONTROL, NOINVERT "P", ID_FILE_PRINT, VIRTKEY, CONTROL, NOINVERT "R", ID_FILE_RUN, VIRTKEY, CONTROL, NOINVERT - "R", ID_FILE_RUN, VIRTKEY, SHIFT, CONTROL, + "R", ID_FILE_RUN, VIRTKEY, SHIFT, CONTROL, NOINVERT "S", ID_FILE_SAVE, VIRTKEY, CONTROL, NOINVERT - "S", ID_FILE_SAVE_ALL, VIRTKEY, SHIFT, CONTROL, + "S", ID_FILE_SAVE_ALL, VIRTKEY, SHIFT, CONTROL, NOINVERT "V", ID_EDIT_PASTE, VIRTKEY, CONTROL, NOINVERT VK_BACK, ID_EDIT_UNDO, VIRTKEY, ALT, NOINVERT @@ -515,7 +515,7 @@ BEGIN "Z", ID_EDIT_UNDO, VIRTKEY, CONTROL, NOINVERT END -IDR_DEBUGGER ACCELERATORS PRELOAD MOVEABLE PURE +IDR_DEBUGGER ACCELERATORS PRELOAD MOVEABLE PURE BEGIN "B", ID_VIEW_BROWSE, VIRTKEY, CONTROL, NOINVERT "C", ID_EDIT_COPY, VIRTKEY, CONTROL, NOINVERT @@ -526,7 +526,7 @@ BEGIN "O", ID_FILE_OPEN, VIRTKEY, CONTROL, NOINVERT "P", ID_FILE_PRINT, VIRTKEY, CONTROL, NOINVERT "R", ID_FILE_RUN, VIRTKEY, CONTROL, NOINVERT - "R", ID_FILE_RUN, VIRTKEY, SHIFT, CONTROL, + "R", ID_FILE_RUN, VIRTKEY, SHIFT, CONTROL, NOINVERT "S", ID_FILE_SAVE, VIRTKEY, CONTROL, NOINVERT "V", ID_EDIT_PASTE, VIRTKEY, CONTROL, NOINVERT @@ -555,13 +555,13 @@ FONT 8, "MS Sans Serif" BEGIN LTEXT "&Header:",IDC_STATIC,7,8,30,9 EDITTEXT IDC_HEADER,37,7,106,13,ES_AUTOHSCROLL - CONTROL "File Time",IDC_HEADER_FILE,"Button",BS_AUTORADIOBUTTON | + CONTROL "File Time",IDC_HEADER_FILE,"Button",BS_AUTORADIOBUTTON | WS_GROUP | WS_TABSTOP,6,23,49,10 CONTROL "System Time",IDC_HEADER_SYSTEM,"Button", BS_AUTORADIOBUTTON,58,23,61,10 LTEXT "&Footer:",IDC_STATIC,7,41,29,9 EDITTEXT IDC_FOOTER,37,40,106,13,ES_AUTOHSCROLL - CONTROL "File Time",IDC_FOOTER_FILE,"Button",BS_AUTORADIOBUTTON | + CONTROL "File Time",IDC_FOOTER_FILE,"Button",BS_AUTORADIOBUTTON | WS_GROUP | WS_TABSTOP,6,56,49,10 CONTROL "System Time",IDC_FOOTER_SYSTEM,"Button", BS_AUTORADIOBUTTON,58,56,61,10 @@ -590,8 +590,8 @@ BEGIN PUSHBUTTON "Button 1",IDC_BUTTON1,170,45,50,14 PUSHBUTTON "Button 2",IDC_BUTTON2,170,65,50,14 PUSHBUTTON "Button 3",IDC_BUTTON3,170,85,50,14 - CONTROL "Tree1",IDC_LIST1,"SysTreeView32",TVS_HASBUTTONS | - TVS_HASLINES | TVS_LINESATROOT | TVS_SHOWSELALWAYS | + CONTROL "Tree1",IDC_LIST1,"SysTreeView32",TVS_HASBUTTONS | + TVS_HASLINES | TVS_LINESATROOT | TVS_SHOWSELALWAYS | WS_BORDER | WS_TABSTOP,3,3,160,94 END @@ -602,8 +602,8 @@ FONT 8, "MS Sans Serif" BEGIN DEFPUSHBUTTON "OK",IDOK,170,5,50,14 PUSHBUTTON "Cancel",IDCANCEL,170,25,50,14 - CONTROL "Tree1",IDC_LIST1,"SysTreeView32",TVS_HASBUTTONS | - TVS_HASLINES | TVS_LINESATROOT | TVS_SHOWSELALWAYS | + CONTROL "Tree1",IDC_LIST1,"SysTreeView32",TVS_HASBUTTONS | + TVS_HASLINES | TVS_LINESATROOT | TVS_SHOWSELALWAYS | WS_BORDER | WS_TABSTOP,3,3,160,88 END @@ -623,11 +623,11 @@ STYLE WS_CHILD | WS_DISABLED | WS_CAPTION CAPTION "Page 2" FONT 8, "MS Sans Serif" BEGIN - CONTROL "Option I",IDC_DEMO1,"Button",BS_AUTORADIOBUTTON | + CONTROL "Option I",IDC_DEMO1,"Button",BS_AUTORADIOBUTTON | BS_NOTIFY | WS_GROUP,10,10,59,11 - CONTROL "Option II",IDC_DEMO2,"Button",BS_AUTORADIOBUTTON | + CONTROL "Option II",IDC_DEMO2,"Button",BS_AUTORADIOBUTTON | BS_NOTIFY,10,24,68,10 - CONTROL "Option III",IDC_DEMO3,"Button",BS_AUTORADIOBUTTON | + CONTROL "Option III",IDC_DEMO3,"Button",BS_AUTORADIOBUTTON | BS_NOTIFY,10,39,60,10 END @@ -639,7 +639,7 @@ BEGIN DEFPUSHBUTTON "OK",IDOK,184,94,37,14,WS_GROUP LTEXT "A very long version string that should wrap", IDC_ABOUT_VERSION,7,96,122,16 - CONTROL "",IDC_EDIT1,"RICHEDIT",ES_MULTILINE | WS_BORDER | + CONTROL "",IDC_EDIT1,"RICHEDIT",ES_MULTILINE | WS_BORDER | WS_VSCROLL | WS_TABSTOP,4,4,219,85,WS_EX_TRANSPARENT PUSHBUTTON "Home page",IDC_BUTTON1,131,94,48,14 END @@ -660,7 +660,7 @@ BEGIN LTEXT "&Arguments",IDC_PROMPT2,5,25,45,10 EDITTEXT IDC_EDIT2,55,23,140,12,ES_AUTOHSCROLL LTEXT "&Debugging",IDC_STATIC,5,44,45,10 - COMBOBOX IDC_COMBO1,55,41,140,59,CBS_DROPDOWNLIST | WS_VSCROLL | + COMBOBOX IDC_COMBO1,55,41,140,59,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP PUSHBUTTON "&Browse...",IDC_BUTTON2,205,5,40,12 DEFPUSHBUTTON "OK",IDOK,205,23,40,15 @@ -672,7 +672,7 @@ STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU CAPTION "Title" FONT 8, "MS Sans Serif" BEGIN - EDITTEXT IDC_EDIT1,5,10,245,120,ES_MULTILINE | ES_AUTOVSCROLL | + EDITTEXT IDC_EDIT1,5,10,245,120,ES_MULTILINE | ES_AUTOVSCROLL | ES_AUTOHSCROLL | ES_WANTRETURN | WS_VSCROLL | WS_HSCROLL PUSHBUTTON "Cancel",IDCANCEL,140,135,50,14,NOT WS_VISIBLE DEFPUSHBUTTON "OK",IDOK,200,135,50,14 @@ -716,25 +716,25 @@ BEGIN GROUPBOX "",IDC_STATIC,7,1,125,43 CONTROL "&Auto complete",IDC_AUTOCOMPLETE,"Button", BS_AUTOCHECKBOX | WS_TABSTOP,12,12,59,8 - CONTROL "Show &calltips",IDC_CALLTIPS,"Button",BS_AUTOCHECKBOX | + CONTROL "Show &calltips",IDC_CALLTIPS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,74,12,54,9 LTEXT "&Keyboard",IDC_STATIC,12,29,32,10 - COMBOBOX IDC_KEYBOARD_CONFIG,73,26,55,37,CBS_DROPDOWNLIST | + COMBOBOX IDC_KEYBOARD_CONFIG,73,26,55,37,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP GROUPBOX "Margins Widths",IDC_STATIC,136,1,109,91 LTEXT "Line Numbers",IDC_STATIC,142,12,51,8 EDITTEXT IDC_MARGIN_LINENUMBER,207,9,33,13,ES_AUTOHSCROLL - CONTROL "Spin1",IDC_SPIN2,"msctls_updown32",UDS_SETBUDDYINT | - UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | + CONTROL "Spin1",IDC_SPIN2,"msctls_updown32",UDS_SETBUDDYINT | + UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | UDS_HOTTRACK,234,7,11,13 EDITTEXT IDC_MARGIN_MARKER,207,58,33,12,ES_AUTOHSCROLL - CONTROL "Spin1",IDC_SPIN1,"msctls_updown32",UDS_SETBUDDYINT | - UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | + CONTROL "Spin1",IDC_SPIN1,"msctls_updown32",UDS_SETBUDDYINT | + UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | UDS_HOTTRACK,234,57,11,14 LTEXT "Folding",IDC_STATIC,142,26,50,8 EDITTEXT IDC_MARGIN_FOLD,207,27,33,12,ES_AUTOHSCROLL - CONTROL "Spin1",IDC_SPIN3,"msctls_updown32",UDS_SETBUDDYINT | - UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | + CONTROL "Spin1",IDC_SPIN3,"msctls_updown32",UDS_SETBUDDYINT | + UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | UDS_HOTTRACK,234,19,11,15 GROUPBOX "Folding",IDC_STATIC,7,46,125,46 CONTROL "Enable folding",IDC_FOLD_ENABLE,"Button", @@ -749,22 +749,22 @@ BEGIN CONTROL "&VSS Integration",IDC_VSS_INTEGRATE,"Button", BS_AUTOCHECKBOX | WS_TABSTOP,12,112,96,11 LTEXT "&Backups",IDC_STATIC,12,125,32,10 - COMBOBOX IDC_COMBO1,61,123,49,41,CBS_DROPDOWN | WS_VSCROLL | + COMBOBOX IDC_COMBO1,61,123,49,41,CBS_DROPDOWN | WS_VSCROLL | WS_TABSTOP LTEXT "Markers (bookmarks etc)",IDC_STATIC,142,49,98,9 - CONTROL "In margin",IDC_RADIO1,"Button",BS_AUTORADIOBUTTON | + CONTROL "In margin",IDC_RADIO1,"Button",BS_AUTORADIOBUTTON | WS_GROUP | WS_TABSTOP,142,59,50,11 - CONTROL "In &background",IDC_RADIO2,"Button",BS_AUTORADIOBUTTON | + CONTROL "In &background",IDC_RADIO2,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,142,74,98,11 GROUPBOX "Right-Edge mode",IDC_STATIC,136,95,109,44 EDITTEXT IDC_RIGHTEDGE_COLUMN,207,103,33,12,ES_AUTOHSCROLL - CONTROL "Spin1",IDC_SPIN4,"msctls_updown32",UDS_SETBUDDYINT | - UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | + CONTROL "Spin1",IDC_SPIN4,"msctls_updown32",UDS_SETBUDDYINT | + UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | UDS_HOTTRACK,234,102,11,14 CONTROL "Enable at col.",IDC_RIGHTEDGE_ENABLE,"Button", BS_AUTOCHECKBOX | WS_TABSTOP,142,104,59,11 PUSHBUTTON "Define...",IDC_RIGHTEDGE_DEFINE,208,119,32,12 - CONTROL "",IDC_RIGHTEDGE_SAMPLE,"RICHEDIT",ES_AUTOHSCROLL | + CONTROL "",IDC_RIGHTEDGE_SAMPLE,"RICHEDIT",ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP,142,118,50,13 END @@ -775,22 +775,22 @@ FONT 8, "MS Sans Serif" BEGIN LTEXT "Size of recent file list",IDC_STATIC,7,14,73,12 EDITTEXT IDC_EDIT4,87,12,29,12,ES_AUTOHSCROLL - CONTROL "Spin1",IDC_SPIN1,"msctls_updown32",UDS_SETBUDDYINT | - UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | + CONTROL "Spin1",IDC_SPIN1,"msctls_updown32",UDS_SETBUDDYINT | + UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | UDS_HOTTRACK,119,15,10,14 GROUPBOX "Interactive Window",IDC_STATIC,134,7,114,103 - CONTROL "&Show at startup",IDC_CHECK1,"Button",BS_AUTOCHECKBOX | + CONTROL "&Show at startup",IDC_CHECK1,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,141,16,72,10 - CONTROL "",IDC_EDIT1,"RICHEDIT",ES_AUTOHSCROLL | WS_BORDER | + CONTROL "",IDC_EDIT1,"RICHEDIT",ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP,141,54,57,16 PUSHBUTTON "Change...",IDC_BUTTON1,203,56,39,13 - CONTROL "",IDC_EDIT2,"RICHEDIT",ES_AUTOHSCROLL | WS_BORDER | + CONTROL "",IDC_EDIT2,"RICHEDIT",ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP,141,70,57,16 PUSHBUTTON "Change...",IDC_BUTTON2,203,72,39,13 - CONTROL "",IDC_EDIT3,"RICHEDIT",ES_AUTOHSCROLL | WS_BORDER | + CONTROL "",IDC_EDIT3,"RICHEDIT",ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP,141,88,58,16 PUSHBUTTON "Change...",IDC_BUTTON3,203,89,39,13 - CONTROL "&Dockable window",IDC_CHECK2,"Button",BS_AUTOCHECKBOX | + CONTROL "&Dockable window",IDC_CHECK2,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,141,27,72,10 END @@ -810,13 +810,13 @@ BEGIN RTEXT "&To:",1090,82,80,16,9 EDITTEXT 1153,102,78,26,12,ES_RIGHT LTEXT "Print &Quality:",1091,4,100,50,9 - COMBOBOX 1136,55,98,81,36,CBS_DROPDOWNLIST | WS_BORDER | + COMBOBOX 1136,55,98,81,36,CBS_DROPDOWNLIST | WS_BORDER | WS_VSCROLL | WS_GROUP | WS_TABSTOP LTEXT "&Copies:",1092,153,100,29,9 EDITTEXT 1154,184,98,26,12,ES_RIGHT - CONTROL "Print to Fi&le",1040,"Button",BS_AUTOCHECKBOX | + CONTROL "Print to Fi&le",1040,"Button",BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP,4,113,120,12 - CONTROL "Collate Cop&ies",1041,"Button",BS_AUTOCHECKBOX | + CONTROL "Collate Cop&ies",1041,"Button",BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP,153,113,67,12 DEFPUSHBUTTON "OK",IDOK,170,4,50,14,WS_GROUP PUSHBUTTON "Cancel",IDCANCEL,170,21,50,14,WS_GROUP @@ -831,10 +831,10 @@ STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "Format" FONT 8, "MS Sans Serif" BEGIN - LISTBOX IDC_LIST1,130,5,120,72,LBS_SORT | LBS_NOINTEGRALHEIGHT | + LISTBOX IDC_LIST1,130,5,120,72,LBS_SORT | LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP GROUPBOX "Format",IDC_STATIC,130,78,120,44 - CONTROL "Fixed Width",IDC_RADIO1,"Button",BS_AUTORADIOBUTTON | + CONTROL "Fixed Width",IDC_RADIO1,"Button",BS_AUTORADIOBUTTON | WS_GROUP,15,89,55,10 GROUPBOX "Default Font",IDC_STATIC,7,78,120,44 PUSHBUTTON "Define...",IDC_BUTTON1,78,87,44,12 @@ -842,13 +842,13 @@ BEGIN 103,55,8 PUSHBUTTON "Define...",IDC_BUTTON2,78,103,44,12 PUSHBUTTON "Define...",IDC_BUTTON3,196,101,48,10 - CONTROL "Default font",IDC_CHECK1,"Button",BS_AUTOCHECKBOX | + CONTROL "Default font",IDC_CHECK1,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,134,101,59,8 - COMBOBOX IDC_COMBO1,134,86,50,63,CBS_DROPDOWNLIST | WS_VSCROLL | + COMBOBOX IDC_COMBO1,134,86,50,63,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP - COMBOBOX IDC_COMBO2,194,86,50,63,CBS_DROPDOWNLIST | WS_VSCROLL | + COMBOBOX IDC_COMBO2,194,86,50,63,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP - CONTROL "Default b/g",IDC_CHECK2,"Button",BS_AUTOCHECKBOX | + CONTROL "Default b/g",IDC_CHECK2,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,134,112,59,8 PUSHBUTTON "Define...",IDC_BUTTON4,195,112,49,10 END @@ -861,7 +861,7 @@ BEGIN GROUPBOX "General Options",-1,5,2,122,31 CONTROL "Hide debugger in non-GUI apps",IDC_CHECK1,"Button", BS_AUTOCHECKBOX | WS_TABSTOP,12,9,114,11 - CONTROL "Stop at exceptions",IDC_CHECK2,"Button",BS_AUTOCHECKBOX | + CONTROL "Stop at exceptions",IDC_CHECK2,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,12,20,75,11 END @@ -870,7 +870,7 @@ STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "Tools Menu" FONT 8, "MS Sans Serif" BEGIN - CONTROL "List1",IDC_LIST1,"SysListView32",LVS_REPORT | + CONTROL "List1",IDC_LIST1,"SysListView32",LVS_REPORT | LVS_EDITLABELS | WS_BORDER | WS_TABSTOP,7,7,174,90 LTEXT "Python command",IDC_STATIC,7,103,65,10 EDITTEXT IDC_EDIT2,85,101,154,12,ES_AUTOHSCROLL @@ -888,21 +888,21 @@ BEGIN GROUPBOX "",IDC_STATIC,7,0,242,65 LTEXT "&Tab size",IDC_STATIC,14,8,42,13 EDITTEXT IDC_TAB_SIZE,71,8,42,12,ES_AUTOHSCROLL - CONTROL "Spin1",IDC_SPIN1,"msctls_updown32",UDS_SETBUDDYINT | - UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | + CONTROL "Spin1",IDC_SPIN1,"msctls_updown32",UDS_SETBUDDYINT | + UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | UDS_HOTTRACK,112,11,11,14 LTEXT "&Indent Size",IDC_STATIC,14,24,42,10 EDITTEXT IDC_INDENT_SIZE,71,24,42,12,ES_AUTOHSCROLL - CONTROL "Spin1",IDC_SPIN2,"msctls_updown32",UDS_SETBUDDYINT | - UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | + CONTROL "Spin1",IDC_SPIN2,"msctls_updown32",UDS_SETBUDDYINT | + UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | UDS_HOTTRACK,113,25,11,14 CONTROL "Use &Python smart indentation?",IDC_USE_SMART_TABS, "Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,39,113,10 CONTROL "View whitespace",IDC_VIEW_WHITESPACE,"Button", BS_AUTOCHECKBOX | WS_TABSTOP,14,50,83,12 - CONTROL "Insert spaces",IDC_RADIO1,"Button",BS_AUTORADIOBUTTON | + CONTROL "Insert spaces",IDC_RADIO1,"Button",BS_AUTORADIOBUTTON | WS_GROUP | WS_TABSTOP,141,11,82,11 - CONTROL "Keep tabs",IDC_USE_TABS,"Button",BS_AUTORADIOBUTTON | + CONTROL "Keep tabs",IDC_USE_TABS,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,141,27,82,11 CONTROL "View indentation guides",IDC_VIEW_INDENTATIONGUIDES, "Button",BS_AUTOCHECKBOX | WS_TABSTOP,141,38,97,12 @@ -916,7 +916,7 @@ BEGIN BS_AUTORADIOBUTTON,14,88,105,13 CONTROL "Show as background color",IDC_TABTIMMY_BG,"Button", BS_AUTORADIOBUTTON | WS_DISABLED,14,100,105,13 - COMBOBOX IDC_COMBO1,141,88,56,63,CBS_DROPDOWNLIST | WS_VSCROLL | + COMBOBOX IDC_COMBO1,141,88,56,63,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP END @@ -977,7 +977,7 @@ END // #ifdef APSTUDIO_INVOKED -GUIDELINES DESIGNINFO DISCARDABLE +GUIDELINES DESIGNINFO DISCARDABLE BEGIN IDD_ABOUTBOX, DIALOG BEGIN @@ -1069,42 +1069,42 @@ END IDD_PP_EDITOR DLGINIT BEGIN IDC_COMBO1, 0x403, 8, 0 -0x774f, 0x206e, 0x6964, 0x0072, +0x774f, 0x206e, 0x6964, 0x0072, IDC_COMBO1, 0x403, 10, 0 -0x422e, 0x4b41, 0x6620, 0x6c69, 0x0065, +0x422e, 0x4b41, 0x6620, 0x6c69, 0x0065, IDC_COMBO1, 0x403, 9, 0 -0x4554, 0x504d, 0x6420, 0x7269, "\000" +0x4554, 0x504d, 0x6420, 0x7269, "\000" IDC_COMBO1, 0x403, 5, 0 -0x6f4e, 0x656e, "\000" +0x6f4e, 0x656e, "\000" 0 END IDD_PP_FORMAT DLGINIT BEGIN IDC_COMBO2, 0x403, 8, 0 -0x6552, 0x7567, 0x616c, 0x0072, +0x6552, 0x7567, 0x616c, 0x0072, IDC_COMBO2, 0x403, 7, 0 -0x7449, 0x6c61, 0x6369, "\000" +0x7449, 0x6c61, 0x6369, "\000" IDC_COMBO2, 0x403, 5, 0 -0x6f42, 0x646c, "\000" +0x6f42, 0x646c, "\000" IDC_COMBO2, 0x403, 12, 0 -0x6f42, 0x646c, 0x4920, 0x6174, 0x696c, 0x0063, +0x6f42, 0x646c, 0x4920, 0x6174, 0x696c, 0x0063, 0 END IDD_RUN_SCRIPT DLGINIT BEGIN IDC_COMBO1, 0x403, 13, 0 -0x6f4e, 0x6420, 0x6265, 0x6775, 0x6967, 0x676e, "\000" +0x6f4e, 0x6420, 0x6265, 0x6775, 0x6967, 0x676e, "\000" IDC_COMBO1, 0x403, 29, 0 -0x7453, 0x7065, 0x742d, 0x7268, 0x756f, 0x6867, 0x6920, 0x206e, 0x6874, -0x2065, 0x6564, 0x7562, 0x6767, 0x7265, "\000" +0x7453, 0x7065, 0x742d, 0x7268, 0x756f, 0x6867, 0x6920, 0x206e, 0x6874, +0x2065, 0x6564, 0x7562, 0x6767, 0x7265, "\000" IDC_COMBO1, 0x403, 20, 0 -0x7552, 0x206e, 0x6e69, 0x7420, 0x6568, 0x6420, 0x6265, 0x6775, 0x6567, -0x0072, +0x7552, 0x206e, 0x6e69, 0x7420, 0x6568, 0x6420, 0x6265, 0x6775, 0x6567, +0x0072, IDC_COMBO1, 0x403, 29, 0 -0x6544, 0x7562, 0x2067, 0x6669, 0x7520, 0x686e, 0x6e61, 0x6c64, 0x6465, -0x6520, 0x6378, 0x7065, 0x6974, 0x6e6f, "\000" +0x6544, 0x7562, 0x2067, 0x6669, 0x7520, 0x686e, 0x6e61, 0x6c64, 0x6465, +0x6520, 0x6378, 0x7065, 0x6974, 0x6e6f, "\000" 0 END @@ -1114,7 +1114,7 @@ END // String Table // -STRINGTABLE PRELOAD DISCARDABLE +STRINGTABLE PRELOAD DISCARDABLE BEGIN IDR_MAINFRAME "Pythonwin" IDR_PYTHONTYPE "\nScript\nPython Script\nPython scripts (*.py, *.pyw, *.pys)\n.py;.pyw;.pys\nPythonScript\nPython Script" @@ -1122,13 +1122,13 @@ BEGIN IDR_DEBUGGER "Pythonwin Debugger" END -STRINGTABLE PRELOAD DISCARDABLE +STRINGTABLE PRELOAD DISCARDABLE BEGIN AFX_IDS_APP_TITLE "Python for Win32" AFX_IDS_IDLEMESSAGE "Ready" END -STRINGTABLE DISCARDABLE +STRINGTABLE DISCARDABLE BEGIN ID_INDICATOR_EXT "EXT" ID_INDICATOR_CAPS "CAP" @@ -1138,7 +1138,7 @@ BEGIN ID_INDICATOR_REC "REC" END -STRINGTABLE DISCARDABLE +STRINGTABLE DISCARDABLE BEGIN ID_FILE_NEW "Create a new file\nNew" ID_FILE_OPEN "Open an existing file\nOpen" @@ -1151,14 +1151,14 @@ BEGIN ID_FILE_PRINT_PREVIEW "Display full pages\nPrint Preview" END -STRINGTABLE DISCARDABLE +STRINGTABLE DISCARDABLE BEGIN ID_APP_ABOUT "Display program information, version number and copyright\nAbout" ID_APP_EXIT "Quit the application; prompts to save files\nExit" ID_HELP_INDEX "Display an index of all the help files.\nHelp Index" END -STRINGTABLE DISCARDABLE +STRINGTABLE DISCARDABLE BEGIN ID_FILE_MRU_FILE1 "Open this file" ID_FILE_MRU_FILE2 "Open this file" @@ -1166,13 +1166,13 @@ BEGIN ID_FILE_MRU_FILE4 "Open this file" END -STRINGTABLE DISCARDABLE +STRINGTABLE DISCARDABLE BEGIN ID_NEXT_PANE "Switch to the next window pane\nNext Window" ID_PREV_PANE "Switch back to the previous window pane\nPrev Window" END -STRINGTABLE DISCARDABLE +STRINGTABLE DISCARDABLE BEGIN ID_WINDOW_NEW "Open another window for the active file\nNew Window" ID_WINDOW_ARRANGE "Arrange icons at the bottom of the window\nArrange Icons" @@ -1182,7 +1182,7 @@ BEGIN ID_WINDOW_SPLIT "Split the active window into panes\nSplit" END -STRINGTABLE DISCARDABLE +STRINGTABLE DISCARDABLE BEGIN ID_EDIT_CLEAR "Erase the selection\nClear" ID_EDIT_CLEAR_ALL "Erase everything\nClear All" @@ -1198,7 +1198,7 @@ BEGIN ID_EDIT_REDO "Redo the previously undone action\nRedo" END -STRINGTABLE DISCARDABLE +STRINGTABLE DISCARDABLE BEGIN ID_FILE_RUN "Run a python script.\nRun" ID_PAGE_SETUP "Set headers, footers, and margins\nPage Setup" @@ -1216,18 +1216,18 @@ BEGIN ID_VIEW_OPTIONS "View and change various Pythonwin options." END -STRINGTABLE DISCARDABLE +STRINGTABLE DISCARDABLE BEGIN ID_VIEW_TOOLBAR "Show or hide the toolbar\nShow/Hide Toolbar" ID_VIEW_STATUS_BAR "Show or hide the status bar\nShow/Hide Statusbar" END -STRINGTABLE DISCARDABLE +STRINGTABLE DISCARDABLE BEGIN ID_VIEW_TOOLBAR_DBG "Show or hide the debugging toolbar\nDebugging Toolbar" END -STRINGTABLE DISCARDABLE +STRINGTABLE DISCARDABLE BEGIN AFX_IDS_SCSIZE "Change the window size" AFX_IDS_SCMOVE "Change the window position" @@ -1238,14 +1238,14 @@ BEGIN AFX_IDS_SCCLOSE "Close the active window and prompts to save the documents" END -STRINGTABLE DISCARDABLE +STRINGTABLE DISCARDABLE BEGIN AFX_IDS_SCRESTORE "Restore the window to normal size" AFX_IDS_SCTASKLIST "Activate Task List" AFX_IDS_MDICHILD "Activate this window" END -STRINGTABLE DISCARDABLE +STRINGTABLE DISCARDABLE BEGIN ID_CHOOSE_FONT "Select display font for this window" ID_SET_TABSTOPS "Set tab stops for this window" @@ -1254,23 +1254,23 @@ BEGIN ID_INDICATOR_COLNUM "888" END -STRINGTABLE DISCARDABLE +STRINGTABLE DISCARDABLE BEGIN IDP_ERR_GET_PRINTER_DC "Cannot get printer device context." IDP_ERR_GET_DEVICE_DEFAULTS "Cannot get printer device defaults." END -STRINGTABLE DISCARDABLE +STRINGTABLE DISCARDABLE BEGIN ID_INDICATOR_LINENUM "88888" END -STRINGTABLE DISCARDABLE +STRINGTABLE DISCARDABLE BEGIN ID_HELP_OTHER "Other Python help files." END -STRINGTABLE DISCARDABLE +STRINGTABLE DISCARDABLE BEGIN ID_FILE_CHECK "Checks the current file without executing it.\nCheck" ID_FILE_SAVE_ALL "Save all open files\nSave All" @@ -1280,14 +1280,14 @@ BEGIN ID_VIEW_FOLD_EXPAND "Expand the current fold.\nExpand" END -STRINGTABLE DISCARDABLE +STRINGTABLE DISCARDABLE BEGIN IDC_DBG_STEPOUT "Step out of the current function\nStep Out" IDC_DBG_STEPOVER "Step over the current function\nStep Over" IDC_DBG_GO "Continue Execution\nGo" END -STRINGTABLE DISCARDABLE +STRINGTABLE DISCARDABLE BEGIN IDC_DBG_ADD "Add or Remove a breakpoint\nToggle Breakpoint" IDC_DBG_CLEAR "Clear all breakpoints\nClear All Breakpoints" @@ -1295,18 +1295,18 @@ BEGIN IDC_DBG_STEP "Step into the current statement\nStep" END -STRINGTABLE DISCARDABLE +STRINGTABLE DISCARDABLE BEGIN IDC_DBG_WATCH "Add/Remove a watch entry\nWatch" END -STRINGTABLE DISCARDABLE +STRINGTABLE DISCARDABLE BEGIN ID_VIEW_FOLD_EXPAND_ALL "Expand all currently collapsed folds.\nExpand all" - ID_VIEW_FOLD_COLLAPSE_ALL + ID_VIEW_FOLD_COLLAPSE_ALL "Collapse all currently expanded folds.\nCollapse all" ID_VIEW_FOLD_COLLAPSE "Collapse the current fold.\nCollapse" - ID_VIEW_INDENTATIONGUIDES + ID_VIEW_INDENTATIONGUIDES "Toggle display of indentation guides\nHide/show Indentation guides" ID_VIEW_RIGHT_EDGE "Toggle display of the right edge indicator (default is enabled at 75 characters)" END @@ -1326,4 +1326,3 @@ END ///////////////////////////////////////////////////////////////////////////// #endif // not APSTUDIO_INVOKED - diff --git a/Pythonwin/win32uioledoc.h b/Pythonwin/win32uioledoc.h index 2c53fd074..e32bc314c 100644 --- a/Pythonwin/win32uioledoc.h +++ b/Pythonwin/win32uioledoc.h @@ -22,4 +22,4 @@ class PyCOleClientItem : public PyCCmdTarget { MAKE_PY_CTOR(PyCOleClientItem); static ui_type_CObject type; -}; \ No newline at end of file +}; diff --git a/SWIG/pywin32_swig.patch b/SWIG/pywin32_swig.patch index 0716c66b7..c8bb4a5c1 100644 --- a/SWIG/pywin32_swig.patch +++ b/SWIG/pywin32_swig.patch @@ -23,12 +23,12 @@ Huge thanks to Amaury Forgeot d'Arc and Roger Upole for rescuing this! --- SWIG1.1p5-orig\Modules\python.cxx 1998-01-03 17:17:40.000000000 +1100 +++ SWIG1.1p5\Modules\python.cxx 2011-04-29 23:28:30.860296500 +1000 @@ -61,6 +61,8 @@ - + static int doc_index = 0; static DocString *doc_strings = 0; +static int PythonCom = 0; // Generate PyWin32 header files +static char *PythonCom_Parent = "IUnknown"; - + static char *usage = "\ Python Options (available with -python)\n\ @@ -113,6 +115,14 @@ @@ -69,7 +69,7 @@ Huge thanks to Amaury Forgeot d'Arc and Roger Upole for rescuing this! + char fn_header[256]; + sprintf(fn_header, "Py%s.h", module); + FILE *f_header = fopen(fn_header, "w"); -+ ++ + if (!f_header) { + fprintf(stderr, "Unable to open %s\n", fn_header); + SWIG_exit(1); @@ -92,7 +92,7 @@ Huge thanks to Amaury Forgeot d'Arc and Roger Upole for rescuing this! + + fclose(f_header); } - + // --------------------------------------------------------------------- @@ -376,6 +427,8 @@ void PYTHON::initialize_cmodule(void) @@ -101,12 +101,12 @@ Huge thanks to Amaury Forgeot d'Arc and Roger Upole for rescuing this! + if (PythonCom) + return; fprintf(f_header,"#define SWIG_init init%s\n\n", module); - fprintf(f_header,"#define SWIG_name \"%s\"\n", module); - + fprintf(f_header,"#define SWIG_name \"%s\"\n", module); + @@ -389,7 +442,13 @@ fprintf(f_init,"extern \"C\" \n"); fprintf(f_init,"#endif\n"); - + + fprintf(f_init, "#if (PY_VERSION_HEX < 0x03000000)\n"); + fprintf(f_init, "#define MODINIT_ERROR_RETURN\n"); fprintf(f_init,"SWIGEXPORT(void,init%s)() {\n",module); @@ -115,7 +115,7 @@ Huge thanks to Amaury Forgeot d'Arc and Roger Upole for rescuing this! + fprintf(f_init,"SWIGEXPORT(PyObject*, PyInit_%s)(void) {\n",module); + fprintf(f_init, "#endif\n"); fprintf(f_init,"\t PyObject *m, *d;\n"); - + if (InitNames) { @@ -400,8 +459,26 @@ } @@ -142,10 +142,10 @@ Huge thanks to Amaury Forgeot d'Arc and Roger Upole for rescuing this! + module, module, module, module); + fprintf(f_init, "#endif\n"); } - - + + @@ -417,6 +494,9 @@ - + print_methods(); close_cmodule(); + if (PythonCom) { @@ -161,14 +161,14 @@ Huge thanks to Amaury Forgeot d'Arc and Roger Upole for rescuing this! - emit_ptr_equivalence(f_init); + if (PythonCom) + return; -+// pywin32 doesn't need the pointer type-equivalency mappings. ++// pywin32 doesn't need the pointer type-equivalency mappings. +// emit_ptr_equivalence(f_init); + fprintf(f_init, "#if (PY_VERSION_HEX > 0x03000000)\n"); + fprintf(f_init,"\treturn m;\n"); + fprintf(f_init, "#endif\n"); fprintf(f_init,"}\n"); } - + @@ -598,9 +684,12 @@ // ---------------------------------------------------------------------- void PYTHON::emit_function_header(WrapperFunction &emit_to, char *wname) @@ -182,7 +182,7 @@ Huge thanks to Amaury Forgeot d'Arc and Roger Upole for rescuing this! + if (!PythonCom) + emit_to.code << tab4 << "self = self;\n"; } - + // ---------------------------------------------------------------------- @@ -612,8 +701,13 @@ // @@ -213,11 +213,11 @@ Huge thanks to Amaury Forgeot d'Arc and Roger Upole for rescuing this! + return name_wrapper(fnName,""); + } } - + // ---------------------------------------------------------------------- @@ -1629,7 +1730,13 @@ // ----------------------------------------------------------------------- - + void PYTHON::add_native(char *name, char *funcname) { - add_method(name, funcname); + if (PythonCom) { diff --git a/SWIG/readme.txt b/SWIG/readme.txt index 698bcb616..aea77ec63 100644 --- a/SWIG/readme.txt +++ b/SWIG/readme.txt @@ -18,4 +18,3 @@ fully qualified path to the .exe in this archive. Note that as this environment variable is used by MSVC, you probably need to set this variable globally (ie, either in autoexec.bat, or Control Panel->System- >Environment. - diff --git a/SWIG/swig_lib/array.i b/SWIG/swig_lib/array.i index 3ae8a8c4d..b1008db11 100644 --- a/SWIG/swig_lib/array.i +++ b/SWIG/swig_lib/array.i @@ -52,7 +52,7 @@ performed so use at your own peril. %subsection "Integer Arrays" %text %{ The following functions provide access to integer arrays (mapped -onto the C 'int' datatype. +onto the C 'int' datatype. %} %{ @@ -89,9 +89,9 @@ onto the C 'int' datatype. return INT_MIN; } } - + /* Set an element */ - + static int int_set(int *array, int index, int value) { if (array) { return (array[index] = value); @@ -158,9 +158,9 @@ int int_set(int *array, int index, int value); return FLT_MIN; } } - + /* Set an element */ - + static float float_set(float *array, int index, float value) { if (array) { return (array[index] = value); @@ -200,9 +200,9 @@ int int_set(int *array, int index, int value); return FLT_MIN; } } - + /* Set an element */ - + static double double_set(double *array, int index, double value) { if (array) { return (array[index] = value); @@ -278,7 +278,7 @@ can be used : foreach $arg (@list) { string_set($args,$i,$arg); $i++; - } + } string_set($args,$i,""); (of course, there is always more than one way to do it) @@ -326,22 +326,22 @@ static void string_destroy(char **array) { free(array[i]); #endif i++; - } + } #ifdef __cplusplus delete array; #else free(array); #endif - } + } } /* Get an element */ static char *string_get(char **array_string, int index) { - if (array_string) + if (array_string) if (array_string[index]) return (array_string[index]); else return ""; - else + else return ""; } @@ -355,7 +355,7 @@ static char *string_set(char **array_string, int index, char * val) { #else free(array_string[index]); #endif - } + } if (strlen(val) > 0) { #ifdef __cplusplus array_string[index] = new char[strlen(val)+1]; @@ -398,4 +398,3 @@ char *string_set(char **array, int index, char *value); %typemap(check) int *, double *, float *, char **, short *, long * = PREVIOUS; %typemap(out) int *, double *, float *, char **, short *, long * = PREVIOUS; - diff --git a/SWIG/swig_lib/autodoc.i b/SWIG/swig_lib/autodoc.i index 1f7bcfc80..a09e0f9a7 100644 --- a/SWIG/swig_lib/autodoc.i +++ b/SWIG/swig_lib/autodoc.i @@ -3,7 +3,7 @@ %style latex_section="\\newpage \\section{:}" %title "SWIG Library Reference",pre,sort,chop_left = 0,noinfo /* -Version 1.1 +Version 1.1 June, 1997 Copyright (C) 1996 @@ -22,7 +22,7 @@ can be used to supplement an interface file. These include functions to manipulate arrays, functions from the C library, and interesting modules. -This document is automatically generated by SWIG from the file +This document is automatically generated by SWIG from the file "swig_lib/autodoc.i". Some modules may supply additional documentation for a particular target language. To recreate the documentation for a particular target language, simply run SWIG on the file 'autodoc.i' @@ -103,5 +103,3 @@ module. %include "perl5/perlmain.i" #endif - - diff --git a/SWIG/swig_lib/carray.i b/SWIG/swig_lib/carray.i index b44fe906a..a9039ca89 100644 --- a/SWIG/swig_lib/carray.i +++ b/SWIG/swig_lib/carray.i @@ -27,9 +27,9 @@ static int *array_int(int size) { } static int get_int(int *array_int, int index) { - if (array_int) + if (array_int) return (array_int[index]); - else + else return 0; } @@ -47,9 +47,9 @@ static double *array_double(int size) { } static double get_double(double *array_double, int index) { - if (array_double) + if (array_double) return (array_double[index]); - else + else return 0; } @@ -69,9 +69,9 @@ static byte *array_byte(int size) { } static byte get_byte(byte *array_byte, int index) { - if (array_byte) + if (array_byte) return (array_byte[index]); - else + else return 0; } @@ -95,9 +95,9 @@ static char **array_string(int size) { } static char *get_string(char **array_string, int index) { - if (array_string) + if (array_string) return (array_string[index]); - else + else return ""; } @@ -164,6 +164,3 @@ NULL, returns an empty string */ char *set_string(char **array_string, int index, char * string); /* Sets array_string[index] = string. string must be a 0-terminated ASCII string. If string is "" then this will create a NULL pointer. */ - - - diff --git a/SWIG/swig_lib/constraints.i b/SWIG/swig_lib/constraints.i index 07ce32208..73b8e551e 100644 --- a/SWIG/swig_lib/constraints.i +++ b/SWIG/swig_lib/constraints.i @@ -1,9 +1,9 @@ -// +// // SWIG constraint library // Dave Beazley // May 4, 1997 // -// This library file contains typemaps for implementing various kinds of +// This library file contains typemaps for implementing various kinds of // constraints. Depends upon the SWIG exception library for generating // errors in a language-independent manner. @@ -34,7 +34,7 @@ directive. For example : %apply Number NONNEGATIVE { double nonneg }; double sqrt(double nonneg); // Name of argument must match - + %apply Pointer NONNULL { void *ptr }; void *malloc(int POSITIVE); // May return a NULL pointer void free(void *ptr); // May not accept a NULL pointer @@ -45,12 +45,12 @@ be specified as follows : %apply Pointer NONNULL { void *, Vector *, List *, double *}; -In this case, all of the types listed would be checked for non-NULL +In this case, all of the types listed would be checked for non-NULL pointers. The common datatypes of int, short, long, unsigned int, unsigned long, unsigned short, unsigned char, signed char, float, and double can be -checked without using the %apply directive by simply using the +checked without using the %apply directive by simply using the constraint name as the parameter name. For example : double sqrt(double NONNEGATIVE); @@ -162,7 +162,7 @@ If you have used typedef to change type-names, you can also do this : SWIG_exception(SWIG_ValueError,"Expected a non-positive value."); } } - + // Non-NULL pointer %typemap(check) void * NONNULL, @@ -204,5 +204,3 @@ If you have used typedef to change type-names, you can also do this : SWIG_exception(SWIG_ValueError,"Pointer must be 2-byte aligned."); } } - - diff --git a/SWIG/swig_lib/exception.i b/SWIG/swig_lib/exception.i index 007d3aa82..347a89f95 100644 --- a/SWIG/swig_lib/exception.i +++ b/SWIG/swig_lib/exception.i @@ -142,5 +142,3 @@ static void _SWIG_exception(int code, char *msg) { exception.i : Guile not currently supported. %} #endif - - diff --git a/SWIG/swig_lib/malloc.i b/SWIG/swig_lib/malloc.i index 5b33e317e..50b6b1f0b 100644 --- a/SWIG/swig_lib/malloc.i +++ b/SWIG/swig_lib/malloc.i @@ -34,7 +34,7 @@ typedef unsigned int size_t; void *calloc(size_t nobj, size_t size); /* Returns a pointer to a space for an array of nobj objects, each with - size bytes. Returns NULL if the request can't be satisfied. + size bytes. Returns NULL if the request can't be satisfied. Initializes the space to zero bytes. */ void *malloc(size_t size); @@ -42,7 +42,7 @@ void *malloc(size_t size); upon failure. */ void *realloc(void *ptr, size_t size); -/* Changes the size of the object pointed to by ptr to size bytes. +/* Changes the size of the object pointed to by ptr to size bytes. The contents will be unchanged up the minimum of the old and new sizes. Returns a pointer to the new space of NULL upon failure, in which case *ptr is unchanged. */ @@ -50,4 +50,3 @@ void *realloc(void *ptr, size_t size); void free(void *ptr); /* Deallocates the space pointed to by ptr. Does nothing if ptr is NULL. ptr must be a space previously allocated by calloc, malloc, or realloc. */ - diff --git a/SWIG/swig_lib/math.i b/SWIG/swig_lib/math.i index 71c771884..ae9933363 100644 --- a/SWIG/swig_lib/math.i +++ b/SWIG/swig_lib/math.i @@ -104,4 +104,3 @@ extern double fmod(double x, double y); #define M_2_SQRTPI 1.12837916709551257390 #define M_SQRT2 1.41421356237309504880 #define M_SQRT1_2 0.70710678118654752440 - diff --git a/SWIG/swig_lib/memory.i b/SWIG/swig_lib/memory.i index e656325a0..f3a30408d 100644 --- a/SWIG/swig_lib/memory.i +++ b/SWIG/swig_lib/memory.i @@ -35,5 +35,3 @@ void *memchr(const void *cs, char c, int n); void *memset(void *s, char c, int n); /* Place character c into first n characters of s, return s */ - - diff --git a/SWIG/swig_lib/objc.i b/SWIG/swig_lib/objc.i index 30d9152e6..b93afa5a1 100644 --- a/SWIG/swig_lib/objc.i +++ b/SWIG/swig_lib/objc.i @@ -2,7 +2,7 @@ // Dave Beazley // Copyright (C) 1997 -// This file provides support to Objective-C parsing and +// This file provides support to Objective-C parsing and // should be included with just about any Objective-C module // Base Object class @@ -48,9 +48,3 @@ typedef Object *id; // Make 'id' behave like any other "Object" croak("Expecting an 'id' in argument $argnum of $name"); } } - - - - - - diff --git a/SWIG/swig_lib/pointer.i b/SWIG/swig_lib/pointer.i index 04ad28844..2c171a22b 100644 --- a/SWIG/swig_lib/pointer.i +++ b/SWIG/swig_lib/pointer.i @@ -1,6 +1,6 @@ // // SWIG Pointer manipulation library -// +// // This library can be used to manipulate C pointers. %title "SWIG Pointer Library" @@ -12,14 +12,14 @@ %text %{ %include pointer.i -The pointer.i library provides run-time support for managing and +The pointer.i library provides run-time support for managing and manipulating a variety of C/C++ pointer values. In particular, you can create various kinds of objects and dereference common pointer types. This is done through a common set of functions: ptrcast - Casts a pointer to a new type - ptrvalue - Dereferences a pointer - ptrset - Set the value of an object referenced by + ptrvalue - Dereferences a pointer + ptrset - Set the value of an object referenced by a pointer. ptrcreate - Create a new object and return a pointer. ptrfree - Free the memory allocated by ptrcreate. @@ -40,7 +40,7 @@ pointers with type information, this can be done transparently and in most cases, you can dereference a pointer without ever knowing what type it actually is. -This library is primarily designed for utility, not high +This library is primarily designed for utility, not high performance (the dynamic determination of pointer types takes more work than most normal wrapper functions). As a result, you may achieve better performance by writing customized @@ -52,7 +52,3 @@ functions in inner loops or other intensive operations. // Grab the implementation from the appropriate libray %include ptrlang.i - - - - diff --git a/SWIG/swig_lib/python/embed.i b/SWIG/swig_lib/python/embed.i index d911caf47..b5557373e 100644 --- a/SWIG/swig_lib/python/embed.i +++ b/SWIG/swig_lib/python/embed.i @@ -24,7 +24,7 @@ present in your current Python executable (including any special purpose modules you have enabled such as tkinter). Thus, you may need to provide additional link libraries when compiling. -This library file only works with Python 1.4. A version +This library file only works with Python 1.4. A version compatible with Python 1.3 is available as embed13.i. As far as I know, this module is C++ safe (well, it works for me). %} @@ -60,7 +60,7 @@ extern "C" { /* Now define our own version of it. Hopefully someone does not have more than 1000 built-in modules */ -struct _inittab inittab[1000]; +struct _inittab inittab[1000]; static int swig_num_modules = 0; @@ -73,7 +73,7 @@ static void swig_add_module(char *name, void (*initfunc)()) { swig_num_modules++; inittab[swig_num_modules].name = (char *) 0; inittab[swig_num_modules].initfunc = 0; -} +} /* Function to add all of Python's build in modules to our interpreter */ @@ -84,7 +84,7 @@ static void swig_add_builtin() { i++; } #ifdef SWIGMODINIT - SWIGMODINIT + SWIGMODINIT #endif /* Add SWIG builtin function */ swig_add_module(SWIG_name, SWIG_init); @@ -195,7 +195,7 @@ main(int argc, char **argv) { strcat(command, "\n"); break; } - + switch (c) { case 'd': @@ -249,7 +249,7 @@ main(int argc, char **argv) { command == NULL && filename == NULL && isatty((int)fileno(fp))) fprintf(stderr, "Python %s\n%s\n", Py_GetVersion(), Py_GetCopyright()); - + if (filename != NULL) { if ((fp = fopen(filename, "r")) == NULL) { fprintf(stderr, "%s: can't open file '%s'\n", @@ -257,7 +257,7 @@ main(int argc, char **argv) { exit(2); } } - + Py_Initialize(); if (command != NULL) { /* Backup optind and force sys.argv[0] = '-c' */ @@ -336,7 +336,3 @@ extern "C" { #endif %} - - - - diff --git a/SWIG/swig_lib/python/embed13.i b/SWIG/swig_lib/python/embed13.i index 38f6a0757..e080a2117 100644 --- a/SWIG/swig_lib/python/embed13.i +++ b/SWIG/swig_lib/python/embed13.i @@ -58,7 +58,7 @@ extern "C" { /* Now define our own version of it. God forbid someone have more than 1000 built-in modules! */ -SWIGPyTab inittab[1000]; +SWIGPyTab inittab[1000]; static int swig_num_modules = 0; @@ -70,7 +70,7 @@ static void swig_add_module(char *name, void (*initfunc)()) { swig_num_modules++; inittab[swig_num_modules].name = (char *) 0; inittab[swig_num_modules].initfunc = (void (*)()) 0; -} +} /* Function to add all of Python's build in modules to our interpreter */ @@ -80,7 +80,7 @@ static void swig_add_builtin() { swig_add_module(python_inittab[i].name, python_inittab[i].initfunc); i++; } - + /* Add SWIG builtin function */ swig_add_module(SWIG_name, SWIG_init); #ifdef SWIGMODINIT @@ -193,7 +193,7 @@ main(int argc, char **argv) { strcat(command, "\n"); break; } - + switch (c) { case 'd': @@ -247,7 +247,7 @@ main(int argc, char **argv) { command == NULL && filename == NULL && isatty((int)fileno(fp))) fprintf(stderr, "Python %s\n%s\n", getversion(), getcopyright()); - + if (filename != NULL) { if ((fp = fopen(filename, "r")) == NULL) { fprintf(stderr, "%s: can't open file '%s'\n", @@ -255,7 +255,7 @@ main(int argc, char **argv) { exit(2); } } - + Py_Initialize(); if (command != NULL) { /* Backup optind and force sys.argv[0] = '-c' */ @@ -334,6 +334,3 @@ extern "C" { #endif %} - - - diff --git a/SWIG/swig_lib/python/embed14.i b/SWIG/swig_lib/python/embed14.i index d911caf47..b5557373e 100644 --- a/SWIG/swig_lib/python/embed14.i +++ b/SWIG/swig_lib/python/embed14.i @@ -24,7 +24,7 @@ present in your current Python executable (including any special purpose modules you have enabled such as tkinter). Thus, you may need to provide additional link libraries when compiling. -This library file only works with Python 1.4. A version +This library file only works with Python 1.4. A version compatible with Python 1.3 is available as embed13.i. As far as I know, this module is C++ safe (well, it works for me). %} @@ -60,7 +60,7 @@ extern "C" { /* Now define our own version of it. Hopefully someone does not have more than 1000 built-in modules */ -struct _inittab inittab[1000]; +struct _inittab inittab[1000]; static int swig_num_modules = 0; @@ -73,7 +73,7 @@ static void swig_add_module(char *name, void (*initfunc)()) { swig_num_modules++; inittab[swig_num_modules].name = (char *) 0; inittab[swig_num_modules].initfunc = 0; -} +} /* Function to add all of Python's build in modules to our interpreter */ @@ -84,7 +84,7 @@ static void swig_add_builtin() { i++; } #ifdef SWIGMODINIT - SWIGMODINIT + SWIGMODINIT #endif /* Add SWIG builtin function */ swig_add_module(SWIG_name, SWIG_init); @@ -195,7 +195,7 @@ main(int argc, char **argv) { strcat(command, "\n"); break; } - + switch (c) { case 'd': @@ -249,7 +249,7 @@ main(int argc, char **argv) { command == NULL && filename == NULL && isatty((int)fileno(fp))) fprintf(stderr, "Python %s\n%s\n", Py_GetVersion(), Py_GetCopyright()); - + if (filename != NULL) { if ((fp = fopen(filename, "r")) == NULL) { fprintf(stderr, "%s: can't open file '%s'\n", @@ -257,7 +257,7 @@ main(int argc, char **argv) { exit(2); } } - + Py_Initialize(); if (command != NULL) { /* Backup optind and force sys.argv[0] = '-c' */ @@ -336,7 +336,3 @@ extern "C" { #endif %} - - - - diff --git a/SWIG/swig_lib/python/ptrlang.i b/SWIG/swig_lib/python/ptrlang.i index 40a941704..f9480657e 100644 --- a/SWIG/swig_lib/python/ptrlang.i +++ b/SWIG/swig_lib/python/ptrlang.i @@ -1,6 +1,6 @@ // // SWIG pointer conversion and utility library -// +// // Dave Beazley // April 19, 1997 // @@ -20,7 +20,7 @@ ptrcast(0,"Vector *") or - ptrcast(0,"Vector_p") + ptrcast(0,"Vector_p") ------------------------------------------------------------------ */ static PyObject *ptrcast(PyObject *_PTRVALUE, char *type) { @@ -33,9 +33,9 @@ static PyObject *ptrcast(PyObject *_PTRVALUE, char *type) { /* Produce a "mangled" version of the type string. */ typestr = (char *) malloc(strlen(type)+2); - + /* Go through and munge the typestring */ - + r = typestr; *(r++) = '_'; c = type; @@ -53,7 +53,7 @@ static PyObject *ptrcast(PyObject *_PTRVALUE, char *type) { *(r++) = 0; /* Check to see what kind of object _PTRVALUE is */ - + if (PyLong_Check(_PTRVALUE)) { ptr = (void *) PyLong_AsLong(_PTRVALUE); /* Received a numerical value. Make a pointer out of it */ @@ -70,7 +70,7 @@ static PyObject *ptrcast(PyObject *_PTRVALUE, char *type) { value */ s = PyBytes_AsString(_PTRVALUE); r = (char *) malloc(strlen(type)+22); - + /* Now extract the pointer value */ if (!SWIG_GetPtr(s,&ptr,0)) { if (ptr) { @@ -87,7 +87,7 @@ static PyObject *ptrcast(PyObject *_PTRVALUE, char *type) { obj = NULL; } free(typestr); - if (!obj) + if (!obj) PyErr_SetString(PyExc_TypeError,"Type error in ptrcast. Argument is not a valid pointer value."); return obj; } @@ -95,10 +95,10 @@ static PyObject *ptrcast(PyObject *_PTRVALUE, char *type) { /*------------------------------------------------------------------ ptrvalue(ptr,type = 0) - Attempts to dereference a pointer value. If type is given, it + Attempts to dereference a pointer value. If type is given, it will try to use that type. Otherwise, this function will attempt - to "guess" the proper datatype by checking against all of the - builtin C datatypes. + to "guess" the proper datatype by checking against all of the + builtin C datatypes. ------------------------------------------------------------------ */ static PyObject *ptrvalue(PyObject *_PTRVALUE, int index, char *type) { @@ -208,15 +208,15 @@ static PyObject *ptrcreate(char *type, PyObject *_PYVALUE, int numelements) { sz = sizeof(char *)*(numelements+1); cast = "_char_pp"; } else { - PyErr_SetString(PyExc_TypeError,"Unable to create unknown datatype."); + PyErr_SetString(PyExc_TypeError,"Unable to create unknown datatype."); return NULL; } - + /* Create the new object */ - + ptr = (void *) malloc(sz); if (!ptr) { - PyErr_SetString(PyExc_MemoryError,"Out of memory in swig_create."); + PyErr_SetString(PyExc_MemoryError,"Out of memory in swig_create."); return NULL; } @@ -277,9 +277,9 @@ static PyObject *ptrcreate(char *type, PyObject *_PYVALUE, int numelements) { } ip[numelements] = 0; } - } + } /* Create the pointer value */ - + SWIG_MakePtr(temp,ptr,cast); obj = PyBytes_FromString(temp); return obj; @@ -337,7 +337,7 @@ static PyObject *ptrset(PyObject *_PTRVALUE, PyObject *_PYVALUE, int index, char PyErr_SetString(PyExc_TypeError,"Unable to set NULL pointer."); return NULL; } - + /* Now we have a datatype. Try to figure out what to do about it */ if (strcmp(type,"int") == 0) { *(((int *) ptr)+index) = (int) PyLong_AsLong(_PYVALUE); @@ -386,7 +386,7 @@ static PyObject *ptradd(PyObject *_PTRVALUE, int offset) { char *type; /* Check to see what kind of object _PTRVALUE is */ - + if (PyBytes_Check(_PTRVALUE)) { /* Have a potential pointer value now. Try to strip out the value */ s = PyBytes_AsString(_PTRVALUE); @@ -437,9 +437,9 @@ static void ptrmap(char *type1, char *type2) { /* Produce a "mangled" version of the type string. */ typestr1 = (char *) malloc(strlen(type1)+2); - + /* Go through and munge the typestring */ - + r = typestr1; *(r++) = '_'; c = type1; @@ -455,11 +455,11 @@ static void ptrmap(char *type1, char *type2) { c++; } *(r++) = 0; - + typestr2 = (char *) malloc(strlen(type2)+2); /* Go through and munge the typestring */ - + r = typestr2; *(r++) = '_'; c = type2; @@ -509,7 +509,7 @@ PyObject *ptrfree(PyObject *_PTRVALUE) { i++; } } - } + } if (ptr) free((char *) ptr); @@ -527,7 +527,7 @@ PyObject *ptrfree(PyObject *_PTRVALUE) { PyObject *ptrcreate, PyObject *ptrset, PyObject *ptradd, - PyObject *ptrfree + PyObject *ptrfree { $target = $source; } @@ -536,11 +536,11 @@ PyObject *ptrfree(PyObject *_PTRVALUE) { if ($source == -1) return NULL; } -PyObject *ptrcast(PyObject *ptr, char *type); +PyObject *ptrcast(PyObject *ptr, char *type); // Casts a pointer ptr to a new datatype given by the string type. // type may be either the SWIG generated representation of a datatype // or the C representation. For example : -// +// // ptrcast(ptr,"double_p"); # Python representation // ptrcast(ptr,"double *"); # C representation // @@ -576,13 +576,13 @@ PyObject *ptrset(PyObject *ptr, PyObject *value, int index = 0, char *type = 0); // integers, floats, doubles, etc... The index and type fields are // optional. When an index is given, it provides array access. When // type is specified, it overrides the given pointer type. Examples : -// +// // ptrset(a,3) # Sets the value *a = 3 // ptrset(a,3,10) # Sets a[10] = 3 // ptrset(a,3,10,"int") # Sets a[10] = 3 assuming a is a int * PyObject *ptrcreate(char *type, PyObject *value = 0, int nitems = 1); -// Creates a new object and returns a pointer to it. This function +// Creates a new object and returns a pointer to it. This function // can be used to create various kinds of objects for use in C functions. // type specifies the basic C datatype to create and value is an // optional parameter that can be used to set the initial value of the @@ -625,10 +625,10 @@ PyObject *ptradd(PyObject *ptr, int offset); // b = ptradd(b,1); # b++ (go to next double) // // In this case, adding one to b goes to the next double. -// +// // For all other datatypes (including all complex datatypes), the // offset corresponds to bytes. This function does not perform any -// bounds checking and negative offsets are perfectly legal. +// bounds checking and negative offsets are perfectly legal. void ptrmap(char *type1, char *type2); // This is a rarely used function that performs essentially the same @@ -646,7 +646,3 @@ void ptrmap(char *type1, char *type2); // Normally this function is not needed, but it can be used to // circumvent SWIG's normal type-checking behavior or to work around // weird type-handling problems. - - - - diff --git a/SWIG/swig_lib/python/pyexp.swg b/SWIG/swig_lib/python/pyexp.swg index e50b0febe..d24e3a669 100644 --- a/SWIG/swig_lib/python/pyexp.swg +++ b/SWIG/swig_lib/python/pyexp.swg @@ -25,4 +25,3 @@ extern PyObject *SWIG_newvarlink(void); #ifdef __cplusplus } #endif - diff --git a/SWIG/swig_lib/python/python.swg b/SWIG/swig_lib/python/python.swg index 804365fd0..9617b81f7 100644 --- a/SWIG/swig_lib/python/python.swg +++ b/SWIG/swig_lib/python/python.swg @@ -97,7 +97,7 @@ swig_varlink_print(swig_varlinkobject *v, FILE *fp, int flags) /* -------------------------------------------------------------------- swig_varlink_getattr - + This function gets the value of a variable and returns it as a PyObject. In our case, we'll be looking at the datatype and converting into a number or string @@ -144,17 +144,17 @@ swig_varlink_setattr(swig_varlinkobject *v, char *n, PyObject *p) statichere PyTypeObject varlinktype = { /* PyObject_HEAD_INIT(&PyType_Type) Note : This doesn't work on some machines */ - PyObject_HEAD_INIT(0) + PyObject_HEAD_INIT(0) 0, "varlink", /* Type name */ sizeof(swig_varlinkobject), /* Basic size */ 0, /* Itemsize */ - 0, /* Deallocator */ + 0, /* Deallocator */ (printfunc) swig_varlink_print, /* Print */ (getattrfunc) swig_varlink_getattr, /* get attr */ (setattrfunc) swig_varlink_setattr, /* Set attr */ 0, /* tp_compare */ - (reprfunc) swig_varlink_repr, /* tp_repr */ + (reprfunc) swig_varlink_repr, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_mapping*/ 0, /* tp_hash */ @@ -184,7 +184,7 @@ SWIG_addvarlink(PyObject *p, char *name, { swig_varlinkobject *v; v= (swig_varlinkobject *) p; - + if (v->nvars >= v->maxvars -1) { v->maxvars = 2*v->maxvars; v->vars = (swig_globalvar **) realloc(v->vars,v->maxvars*sizeof(swig_globalvar *)); diff --git a/SWIG/swig_lib/python/pywintypes.i b/SWIG/swig_lib/python/pywintypes.i index 17afe2127..4ebeca825 100644 --- a/SWIG/swig_lib/python/pywintypes.i +++ b/SWIG/swig_lib/python/pywintypes.i @@ -1,4 +1,4 @@ -/* File : pywin32.i +/* File : pywin32.i The start of an interface file for SWIG and the Win32 Python extensions. @@ -594,4 +594,3 @@ typedef float HWND; PyDict_SetItemString(d, "error", PyWinExc_ApiError); #endif SWIG_PYTHONCOM %} - diff --git a/SWIG/swig_lib/python/typemaps.i b/SWIG/swig_lib/python/typemaps.i index 53adc2851..8ef6da60f 100644 --- a/SWIG/swig_lib/python/typemaps.i +++ b/SWIG/swig_lib/python/typemaps.i @@ -52,7 +52,7 @@ you would use a real value instead. unsigned char *INPUT float *INPUT double *INPUT - + To use these, suppose you had a C function like this : double fadd(double *a, double *b) { @@ -60,7 +60,7 @@ To use these, suppose you had a C function like this : } You could wrap it with SWIG as follows : - + %include typemaps.i double fadd(double *INPUT, double *INPUT); @@ -122,7 +122,7 @@ or you can use the %apply directive : temp = (unsigned char) PyLong_AsLong($source); $target = &temp; } - + // OUTPUT typemaps. These typemaps are used for parameters that // are output only. The output value is appended to the result as // a list element. @@ -145,7 +145,7 @@ multiple output values, they are returned in the form of a Python list. unsigned char *OUTPUT float *OUTPUT double *OUTPUT - + A Python Tuple can also be replaced by using T_OUTPUT instead of OUTPUT. For example, suppose you were trying to wrap the modf() function in the @@ -166,7 +166,7 @@ or you can use the %apply directive : double modf(double x, double *ip); The Python output of the function would be a list containing both -output values. +output values. %} #endif @@ -248,23 +248,23 @@ static PyObject* t_output_helper(PyObject* target, PyObject* o) { PyObject* o2; PyObject* o3; - if (!target) { + if (!target) { target = o; - } else if (target == Py_None) { + } else if (target == Py_None) { Py_DECREF(Py_None); target = o; - } else { - if (!PyTuple_Check(target)) { + } else { + if (!PyTuple_Check(target)) { o2 = target; target = PyTuple_New(1); PyTuple_SetItem(target, 0, o2); } - o3 = PyTuple_New(1); - PyTuple_SetItem(o3, 0, o); + o3 = PyTuple_New(1); + PyTuple_SetItem(o3, 0, o); o2 = target; - target = PySequence_Concat(o2, o3); - Py_DECREF(o2); + target = PySequence_Concat(o2, o3); + Py_DECREF(o2); Py_DECREF(o3); } return target; @@ -330,7 +330,7 @@ using T_BOTH instead. unsigned char *BOTH float *BOTH double *BOTH - + For example, suppose you were trying to wrap the following function : void neg(double *x) { @@ -438,4 +438,3 @@ PyObject * %typemap(python,out) PyObject * { $target = $source; } - diff --git a/SWIG/swig_lib/stdlib.i b/SWIG/swig_lib/stdlib.i index e63c9a884..0806c5400 100644 --- a/SWIG/swig_lib/stdlib.i +++ b/SWIG/swig_lib/stdlib.i @@ -34,4 +34,3 @@ int system(const char *s); char *getenv(const char *name); int abs(int n); long labs(long n); - diff --git a/SWIG/swig_lib/swigptr.swg b/SWIG/swig_lib/swigptr.swg index 286f5b116..d26456dbf 100644 --- a/SWIG/swig_lib/swigptr.swg +++ b/SWIG/swig_lib/swigptr.swg @@ -13,9 +13,9 @@ * original datatype and newtype is an equivalent type. cast is optional * pointer to a function to cast pointer values between types (this * is typically used to cast pointers from derived classes to base classes in C++) - * + * * SWIG_MakePtr(char *buffer, void *ptr, char *typestring); - * + * * Makes a pointer string from a pointer and typestring. The result is returned * in buffer which is assumed to hold enough space for the result. * @@ -81,7 +81,7 @@ static SwigPtrType *SwigPtrTable = 0; /* Table containing pointer equivalences #define SWIG_CACHESIZE 8 #define SWIG_CACHEMASK 0x7 -static SwigCacheType SwigCache[SWIG_CACHESIZE]; +static SwigCacheType SwigCache[SWIG_CACHESIZE]; static int SwigCacheIndex = 0; static int SwigLastCache = 0; @@ -101,7 +101,7 @@ static int swigcmp(const void *key, const void *data) { /* Register a new datatype with the type-checker */ -SWIGSTATIC +SWIGSTATIC void SWIG_RegisterMapping(char *origtype, char *newtype, void *(*cast)(void *)) { int i; @@ -109,7 +109,7 @@ void SWIG_RegisterMapping(char *origtype, char *newtype, void *(*cast)(void *)) /* Allocate the pointer table if necessary */ - if (!SwigPtrTable) { + if (!SwigPtrTable) { SwigPtrTable = (SwigPtrType *) malloc(SwigPtrMax*sizeof(SwigPtrType)); SwigPtrN = 0; } @@ -141,21 +141,21 @@ void SWIG_RegisterMapping(char *origtype, char *newtype, void *(*cast)(void *)) } t = t->next; } - + /* Now place entry (in sorted order) */ t1 = (SwigPtrType *) malloc(sizeof(SwigPtrType)); t1->name = newtype; t1->len = strlen(t1->name); t1->cast = cast; - t1->next = 0; - t->next = t1; + t1->next = 0; + t->next = t1; SwigPtrSort = 0; } /* Make a pointer value string */ -SWIGSTATIC +SWIGSTATIC void SWIG_MakePtr(char *_c, const void *_ptr, char *type) { static char _hex[16] = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', @@ -182,11 +182,11 @@ void SWIG_MakePtr(char *_c, const void *_ptr, char *type) { /* Define for backwards compatibility */ -#define _swig_make_hex SWIG_MakePtr +#define _swig_make_hex SWIG_MakePtr /* Function for getting a pointer value */ -SWIGSTATIC +SWIGSTATIC char *SWIG_GetPtr(char *_c, void **ptr, char *_t) { unsigned long _p; @@ -213,9 +213,9 @@ char *SWIG_GetPtr(char *_c, void **ptr, char *_t) } if (_t) { - if (strcmp(_t,_c)) { + if (strcmp(_t,_c)) { if (!SwigPtrSort) { - qsort((void *) SwigPtrTable, SwigPtrN, sizeof(SwigPtrType), swigsort); + qsort((void *) SwigPtrTable, SwigPtrN, sizeof(SwigPtrType), swigsort); for (i = 0; i < 256; i++) { SwigStart[i] = SwigPtrN; } @@ -227,10 +227,10 @@ char *SWIG_GetPtr(char *_c, void **ptr, char *_t) SwigStart[i-1] = SwigStart[i]; } SwigPtrSort = 1; - for (i = 0; i < SWIG_CACHESIZE; i++) + for (i = 0; i < SWIG_CACHESIZE; i++) SwigCache[i].stat = 0; } - + /* First check cache for matches. Uses last cache value as starting point */ cache = &SwigCache[SwigLastCache]; for (i = 0; i < SWIG_CACHESIZE; i++) { @@ -274,13 +274,13 @@ char *SWIG_GetPtr(char *_c, void **ptr, char *_t) strncpy(temp_type,tp->name,255); strncat(temp_type,_t+len,255-tp->len); if (strcmp(_c,temp_type) == 0) { - + strcpy(SwigCache[SwigCacheIndex].mapped,_c); strcpy(SwigCache[SwigCacheIndex].name,_t); SwigCache[SwigCacheIndex].stat = 1; SwigCache[SwigCacheIndex].tp = tp; SwigCacheIndex = SwigCacheIndex & SWIG_CACHEMASK; - + /* Get pointer value */ *ptr = (void *) _p; if (tp->cast) *ptr = (*(tp->cast))(*ptr); @@ -292,7 +292,7 @@ char *SWIG_GetPtr(char *_c, void **ptr, char *_t) /* Hmmm. Didn't find it this time */ } } - /* Didn't find any sort of match for this data. + /* Didn't find any sort of match for this data. Get the pointer value and return the received type */ *ptr = (void *) _p; return _c; @@ -311,7 +311,7 @@ char *SWIG_GetPtr(char *_c, void **ptr, char *_t) *ptr = (void *) 0; return (char *) 0; } - *ptr = (void *) 0; + *ptr = (void *) 0; return _c; } } diff --git a/SWIG/swig_lib/timers.i b/SWIG/swig_lib/timers.i index 1d90e699d..17b75d15d 100644 --- a/SWIG/swig_lib/timers.i +++ b/SWIG/swig_lib/timers.i @@ -2,14 +2,14 @@ // $Header$ // // timers.i -// A SWIG file for adding various timing functions. +// A SWIG file for adding various timing functions. // Really, this is modeled after the timers in the CMMD // message passing library for the CM-5. -// +// // Dave Beazley // April 2, 1996 // -/* Revision history +/* Revision history * $Log$ * Revision 1.1 1996/05/22 17:27:01 beazley * Initial revision @@ -95,7 +95,7 @@ SWIG_timer_elapsed(int i) %include timers.i This module provides a collection of timing functions designed for -performance analysis and benchmarking of different code fragments. +performance analysis and benchmarking of different code fragments. A total of 64 different timers are available. Each timer can be managed independently using four functions : @@ -135,7 +135,7 @@ performance. To use a timer, simply use code like this : ... a bunch of Python code ... timer_stop(0) print(timer_elapsed(0), " seconds of CPU time") -%} +%} #endif %text %{ @@ -150,18 +150,14 @@ computationally intensive operations. %} -%name(timer_clear) void SWIG_timer_clear(int n); +%name(timer_clear) void SWIG_timer_clear(int n); /* Clears timer n. */ -%name(timer_start) void SWIG_timer_start(int n); +%name(timer_start) void SWIG_timer_start(int n); /* Starts timer n. */ -%name(timer_stop) void SWIG_timer_stop(int n); +%name(timer_stop) void SWIG_timer_stop(int n); /* Stops timer n. */ -%name(timer_elapsed) double SWIG_timer_elapsed(int n); +%name(timer_elapsed) double SWIG_timer_elapsed(int n); /* Return the elapsed time (in seconds) of timer n */ - - - - diff --git a/adodbapi/license.txt b/adodbapi/license.txt index c255f4aae..630791e66 100644 --- a/adodbapi/license.txt +++ b/adodbapi/license.txt @@ -150,7 +150,7 @@ such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. - + 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an @@ -503,4 +503,3 @@ necessary. Here is a sample; alter the names: Ty Coon, President of Vice That's all there is to it! - diff --git a/adodbapi/quick_reference.md b/adodbapi/quick_reference.md index 436ff0318..67ab2bfc8 100644 --- a/adodbapi/quick_reference.md +++ b/adodbapi/quick_reference.md @@ -146,12 +146,12 @@ Usually, life is not so simple \... ```python -import adodbapi +import adodbapi myhost = r".\SQLEXPRESS" mydatabase = "Northwind" myuser = "guest" mypassword = "12345678" -connStr = """Provider=SQLOLEDB.1; User ID=%s; Password=%s; +connStr = """Provider=SQLOLEDB.1; User ID=%s; Password=%s; Initial Catalog=%s;Data Source= %s""" myConnStr = connStr % (myuser, mypassword, mydatabase, myhost) myConn = adodbapi.connect(myConnStr) @@ -259,7 +259,7 @@ conn_keys['connection_string'] = "Provider=%(provider)s; ... and ... more ... st ``` - macro "getuser": Retrieve the proxy server logged-in-user's username - + My systems administrator gave me a test database named after myself. I thought it would be handy to let others do a similar thing. so: @@ -613,7 +613,7 @@ The other paramstyle possibility mentioned in the PEP is: (If you want it, patches will be considered.): ```sql -UPDATE cheese SET qtyonhand = :1 WHERE name = :2 +UPDATE cheese SET qtyonhand = :1 WHERE name = :2 ``` ((Gurus: Start reading again here)) diff --git a/adodbapi/readme.txt b/adodbapi/readme.txt index 9044d7a8f..b5798677b 100644 --- a/adodbapi/readme.txt +++ b/adodbapi/readme.txt @@ -2,16 +2,16 @@ Project ------- adodbapi -A Python DB-API 2.0 (PEP-249) module that makes it easy to use Microsoft ADO +A Python DB-API 2.0 (PEP-249) module that makes it easy to use Microsoft ADO for connecting with databases and other data sources using CPython. Home page: Features: * 100% DB-API 2.0 (PEP-249) compliant (including most extensions and recommendations). -* Includes pyunit testcases that describe how to use the module. +* Includes pyunit testcases that describe how to use the module. * Fully implemented in Python. -- runs in current versions of Python 3 -* Licensed under the LGPL license, which means that it can be used freely even in commercial programs subject to certain restrictions. +* Licensed under the LGPL license, which means that it can be used freely even in commercial programs subject to certain restrictions. * The user can choose between paramstyles: 'qmark' 'named' 'format' 'pyformat' 'dynamic' * Supports data retrieval by column name e.g.: for row in myCurser.execute("select name,age from students"): @@ -28,7 +28,7 @@ Installation: NOTE: ........... If you do not like the new default operation of returning Numeric columns as decimal.Decimal, -you can select other options by the user defined conversion feature. +you can select other options by the user defined conversion feature. Try: adodbapi.apibase.variantConversions[adodbapi.ado_consts.adNumeric] = adodbapi.apibase.cvtString or: @@ -81,7 +81,7 @@ and look at the test cases in adodbapi/test directory. Mailing lists ------------- -The adodbapi mailing lists have been deactivated. Submit comments to the +The adodbapi mailing lists have been deactivated. Submit comments to the pywin32 mailing lists. -- the bug tracker on sourceforge.net/projects/adodbapi may be checked, (infrequently). -- please use: https://github.com/mhammond/pywin32/issues diff --git a/com/License.txt b/com/License.txt index 6c1884e9b..5528d085a 100644 --- a/com/License.txt +++ b/com/License.txt @@ -2,20 +2,20 @@ Unless stated in the specfic source file, this work is Copyright (c) 1996-2008, Greg Stein and Mark Hammond. All rights reserved. -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: -Redistributions of source code must retain the above copyright notice, +Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. -Redistributions in binary form must reproduce the above copyright -notice, this list of conditions and the following disclaimer in +Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. -Neither names of Greg Stein, Mark Hammond nor the name of contributors may be used -to endorse or promote products derived from this software without -specific prior written permission. +Neither names of Greg Stein, Mark Hammond nor the name of contributors may be used +to endorse or promote products derived from this software without +specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED @@ -27,4 +27,4 @@ PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/com/TestSources/PyCOMTest/Connect.rc b/com/TestSources/PyCOMTest/Connect.rc index 34ff14a34..eac1e558d 100644 --- a/com/TestSources/PyCOMTest/Connect.rc +++ b/com/TestSources/PyCOMTest/Connect.rc @@ -27,18 +27,18 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US // TEXTINCLUDE // -1 TEXTINCLUDE DISCARDABLE +1 TEXTINCLUDE DISCARDABLE BEGIN "connres.h\0" END -2 TEXTINCLUDE DISCARDABLE +2 TEXTINCLUDE DISCARDABLE BEGIN "#include ""winnt.h""\r\n" "\0" END -3 TEXTINCLUDE DISCARDABLE +3 TEXTINCLUDE DISCARDABLE BEGIN "1 TYPELIB ""PyCOMTest.tlb""\r\n" "\0" @@ -102,7 +102,7 @@ IDR_ARRAYTEST REGISTRY MOVEABLE PURE "ArrayTest.rgs" // String Table // -STRINGTABLE DISCARDABLE +STRINGTABLE DISCARDABLE BEGIN IDS_PYCOMTEST_DESC "PyCOMTest Class" END @@ -121,4 +121,3 @@ END ///////////////////////////////////////////////////////////////////////////// #endif // not APSTUDIO_INVOKED - diff --git a/com/TestSources/PyCOMTest/PyCOMTest.dsp b/com/TestSources/PyCOMTest/PyCOMTest.dsp index 18481ab36..f1b0a930f 100644 --- a/com/TestSources/PyCOMTest/PyCOMTest.dsp +++ b/com/TestSources/PyCOMTest/PyCOMTest.dsp @@ -7,21 +7,21 @@ CFG=PyCOMTest - Win32 Release !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run -!MESSAGE +!MESSAGE !MESSAGE NMAKE /f "PyCOMTest.mak". -!MESSAGE +!MESSAGE !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE +!MESSAGE !MESSAGE NMAKE /f "PyCOMTest.mak" CFG="PyCOMTest - Win32 Release" -!MESSAGE +!MESSAGE !MESSAGE Possible choices for configuration are: -!MESSAGE +!MESSAGE !MESSAGE "PyCOMTest - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") !MESSAGE "PyCOMTest - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") !MESSAGE "PyCOMTest - Win32 Unicode Release" (based on "Win32 (x86) Dynamic-Link Library") !MESSAGE "PyCOMTest - Win32 Unicode Debug" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE +!MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 @@ -64,9 +64,9 @@ InputPath=\src\pywin32\com\TestSources\Build\Release\PyCOMTest.dll SOURCE="$(InputPath)" "$(OutDir)\regsvr32.trg" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - regsvr32 /s /c "$(TargetPath)" - echo regsvr32 exec. time > "$(OutDir)\regsvr32.trg" - + regsvr32 /s /c "$(TargetPath)" + echo regsvr32 exec. time > "$(OutDir)\regsvr32.trg" + # End Custom Build !ELSEIF "$(CFG)" == "PyCOMTest - Win32 Debug" @@ -100,9 +100,9 @@ InputPath=\src\pywin32\com\TestSources\Build\Debug\PyCOMTest.dll SOURCE="$(InputPath)" "$(OutDir)\regsvr32.trg" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - regsvr32 /s /c "$(TargetPath)" - echo regsvr32 exec. time > "$(OutDir)\regsvr32.trg" - + regsvr32 /s /c "$(TargetPath)" + echo regsvr32 exec. time > "$(OutDir)\regsvr32.trg" + # End Custom Build !ELSEIF "$(CFG)" == "PyCOMTest - Win32 Unicode Release" @@ -136,9 +136,9 @@ InputPath=\src\pywin32\com\TestSources\Build\ReleaseU\PyCOMTest.dll SOURCE="$(InputPath)" "$(OutDir)\regsvr32.trg" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - regsvr32 /s /c "$(TargetPath)" - echo regsvr32 exec. time > "$(OutDir)\regsvr32.trg" - + regsvr32 /s /c "$(TargetPath)" + echo regsvr32 exec. time > "$(OutDir)\regsvr32.trg" + # End Custom Build !ELSEIF "$(CFG)" == "PyCOMTest - Win32 Unicode Debug" @@ -172,12 +172,12 @@ InputPath=\src\pywin32\com\TestSources\Build\DebugU\PyCOMTest.dll SOURCE="$(InputPath)" "$(OutDir)\regsvr32.trg" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - regsvr32 /s /c "$(TargetPath)" - echo regsvr32 exec. time > "$(OutDir)\regsvr32.trg" - + regsvr32 /s /c "$(TargetPath)" + echo regsvr32 exec. time > "$(OutDir)\regsvr32.trg" + # End Custom Build -!ENDIF +!ENDIF # Begin Target @@ -297,7 +297,7 @@ BuildCmds= \ $(BuildCmds) # End Custom Build -!ENDIF +!ENDIF # End Source File # Begin Source File diff --git a/com/TestSources/PyCOMTest/PyCOMTest.dsw b/com/TestSources/PyCOMTest/PyCOMTest.dsw index 57030942b..20c9b513f 100644 --- a/com/TestSources/PyCOMTest/PyCOMTest.dsw +++ b/com/TestSources/PyCOMTest/PyCOMTest.dsw @@ -30,4 +30,3 @@ Package=<3> }}} ############################################################################### - diff --git a/com/TestSources/PyCOMTest/PyCOMTest.idl b/com/TestSources/PyCOMTest/PyCOMTest.idl index 78d069825..a006934fb 100644 --- a/com/TestSources/PyCOMTest/PyCOMTest.idl +++ b/com/TestSources/PyCOMTest/PyCOMTest.idl @@ -111,7 +111,7 @@ library PyCOMTestLib [propget, restricted, id(DISPID_NEWENUM), helpstring("returns an enumerator over the steps in the program.")] - HRESULT _NewEnum([out, retval] IUnknown** retval); + HRESULT _NewEnum([out, retval] IUnknown** retval); [propput, helpstring("Sets the lower bound of our collection.")] HRESULT LBound([in] long lbound); @@ -239,19 +239,19 @@ library PyCOMTestLib HRESULT Fire([in]long nId); HRESULT TestOptionals( [in,optional,defaultvalue("def")] BSTR strArg, [in,optional,defaultvalue(0)] short sval, - [in,optional,defaultvalue(1)] long lval, + [in,optional,defaultvalue(1)] long lval, [in,optional,defaultvalue(3.14)] double dval, [out,retval] SAFEARRAY(VARIANT) *pret ); - HRESULT TestOptionals2( - double dval, - [optional, defaultvalue("")] BSTR strval, + HRESULT TestOptionals2( + double dval, + [optional, defaultvalue("")] BSTR strval, [optional, defaultvalue(1)] short sval, [out,retval] SAFEARRAY(VARIANT) *pret ); // Trying (but failing) to find a bug related to SourceSafe's VSSItem's IDL defn. Note // the lack of 'optional' even though a default is specified (which doesn't seem to // have any effect, but seeing we are here...) - HRESULT TestOptionals3( - [in]double dval, + HRESULT TestOptionals3( + [in]double dval, [in, defaultvalue(1)] short sval, [out, retval] IPyCOMTest **ppout ); HRESULT GetStruct([out, retval]TestStruct1 *ret); @@ -402,4 +402,3 @@ library PyCOMTestLib }; }; - diff --git a/com/TestSources/PyCOMVBTest/EnumerableCollection.cls b/com/TestSources/PyCOMVBTest/EnumerableCollection.cls index 909812d67..b9995e036 100644 --- a/com/TestSources/PyCOMVBTest/EnumerableCollection.cls +++ b/com/TestSources/PyCOMVBTest/EnumerableCollection.cls @@ -35,4 +35,3 @@ Public Function NewEnum() As IEnumVARIANT Attribute NewEnum.VB_UserMemId = -4 Set NewEnum = col.[_NewEnum] End Function - diff --git a/com/TestSources/PyCOMVBTest/Tester.cls b/com/TestSources/PyCOMVBTest/Tester.cls index b9249dc02..b21226197 100644 --- a/com/TestSources/PyCOMVBTest/Tester.cls +++ b/com/TestSources/PyCOMVBTest/Tester.cls @@ -200,7 +200,7 @@ Private Sub Class_Initialize() mvarCollectionProperty.Add (1) mvarCollectionProperty.Add ("Two") mvarCollectionProperty.Add ("3") - + mvarStructProperty.int_val = 99 mvarStructProperty.str_val = "hello" mvarStructProperty.sub_val.int_val = 66 @@ -211,7 +211,7 @@ Private Sub Class_Initialize() mvarStructProperty.sub_val.array_val(1).str_val = "one" mvarStructProperty.sub_val.array_val(2).int_val = 2 mvarStructProperty.sub_val.array_val(2).str_val = "two" - + End Sub Public Sub IncrementIntegerParam(intVal As Integer) @@ -251,7 +251,7 @@ Public Sub DoSomeCallbacks(ob As Object) Dim rgv(1) As Variant Dim rg_new As Variant Rem On Error GoTo failed ' Dont really need this - error is correctly propogated back to Python! - + Rem Can check byrefs for gateways here, as VB passes all params byref! i = 99 ret = ob.CallbackResultOneByRef(i) diff --git a/com/changes.txt b/com/changes.txt index f7445f302..5e16e89a9 100644 --- a/com/changes.txt +++ b/com/changes.txt @@ -35,12 +35,12 @@ is now the "official" way to create a Dispatch object. If you have previously imported a makepy generated support file, win32com.client.Dispatch() will correctly return a class from the makepy file. If no support is available, it will return a win32com.client.dynamic.Dispatch() object. -As previously, win32com.client.dynamic.Dispatch() will always return a dynamic object, +As previously, win32com.client.dynamic.Dispatch() will always return a dynamic object, whether makepy support is loaded or not. -* Far less divergence between "makepy" and "dynamic" objects. In the past, it was -often necessary to use a different coding style depending on whether you had makepy -support or not (eg, Excel 7 needed quite different code). In general, this has been +* Far less divergence between "makepy" and "dynamic" objects. In the past, it was +often necessary to use a different coding style depending on whether you had makepy +support or not (eg, Excel 7 needed quite different code). In general, this has been fixed (eg, all MSOffice test run both as dynamic and makepy - the only difference is speed. Note that Office97 can be _very_ slow at startup without makep support loaded. @@ -119,14 +119,14 @@ Dec 1, 96 - Even more changes to makepy/dynamic.py and its infrastructure. Specifically: - * Python COM clients can now call Python COM Servers (ironic problem, + * Python COM clients can now call Python COM Servers (ironic problem, that!:) All clients without type information should work better. * Makepy generated classes, once imported, can share across each other. Eg, the MSACCESS type library references interfaces in the DAO library. This now works totally seamlessly. * Makepy makes some simple detection of enumerators. Notably, DAO and MSACCESS work well - eg "for table in db.TableDefs:" now works as expected. - * Circular reference cleaned up. Previously, (almost) all dynamic.py + * Circular reference cleaned up. Previously, (almost) all dynamic.py created objects were immortal! This has removed most reference counting problems (apart from the standard Python ones, including the "last traceback" one, which does bite here.) @@ -149,4 +149,3 @@ Dec 1, 96 - expanded capabilities from policy.py - pythoncom.CoInitialize and CoUninitialize for threaded COM clients - other fun things - diff --git a/com/help/active_directory.html b/com/help/active_directory.html index 4b93d8b0a..74b79049e 100644 --- a/com/help/active_directory.html +++ b/com/help/active_directory.html @@ -40,7 +40,7 @@

  • User Basics
  • Adding Exchange access
  • - +
  • In Conclusion
  • @@ -52,7 +52,7 @@

    Summary

    -Active Directory combines all sorts of domain-wide information into one spot. +Active Directory combines all sorts of domain-wide information into one spot. Using Microsoft's COM LDAP provider, python has good access to Active Directory.

    @@ -106,16 +106,16 @@

    Discovery

    #get an exchange server ex_admin_grps='CN=Administrative Groups,cn='+ex_site+','+ex_loc+','+ldap_loc admin_grp=win32com.client.GetObject('LDAP://'+ex_admin_grps)[0].cn - + ex_servers='LDAP://CN=Servers,'+'cn='+admin_grp+','+ex_admin_grps servers=win32com.client.GetObject(ex_servers) ex_servers=[] - + for i in servers: ex_servers.append(i.cn) print("\texchange servers"," ".join(ex_servers)) - + ex_first_store='CN=First Storage Group,CN=InformationStore,CN=%s,CN=Servers,CN=%s,%s'%(ex_servers[-1],admin_grp,ex_admin_grps) ex_stores=[] @@ -147,7 +147,7 @@

    Making the object

    def opends(loc,server=''): '''automatically buoild ldap string and authenticate ldap=win32com.client.Dispatch('ADsNameSpaces').getobject("","LDAP:") - ldap_main_loc='OU=people,DC=ad,DC=company,DC=state,DC=oh,DC=us' + ldap_main_loc='OU=people,DC=ad,DC=company,DC=state,DC=oh,DC=us' ldap_auth='CN=admin_account,'+ldap_main_loc #if there is no "," then they are not providing a full url @@ -157,7 +157,7 @@

    Making the object

    if loc.find('=')==-1: loc='cn='+loc+','+Ad.ldap_main_loc else: loc=loc+','+Ad.ldap_main_loc if loc.find('LDAP://')==-1: loc='LDAP://'+loc - + return ldap.OpenDSObject(loc,Ad.ldap_auth,Ad.pw,1) @@ -182,7 +182,7 @@

    What does the object have?


    A lot of things convert to automatic python data types. For others, you'll get stuff like -COMObject. You need to do specific processing, like the one done for +COMObject. You need to do specific processing, like the one done for pwdLastSet below, to extract data from them. @@ -216,9 +216,9 @@

    What does the object have?

    value=getattr(adobj,i) if i == 'pwdLastSet': #convert com object to sec since 1970 - attr_dict[i]=conv_time(adobj.pwdLastSet.lowpart,adobj.pwdLastSet.highpart) + attr_dict[i]=conv_time(adobj.pwdLastSet.lowpart,adobj.pwdLastSet.highpart) elif value: attr_dict[i]=value - + else: attr_dict={} #only get data that is available @@ -226,7 +226,7 @@

    What does the object have?

    try: if item == 'pwdLastSet': #convert com object to sec since 1970 - attr_dict[item]=conv_time(adobj.pwdLastSet.lowpart,adobj.pwdLastSet.highpart) + attr_dict[item]=conv_time(adobj.pwdLastSet.lowpart,adobj.pwdLastSet.highpart) else: attr_dict[item]=getattr(adobj,item) except: pass @@ -234,7 +234,7 @@

    What does the object have?

    -

    The time property

    +

    The time property

    Time in active directory is stored in a 64 bit integer that keeps track of the number of 100-nanosecond intervals which have passed @@ -258,7 +258,7 @@

    The time property

    #two 32 bits stored in the structure. d=116444736000000000L #diference between 1601 and 1970 #we divide by 10million to convert to seconds - return (((long(h)<< 32) + long(l))-d)/10000000 + return (((long(h)<< 32) + long(l))-d)/10000000
    @@ -280,8 +280,8 @@

    Further Info


    Author

    -John Nielsen, jn@who.net -
    -- Have a great time with programming with python! +John Nielsen, jn@who.net +
    -- Have a great time with programming with python!

     

    diff --git a/com/help/adsi.html b/com/help/adsi.html index d97b0d683..83ba3754b 100644 --- a/com/help/adsi.html +++ b/com/help/adsi.html @@ -69,7 +69,7 @@

    Introduction

    -
    Now you have to decide how you want to access the exchange server. +
    Now you have to decide how you want to access the exchange server.
    I have chosen to authenticate, in which case you need to use OpenDSObject() @@ -89,8 +89,8 @@

    Introduction


    -Note -- the fourth argument to opendsobject has various options for how to authenticate. -For example, if you use 1 instead of zero, it should either use NTLM or Kerberos for authentication. +Note -- the fourth argument to opendsobject has various options for how to authenticate. +For example, if you use 1 instead of zero, it should either use NTLM or Kerberos for authentication. For more information, check out: OpenDSObject

    @@ -158,7 +158,7 @@

    Getting/Modify user info

    myDSObject.Setinfo() Comments - + Note -- To make any changes permanent setinfo is required. @@ -271,8 +271,8 @@

    Further Info


    Author

    -John Nielsen, jn@who.net -
    -- Have a great time with programming with python! +John Nielsen, jn@who.net +
    -- Have a great time with programming with python!

     

    diff --git a/com/help/asp.d b/com/help/asp.d index 5368c9b2f..9cae2321b 100644 --- a/com/help/asp.d +++ b/com/help/asp.d @@ -13,7 +13,7 @@ C:\Program Files\Python\win32com\HTML\index.html at the bottom of the page you'll see 'Active X Scripting Demos'. If you then click on that it will describe how to register the engire. Essentially, there is a program called pyscript.py in: -C:\Program Files\Python\win32comext\axscript\client +C:\Program Files\Python\win32comext\axscript\client and if you run that it should register python for the ASP environment. Microsoft typically positions vbscript in the IIS role. Vbscript @@ -53,14 +53,14 @@ w/HTML. An very basic page would look like:

    Querying database

    <% #do some python stuff here -#import libraries, etc. +#import libraries, etc. for i in query_database(): Response.Write('output of results converted to a string') %> - + @ex If you use HTMLgen's template, then it could look like:| <%@ LANGUAGE = Python%> @@ -73,17 +73,17 @@ for i in query_database(): #text {mid} in the template is substituted for results. import HTMLgen -import HTMLcolors +import HTMLcolors results='

    Querying database

    ' for i in query_database(): results=results+str(i) ###################### -#Here we are using a template dictionary +#Here we are using a template dictionary #to substitute the text {mid} found in the template file #for results -T=HTMLgen.TemplateDocument(/path/template_file.html) +T=HTMLgen.TemplateDocument(/path/template_file.html) T.substitutions['mid']=results # here is where our results went!! webpage=str(T) Response.Write(webpage) @@ -156,7 +156,7 @@ def getdata (keys=''): else: return value #if they provide a list then return a dictionary with all the key/values - elif key_type == types.TupleType or key_type == types.ListType: + elif key_type == types.TupleType or key_type == types.ListType: for key in keys: value=Request.Form(key) #now check if the data was empty, if so look at QueryString @@ -167,20 +167,20 @@ def getdata (keys=''): @ex To print out this data you will need to use the Response object which accepts python strings. A simple: Response.Write(str(d_data)) -would suffice. A better looking way would be to do something like: +would suffice. A better looking way would be to do something like: | for pair in d_data.items(): Response.Write(pair[0]+':'+pair[1]+'
    ') @ex Notice the adding of \ to have a line break for each pair. If you -want it more fancy you can convert it to table output. +want it more fancy you can convert it to table output. HTMLgen can help with it's Table object:| Table=HTMLgen.Table('Key/Value pairs for Response object') #title -Table.heading=('Key','Value') -for pair in d_data.items() #get each key/val pair - Table.body.append(list(pair)) #takes a list of lists +Table.heading=('Key','Value') +for pair in d_data.items() #get each key/val pair + Table.body.append(list(pair)) #takes a list of lists #[ [key1,val1], [key2,val2]] #one pair for every table row Response.Write(str(Table)) @@ -202,7 +202,7 @@ from HTMLcolors import * d_env=getenv() #get environment variables #create a simple default document -webpage = SimpleDocument(title = 'Bedrock Housing') +webpage = SimpleDocument(title = 'Bedrock Housing') #create form and append elements to it F=Form(d_env['URL']) @@ -227,8 +227,7 @@ webpage.append(str(results)) Response.Write(str(webpage)) @ex Have a great time with programming with python! -|John Nielsen nielsenjf@my-deja.com +|John Nielsen nielsenjf@my-deja.com */ - diff --git a/com/help/cpp.d b/com/help/cpp.d index 101264e46..29d7e1db9 100644 --- a/com/help/cpp.d +++ b/com/help/cpp.d @@ -20,7 +20,7 @@ python and C++. //C++ interfaces class IFlintstone { -public: +public: virtual TellWilma(long when)=0; }; @@ -85,7 +85,7 @@ class BedRock : public IFlintstone, public IRubble { LONG m_references; public: - BedRock() : m_references(0){ } // constructor + BedRock() : m_references(0){ } // constructor ~BedRock(void) { } //destructor // IUnknown Methods not shown in their entirety @@ -144,7 +144,7 @@ class BedRock(IFlintstone, IRubble): #no need to use MIDL for these _reg_progid_ = "Python.Bedrock" _reg_clsid_ = "{12345678-1234-5678-1234-567812345678}" def __init__(self): #constructur - pass #not doing anthing w/it + pass #not doing anthing w/it #no need to keep track of reference counts def __del__(self): #destructor pass #not much going on here either @@ -158,7 +158,7 @@ if __name__=='__main__': @ex Have a great time with programming with python! -|John Nielsen nielsenjf@my-deja.com +|John Nielsen nielsenjf@my-deja.com */ diff --git a/com/help/mts.d b/com/help/mts.d index 321091b6e..0756729ef 100644 --- a/com/help/mts.d +++ b/com/help/mts.d @@ -89,11 +89,11 @@ import win32com.client.dynamic class Mts: # COM attributes. - _reg_clsid_ = '{3D094770-B73E-11D3-99FC-00902776D585}' + _reg_clsid_ = '{3D094770-B73E-11D3-99FC-00902776D585}' #guid for your class in registry - _reg_desc_ = "test mts functions" + _reg_desc_ = "test mts functions" _reg_progid_ = "mts1" #The progid for this class - _reg_class_spec_ = "mts_test.Mts" + _reg_class_spec_ = "mts_test.Mts" #tells Python how to create the object: filename.class _public_methods_ = ['getkid' ] #names of callable methods @@ -110,7 +110,7 @@ class Mts: result='error: mts not available' else: #mts is available - #first check if they are in the right role + #first check if they are in the right role if mts.IsCallerInRole('bedrock'): moms={'wilma':'bambam','betty':'pebbles'} person=str(person) #convert from unicode to string @@ -127,12 +127,10 @@ class Mts: if __name__=='__main__': import win32com.server.register win32com.server.register.UseCommandLine(Mts) - + @ex Have a great time with programming with python! -|John Nielsen nielsenjf@my-deja.com +|John Nielsen nielsenjf@my-deja.com */ - - diff --git a/com/help/shell.d b/com/help/shell.d index 499ab1470..716574bd6 100644 --- a/com/help/shell.d +++ b/com/help/shell.d @@ -27,31 +27,31 @@ See also: A tutorial-like introduction, includes brief discussion of non-file linking, and a fairly simple C sample application for file-based linking. -| +| class PyIShellLink( IPersistFile ): ''' Following is not a functional class, intended solely for documentation ''' def GetArguments(self): '''Retrieves the command-line arguments associated with a shell link object. ''' def SetArguments(self, argumentString): '''Sets the command-line arguments associated with a shell link object.''' - + def GetDescription(self): '''Retrieves the description string for a shell link object. ''' def SetDescription(self, descriptionString): '''Sets the description string for a shell link object. ''' - + def GetIconLocation(self): '''Retrieves the location (path and index) of the icon for a shell link object. Returns a tuple of string and integer''' def SetIconLocation(self, locationString, iconIndex): '''Sets the location (path and index) of the icon for a shell link object. ''' - + def GetPath(self, flags): '''Retrieves the path and file name of a shell link object. Note: flags are available through shell.SLGP_* - SLGP_SHORTPATH Retrieves the standard short (8.3 format) file name. + SLGP_SHORTPATH Retrieves the standard short (8.3 format) file name. SLGP_UNCPRIORITY Retrieves the Universal Naming Convention (UNC) path name - of the file. + of the file. SLGP_RAWPATH Retrieves the raw path name. A raw path is something that might not exist and may include environment variables that need to be expanded.''' def SetPath(self, pathString): @@ -61,7 +61,7 @@ class PyIShellLink( IPersistFile ): Note: This mechanism allows for moved link files to reestablish connection with relative files through similar-prefix comparisons''' - + def GetShowCmd(self): '''Retrieves the show (SW_) command for a shell link object.''' def SetShowCmd(self, constant): @@ -70,11 +70,11 @@ class PyIShellLink( IPersistFile ): SW_SHOWNORMAL Activates and displays a window. If the window is minimized or maximized, the system restores it to its original size and position. An application should specify this flag when displaying the window for the first - time. - SW_SHOWMAXIMIZED Activates the window and displays it as a maximized window. - SW_SHOWMINIMIZED Activates the window and displays it as a minimized window. + time. + SW_SHOWMAXIMIZED Activates the window and displays it as a maximized window. + SW_SHOWMINIMIZED Activates the window and displays it as a minimized window. ''' - + def GetWorkingDirectory(self): '''Retrieves the name of the working directory for a shell link object. ''' def SetWorkingDirectory(self, pathString): @@ -86,24 +86,24 @@ class PyIShellLink( IPersistFile ): Notes: window is the parent window of a dialog which will pop up if resolution fails flags: - SLR_INVOKE_MSI Call the Microsoft Windows Installer. + SLR_INVOKE_MSI Call the Microsoft Windows Installer. SLR_NOLINKINFO Disable distributed link tracking. By default, distributed link tracking tracks removable media across multiple devices based on the volume name. It also uses the UNC path to track remote file systems whose - drive letter has changed. Setting SLR_NOLINKINFO disables both types of tracking. + drive letter has changed. Setting SLR_NOLINKINFO disables both types of tracking. SLR_NO_UI Do not display a dialog box if the link cannot be resolved. When SLR_NO_UI is set, the high-order word of fFlags can be set to a time-out value that specifies the maximum amount of time to be spent resolving the link. The function returns if the link cannot be resolved within the time-out duration. If the high-order word is set to zero, the time-out duration will be set to the default value of 3,000 milliseconds (3 seconds). To specify a value, set the high - word of fFlags to the desired time-out duration, in milliseconds. - SLR_NOUPDATE Do not update the link information. - SLR_NOSEARCH Do not execute the search heuristics. - SLR_NOTRACK Do not use distributed link tracking. - SLR_UPDATE If the link object has changed, update its path and list of identifiers. If SLR_UPDATE is set, you do not need to call IPersistFile::IsDirty to determine whether or not the link object has changed. + word of fFlags to the desired time-out duration, in milliseconds. + SLR_NOUPDATE Do not update the link information. + SLR_NOSEARCH Do not execute the search heuristics. + SLR_NOTRACK Do not use distributed link tracking. + SLR_UPDATE If the link object has changed, update its path and list of identifiers. If SLR_UPDATE is set, you do not need to call IPersistFile::IsDirty to determine whether or not the link object has changed. ''' - + ### Problematic elements # The problems below are due primarily to structs used in the API def GetIDList(self): diff --git a/com/win32com/HTML/variant.html b/com/win32com/HTML/variant.html index 2631203eb..6a7ea4b25 100644 --- a/com/win32com/HTML/variant.html +++ b/com/win32com/HTML/variant.html @@ -6,9 +6,9 @@

    Introduction

    -win32com attempts to provide a seamless COM interface and hide many COM -implementation details, including the use of COM VARIANT structures. This -means that in most cases, you just call a COM object using normal Python +win32com attempts to provide a seamless COM interface and hide many COM +implementation details, including the use of COM VARIANT structures. This +means that in most cases, you just call a COM object using normal Python objects as parameters and get back normal Python objects as results.

    @@ -19,15 +19,15 @@

    Introduction

    -The win32com.client.VARIANT object is designed to overcome these +The win32com.client.VARIANT object is designed to overcome these problems.

    Drawbacks

    -The primary issue with this approach is that the programmer must learn more -about COM VARIANTs than otherwise - they need to know concepts such as -variants being byref, holding arrays, or that some may hold 32bit -unsigned integers while others hold 64bit signed ints, and they need to +The primary issue with this approach is that the programmer must learn more +about COM VARIANTs than otherwise - they need to know concepts such as +variants being byref, holding arrays, or that some may hold 32bit +unsigned integers while others hold 64bit signed ints, and they need to understand this in the context of a single method call. In short, this is a relatively advanced feature. The good news though is that use of these objects should never cause your program to hard-crash - the worst you should @@ -35,12 +35,12 @@

    Drawbacks

    The VARIANT object

    -The VARIANT object lives in win32com.client. The constructor -takes 2 parameters - the 'variant type' and the value. The 'variant type' is +The VARIANT object lives in win32com.client. The constructor +takes 2 parameters - the 'variant type' and the value. The 'variant type' is an integer and can be one or more of the pythoncom.VT_* values, possibly or'd together. -

    For example, to create a VARIANT object which defines a byref array of +

    For example, to create a VARIANT object which defines a byref array of 32bit integers, you could use:

    @@ -57,7 +57,7 @@ 

    The VARIANT object

    Example usage with dynamic objects.

    -For this example we will use the COM object used for win32com testing, +For this example we will use the COM object used for win32com testing, PyCOMTest.PyCOMTest. This object defines a method which is defined in IDL as:
    @@ -115,7 +115,7 @@ 

    Example usage with dynamic objects.

    Usage with generated objects

    -In most cases, objects with makepy support (ie, 'generated' objects) don't +In most cases, objects with makepy support (ie, 'generated' objects) don't need to use the VARIANT object - the type information means win32com can guess the right thing to pass. However, in some cases the VARIANT object can still be useful. @@ -126,22 +126,22 @@

    Usage with generated objects

    HRESULT DoSomething([in] VARIANT value);
    -But also imagine that the object has a limitation that if the parameter is an +But also imagine that the object has a limitation that if the parameter is an integer, it must be a 32bit unsigned value - any other integer representation will fail. -

    If you just pass a regular Python integer to this function, it will +

    If you just pass a regular Python integer to this function, it will generally be passed as a 32bit signed integer and given the limitation above, will fail. The VARIANT object allows you to work around the limitation - just -create a variant object VARIANT(pythoncom.VT_UI4, int_value) and -pass that - the function will then be called with the explicit type you +create a variant object VARIANT(pythoncom.VT_UI4, int_value) and +pass that - the function will then be called with the explicit type you specified and will succeed.

    Note that you can not use a VARIANT object to override the types described -in a type library. If a makepy generated class specifies that a VT_UI2 is -expected, attempting to pass a VARIANT object will fail. In this case you +in a type library. If a makepy generated class specifies that a VT_UI2 is +expected, attempting to pass a VARIANT object will fail. In this case you would need to hack around the problem. For example, imagine ob -was a COM object which a method called foo and you wanted to +was a COM object which a method called foo and you wanted to override the type declaration for foo by passing a VARIANT. You could do something like: diff --git a/com/win32com/changes.txt b/com/win32com/changes.txt index 7068b218c..266d231f9 100644 --- a/com/win32com/changes.txt +++ b/com/win32com/changes.txt @@ -38,12 +38,12 @@ is now the "official" way to create a Dispatch object. If you have previously imported a makepy generated support file, win32com.client.Dispatch() will correctly return a class from the makepy file. If no support is available, it will return a win32com.client.dynamic.Dispatch() object. -As previously, win32com.client.dynamic.Dispatch() will always return a dynamic object, +As previously, win32com.client.dynamic.Dispatch() will always return a dynamic object, whether makepy support is loaded or not. -* Far less divergence between "makepy" and "dynamic" objects. In the past, it was -often necessary to use a different coding style depending on whether you had makepy -support or not (eg, Excel 7 needed quite different code). In general, this has been +* Far less divergence between "makepy" and "dynamic" objects. In the past, it was +often necessary to use a different coding style depending on whether you had makepy +support or not (eg, Excel 7 needed quite different code). In general, this has been fixed (eg, all MSOffice test run both as dynamic and makepy - the only difference is speed. Note that Office97 can be _very_ slow at startup without makep support loaded. @@ -122,14 +122,14 @@ Dec 1, 96 - Even more changes to makepy/dynamic.py and its infrastructure. Specifically: - * Python COM clients can now call Python COM Servers (ironic problem, + * Python COM clients can now call Python COM Servers (ironic problem, that!:) All clients without type information should work better. * Makepy generated classes, once imported, can share across each other. Eg, the MSACCESS type library references interfaces in the DAO library. This now works totally seamlessly. * Makepy makes some simple detection of enumerators. Notably, DAO and MSACCESS work well - eg "for table in db.TableDefs:" now works as expected. - * Circular reference cleaned up. Previously, (almost) all dynamic.py + * Circular reference cleaned up. Previously, (almost) all dynamic.py created objects were immortal! This has removed most reference counting problems (apart from the standard Python ones, including the "last traceback" one, which does bite here.) @@ -152,4 +152,3 @@ Dec 1, 96 - expanded capabilities from policy.py - pythoncom.CoInitialize and CoUninitialize for threaded COM clients - other fun things - diff --git a/com/win32com/readme.html b/com/win32com/readme.html index 57146ec62..5aa005265 100644 --- a/com/win32com/readme.html +++ b/com/win32com/readme.html @@ -4,16 +4,16 @@ win32com Readme - +

    Python and COM - Blowing the others away

    - +

    Python COM Extensions Readme

    - +

    This is the readme for win32com. Please check out the win32com documentation index

    - +

    The win32com/test directory contains some interesting scripts (and a new readme.txt). Although these are used for testing, they do show a variety of COM techniques.

    @@ -34,7 +34,7 @@

    VARIANT objects

    Up until build 212, code could set pythoncom.__future_currency__ = True -to force use of the decimal module, with a warning issued otherwise. In +to force use of the decimal module, with a warning issued otherwise. In builds 213 and later, the decimal module is unconditionally used when pythoncom returns you a currency value.

    @@ -49,8 +49,8 @@

    win32com.axcontrol and win2con.internet

    win32com.shell

    The shell interfaces have undergone a number of enhancements and changes. -A couple of methods have changed signature between the first build with shell support (200) and later builds. -SHGetFileInfo was broken in its result handling, so had to be changed - this +A couple of methods have changed signature between the first build with shell support (200) and later builds. +SHGetFileInfo was broken in its result handling, so had to be changed - this is the only function used by the samples that changed, but others not used by the samples also have changed. These shell interfaces are now generally stable.

    New win32com.taskscheduler module

    @@ -58,14 +58,14 @@

    New win32com.taskscheduler module

    Python to edit the task list as shown by Windows Control Panel. Property page suppport may even appear later, now that the win32 library has the new win32rcparser module.

    ActiveX Scripting

    - +

    Python only supports "trusted" execution hosts - thus, it will no longer work -as an engine inside IE (Python itself no longer has a restricted execution environment). +as an engine inside IE (Python itself no longer has a restricted execution environment). Python continues to work fine as an Active Scripting Engine in all other applications, including Windows Scripting Host, and ASP.

    There is also support for Python as an ActiveX Scripting Host.

    - +

    Active Debugging seems to be fully functional.

    Older stuff

    @@ -82,6 +82,6 @@

    Older stuff

  • universal gateway support has been improved - we can now work as an Outlook Addin
  • - + diff --git a/com/win32com/server/util.py b/com/win32com/server/util.py index d7470a2bf..b75624d2d 100644 --- a/com/win32com/server/util.py +++ b/com/win32com/server/util.py @@ -1,4 +1,4 @@ -""" General Server side utilities""" +"""General Server side utilities""" import pythoncom import winerror diff --git a/com/win32com/src/PyIDispatch.cpp b/com/win32com/src/PyIDispatch.cpp index 4297729b1..71b4541b2 100644 --- a/com/win32com/src/PyIDispatch.cpp +++ b/com/win32com/src/PyIDispatch.cpp @@ -843,4 +843,3 @@ static struct PyMethodDef PyIDispatchEx_methods[] = { PyComTypeObject PyIDispatchEx::type("PyIDispatchEx", &PyIDispatch::type, // @base PyIDispatchEx|PyIDispatch sizeof(PyIDispatchEx), PyIDispatchEx_methods, GET_PYCOM_CTOR(PyIDispatchEx)); - diff --git a/com/win32com/src/PythonCOM.def b/com/win32com/src/PythonCOM.def index 58d030f25..465d91f98 100644 --- a/com/win32com/src/PythonCOM.def +++ b/com/win32com/src/PythonCOM.def @@ -12,4 +12,3 @@ EXPORTS PyCom_CoInitializeEx PyCom_CoInitialize PyCom_CoUninitialize - diff --git a/com/win32com/src/extensions/PyICatInformation.cpp b/com/win32com/src/extensions/PyICatInformation.cpp index 6ac0e8c29..143df355b 100644 --- a/com/win32com/src/extensions/PyICatInformation.cpp +++ b/com/win32com/src/extensions/PyICatInformation.cpp @@ -152,4 +152,3 @@ PyComTypeObject PyICatInformation::type("PyICatInformation", &PyIUnknown::type, // @base PyICatInformation|PyIUnknown sizeof(PyICatInformation), PyICatInformation_methods, GET_PYCOM_CTOR(PyICatInformation)); - diff --git a/com/win32com/src/extensions/PyICatRegister.cpp b/com/win32com/src/extensions/PyICatRegister.cpp index dec1e07d2..7759f23eb 100644 --- a/com/win32com/src/extensions/PyICatRegister.cpp +++ b/com/win32com/src/extensions/PyICatRegister.cpp @@ -312,4 +312,3 @@ static struct PyMethodDef PyICatRegister_methods[] = { PyComTypeObject PyICatRegister::type("PyICatRegister", &PyIUnknown::type, // @base PyICatRegister|PyIUnknown sizeof(PyICatRegister), PyICatRegister_methods, GET_PYCOM_CTOR(PyICatRegister)); - diff --git a/com/win32com/src/extensions/PyIEnumCATEGORYINFO.cpp b/com/win32com/src/extensions/PyIEnumCATEGORYINFO.cpp index 6aa8d09ab..ecf70aa07 100644 --- a/com/win32com/src/extensions/PyIEnumCATEGORYINFO.cpp +++ b/com/win32com/src/extensions/PyIEnumCATEGORYINFO.cpp @@ -139,4 +139,3 @@ PyComEnumTypeObject PyIEnumCATEGORYINFO::type("PyIEnumCATEGORYINFO", &PyIUnknown::type, // @base PyIEnumCATEGORYINFO|PyIUnknown sizeof(PyIEnumCATEGORYINFO), PyIEnumCATEGORYINFO_methods, GET_PYCOM_CTOR(PyIEnumCATEGORYINFO)); - diff --git a/com/win32com/src/extensions/PyIEnumGUID.cpp b/com/win32com/src/extensions/PyIEnumGUID.cpp index e074d666f..317b8f967 100644 --- a/com/win32com/src/extensions/PyIEnumGUID.cpp +++ b/com/win32com/src/extensions/PyIEnumGUID.cpp @@ -208,4 +208,3 @@ STDMETHODIMP PyGEnumGUID::Clone(IEnumGUID __RPC_FAR *__RPC_FAR *ppEnum) return PyCom_SetCOMErrorFromSimple(hr, IID_IEnumGUID); } - diff --git a/com/win32com/src/extensions/PyIPropertySetStorage.cpp b/com/win32com/src/extensions/PyIPropertySetStorage.cpp index 15199f42b..8f8b96c93 100644 --- a/com/win32com/src/extensions/PyIPropertySetStorage.cpp +++ b/com/win32com/src/extensions/PyIPropertySetStorage.cpp @@ -233,4 +233,3 @@ STDMETHODIMP PyGPropertySetStorage::Enum( Py_DECREF(result); return hr; } - diff --git a/com/win32com/src/extensions/PyIPropertyStorage.cpp b/com/win32com/src/extensions/PyIPropertyStorage.cpp index 98a370872..bbc2c07ca 100644 --- a/com/win32com/src/extensions/PyIPropertyStorage.cpp +++ b/com/win32com/src/extensions/PyIPropertyStorage.cpp @@ -1159,4 +1159,3 @@ STDMETHODIMP PyGPropertyStorage::Stat( Py_DECREF(result); return hr; } - diff --git a/com/win32com/src/extensions/PyIProvideClassInfo.cpp b/com/win32com/src/extensions/PyIProvideClassInfo.cpp index adb9c631e..90126b1e5 100644 --- a/com/win32com/src/extensions/PyIProvideClassInfo.cpp +++ b/com/win32com/src/extensions/PyIProvideClassInfo.cpp @@ -84,4 +84,3 @@ PyComTypeObject PyIProvideClassInfo2::type( "PyIProvideClassInfo2", &PyIProvideClassInfo::type, // @base PyIProvideClassInfo2|PyIProvideClassInfo sizeof(PyIProvideClassInfo2), PyIProvideClassInfo2_methods, GET_PYCOM_CTOR(PyIProvideClassInfo2)); - diff --git a/com/win32com/src/extensions/PyIServiceProvider.cpp b/com/win32com/src/extensions/PyIServiceProvider.cpp index b48c0b2b4..26517adea 100644 --- a/com/win32com/src/extensions/PyIServiceProvider.cpp +++ b/com/win32com/src/extensions/PyIServiceProvider.cpp @@ -82,4 +82,3 @@ STDMETHODIMP PyGServiceProvider::QueryService(REFGUID guidService, REFIID riid, Py_XDECREF(result); return MAKE_PYCOM_GATEWAY_FAILURE_CODE(method_name); } - diff --git a/com/win32com/test/Testpys.sct b/com/win32com/test/Testpys.sct index dd9b4e005..d3015831f 100644 --- a/com/win32com/test/Testpys.sct +++ b/com/win32com/test/Testpys.sct @@ -6,13 +6,13 @@ Version="1" ClassID="{2eeb6080-cd58-11d1-b81e-00a0240b2fef}"> - @@ -61,4 +61,3 @@ def PyMethod2(): - diff --git a/com/win32com/test/pippo.idl b/com/win32com/test/pippo.idl index 4222684c3..854fb938a 100644 --- a/com/win32com/test/pippo.idl +++ b/com/win32com/test/pippo.idl @@ -27,7 +27,7 @@ import "ocidl.idl"; pointer_default(unique) ] interface IPippo : IDispatch - { + { [id(1), helpstring("method Method1")] HRESULT Method1([out, retval] IPippo **val); [propget, id(2), helpstring("property MyProp1")] HRESULT MyProp1([out, retval] long *pVal); [id(3), helpstring("method Method2")] HRESULT Method2([in] long in1, [in, out] long *inout1, diff --git a/com/win32com/test/readme.txt b/com/win32com/test/readme.txt index 02edbd55f..5ccd77b72 100644 --- a/com/win32com/test/readme.txt +++ b/com/win32com/test/readme.txt @@ -14,5 +14,5 @@ on the machine. It is likely some tests will refuse to run due to objects not being locally available - this is normal. The win32com source tree has source code to a C++ and VB component used purely -for testing. You may like to build and register these, particularly if you +for testing. You may like to build and register these, particularly if you are doing anything related to argument/result handling. diff --git a/com/win32com/test/testDictionary.vbs b/com/win32com/test/testDictionary.vbs index ca1dc08e1..d59b1aa0a 100644 --- a/com/win32com/test/testDictionary.vbs +++ b/com/win32com/test/testDictionary.vbs @@ -22,5 +22,3 @@ end if if ok then WScript.Echo "VBScript has successfully tested Python.Dictionary" end if - - diff --git a/com/win32com/test/testInterp.vbs b/com/win32com/test/testInterp.vbs index f34d17a95..4b331a284 100644 --- a/com/win32com/test/testInterp.vbs +++ b/com/win32com/test/testInterp.vbs @@ -9,4 +9,3 @@ if bFailed then else WScript.Echo "VBScript test worked OK" end if - diff --git a/com/win32com/test/testxslt.xsl b/com/win32com/test/testxslt.xsl index 9ab5c0f95..8e2c696b9 100644 --- a/com/win32com/test/testxslt.xsl +++ b/com/win32com/test/testxslt.xsl @@ -52,4 +52,3 @@ def worked(): - diff --git a/com/win32comext/adsi/src/PyADSIUtil.cpp b/com/win32comext/adsi/src/PyADSIUtil.cpp index 75f79ee4c..31663ae6b 100644 --- a/com/win32comext/adsi/src/PyADSIUtil.cpp +++ b/com/win32comext/adsi/src/PyADSIUtil.cpp @@ -129,7 +129,7 @@ PyObject *PyADSIObject_FromADSVALUE(ADSVALUE &v) Py_DECREF(ob); return NULL; } - memcpy(pybuf.ptr(), v.ProviderSpecific.lpValue, bufSize); + memcpy(pybuf.ptr(), v.ProviderSpecific.lpValue, bufSize); break; } case ADSTYPE_NT_SECURITY_DESCRIPTOR: { diff --git a/com/win32comext/adsi/src/PyIDirectorySearch.i b/com/win32comext/adsi/src/PyIDirectorySearch.i index 530e49009..f32aec813 100644 --- a/com/win32comext/adsi/src/PyIDirectorySearch.i +++ b/com/win32comext/adsi/src/PyIDirectorySearch.i @@ -104,7 +104,7 @@ PyObject *PyIDirectorySearch::ExecuteSearch(PyObject *self, PyObject *args) PyCom_BuildPyException(_result, _swig_self, IID_IDirectoryObject); else { ret = PyLong_FromSsize_t((Py_ssize_t)handle); - } + } PyADSI_FreeNames(names, cnames); PyWinObject_FreeWCHAR(szFilter); return ret; diff --git a/com/win32comext/adsi/src/adsi.i b/com/win32comext/adsi/src/adsi.i index fe8fc14fc..fa569b93a 100644 --- a/com/win32comext/adsi/src/adsi.i +++ b/com/win32comext/adsi/src/adsi.i @@ -1,13 +1,13 @@ /* File : adsi.i */ -/* +/* This is designed to be an interface to the ADSI API */ %module adsi // A COM interface to ADSI -// @ comm Generally you will not use this module (win32com.adsi.adsi) +// @ comm Generally you will not use this module (win32com.adsi.adsi) // directly, but use win32com.adsi - this top-level interface does // smarter integration with Python IDispatch support, so offers a more // convenient technique. diff --git a/com/win32comext/axdebug/src/PyIDebugExpressionContext.h b/com/win32comext/axdebug/src/PyIDebugExpressionContext.h index a8c79d68d..6953bc3fd 100644 --- a/com/win32comext/axdebug/src/PyIDebugExpressionContext.h +++ b/com/win32comext/axdebug/src/PyIDebugExpressionContext.h @@ -33,4 +33,4 @@ class PyGDebugExpressionContext : public PyGatewayBase, public IDebugExpressionC IDebugExpression __RPC_FAR *__RPC_FAR *ppe); STDMETHOD(GetLanguageInfo)(BSTR __RPC_FAR *pbstrLanguageName, GUID __RPC_FAR *pLanguageID); -}; \ No newline at end of file +}; diff --git a/com/win32comext/axdebug/src/PyIDebugProperties.h b/com/win32comext/axdebug/src/PyIDebugProperties.h index dbdb7acd5..bcf414e1c 100644 --- a/com/win32comext/axdebug/src/PyIDebugProperties.h +++ b/com/win32comext/axdebug/src/PyIDebugProperties.h @@ -41,4 +41,4 @@ class PyGDebugProperty : public PyGatewayBase, public IDebugProperty { (DWORD dwFieldSpec, UINT nRadix, REFIID refiid, IEnumDebugPropertyInfo __RPC_FAR *__RPC_FAR *ppepi); STDMETHOD(GetParent)(IDebugProperty __RPC_FAR *__RPC_FAR *ppDebugProp); -}; \ No newline at end of file +}; diff --git a/com/win32comext/axdebug/src/PyIEnumDebugPropertyInfo.cpp b/com/win32comext/axdebug/src/PyIEnumDebugPropertyInfo.cpp index d9235306a..8110a655c 100644 --- a/com/win32comext/axdebug/src/PyIEnumDebugPropertyInfo.cpp +++ b/com/win32comext/axdebug/src/PyIEnumDebugPropertyInfo.cpp @@ -286,4 +286,4 @@ STDMETHODIMP PyGEnumDebugPropertyInfo::GetCount( *pcelt = PyLong_AsLong(result); Py_DECREF(result); return PyCom_SetCOMErrorFromPyException(IID_IEnumDebugPropertyInfo); -} \ No newline at end of file +} diff --git a/com/win32comext/axdebug/src/PyIProvideExpressionContexts.h b/com/win32comext/axdebug/src/PyIProvideExpressionContexts.h index 46140f75e..b91b397da 100644 --- a/com/win32comext/axdebug/src/PyIProvideExpressionContexts.h +++ b/com/win32comext/axdebug/src/PyIProvideExpressionContexts.h @@ -28,4 +28,4 @@ class PyGProvideExpressionContexts : public PyGatewayBase, public IProvideExpres // IProvideExpressionContexts STDMETHOD(EnumExpressionContexts)(IEnumDebugExpressionContexts __RPC_FAR *__RPC_FAR *ppedsf); -}; \ No newline at end of file +}; diff --git a/com/win32comext/axdebug/src/PyIRemoteDebugApplicationThread.h b/com/win32comext/axdebug/src/PyIRemoteDebugApplicationThread.h index 095eeb445..30dd7478d 100644 --- a/com/win32comext/axdebug/src/PyIRemoteDebugApplicationThread.h +++ b/com/win32comext/axdebug/src/PyIRemoteDebugApplicationThread.h @@ -53,4 +53,4 @@ class PyGRemoteDebugApplicationThread : public PyGatewayBase, public IRemoteDebu STDMETHOD(Resume)(DWORD __RPC_FAR *pdwCount); STDMETHOD(GetSuspendCount)(DWORD __RPC_FAR *pdwCount); -}; \ No newline at end of file +}; diff --git a/com/win32comext/axscript/demos/client/asp/CreateObject.asp b/com/win32comext/axscript/demos/client/asp/CreateObject.asp index 5338c0a06..d4d678f2e 100644 --- a/com/win32comext/axscript/demos/client/asp/CreateObject.asp +++ b/com/win32comext/axscript/demos/client/asp/CreateObject.asp @@ -16,4 +16,3 @@ Response.Write("Python says 1+1=" + str(o.Eval("1+1"))) - diff --git a/com/win32comext/axscript/demos/client/asp/caps.asp b/com/win32comext/axscript/demos/client/asp/caps.asp index 8ea7cf8de..f2e2aa397 100644 --- a/com/win32comext/axscript/demos/client/asp/caps.asp +++ b/com/win32comext/axscript/demos/client/asp/caps.asp @@ -21,7 +21,7 @@ Response.Write("

    Win32 username is "+win32api.GetUserName()) -<% +<% import sys print(sys.path) from win32com.axscript.asputil import * @@ -32,21 +32,21 @@ print("How are you") <%bc = Server.CreateObject("MSWC.BrowserType")%> -

    - - - - - - - -
    Browser <%=bc.browser %> -
    Version <%=bc.version %>
    Frames -<%Response.Write( iif(bc.frames, "TRUE", "FALSE")) %>
    Tables -<%Response.Write( iif (bc.tables, "TRUE", "FALSE")) %>
    BackgroundSounds -<%Response.Write( iif(bc.BackgroundSounds, "TRUE", "FALSE"))%>
    VBScript -<%Response.Write( iif(bc.vbscript, "TRUE", "FALSE"))%>
    JavaScript -<%Response.Write( iif(bc.javascript, "TRUE", "FALSE"))%>
    + + + + + + + + +
    Browser <%=bc.browser %> +
    Version <%=bc.version %>
    Frames +<%Response.Write( iif(bc.frames, "TRUE", "FALSE")) %>
    Tables +<%Response.Write( iif (bc.tables, "TRUE", "FALSE")) %>
    BackgroundSounds +<%Response.Write( iif(bc.BackgroundSounds, "TRUE", "FALSE"))%>
    VBScript +<%Response.Write( iif(bc.vbscript, "TRUE", "FALSE"))%>
    JavaScript +<%Response.Write( iif(bc.javascript, "TRUE", "FALSE"))%>
    diff --git a/com/win32comext/axscript/demos/client/asp/interrupt/test1.html b/com/win32comext/axscript/demos/client/asp/interrupt/test1.html index 6f1d9b2f1..d73b002e8 100644 --- a/com/win32comext/axscript/demos/client/asp/interrupt/test1.html +++ b/com/win32comext/axscript/demos/client/asp/interrupt/test1.html @@ -8,4 +8,3 @@ - diff --git a/com/win32comext/axscript/demos/client/asp/tut1.asp b/com/win32comext/axscript/demos/client/asp/tut1.asp index dcbb047cd..c7e2dcc06 100644 --- a/com/win32comext/axscript/demos/client/asp/tut1.asp +++ b/com/win32comext/axscript/demos/client/asp/tut1.asp @@ -8,4 +8,3 @@ for i in range(3,8): - diff --git a/com/win32comext/axscript/demos/client/ie/CHARTPY.HTM b/com/win32comext/axscript/demos/client/ie/CHARTPY.HTM index fe7d1b5fb..be6e10da9 100644 --- a/com/win32comext/axscript/demos/client/ie/CHARTPY.HTM +++ b/com/win32comext/axscript/demos/client/ie/CHARTPY.HTM @@ -64,15 +64,15 @@ The chart control enables you to draw charts. The chart's types and styles are p - - - diff --git a/com/win32comext/axscript/demos/client/ie/demo_intro.htm b/com/win32comext/axscript/demos/client/ie/demo_intro.htm index b8c811d8d..94494ec16 100644 --- a/com/win32comext/axscript/demos/client/ie/demo_intro.htm +++ b/com/win32comext/axscript/demos/client/ie/demo_intro.htm @@ -4,7 +4,7 @@

    Python ActiveX Scripting Demonstation - +

    Congratulations on installing the Python ActiveX Scripting Engine

    @@ -18,10 +18,10 @@

    Object model

    by Visual Basic, etc. Due to the nature of ActiveX Scripting, the details for each host are different, but Python should work "correctly". -

    The object model exposed via Python for MSIE is not as seamless as VB. The biggest limitation is +

    The object model exposed via Python for MSIE is not as seamless as VB. The biggest limitation is the concept of a "local" namespace. For example, in VB, you can -code text="Hi there", but in Python, you must code -MyForm.ThisButton.Text="Hi There". See the foo2 sample +code text="Hi there", but in Python, you must code +MyForm.ThisButton.Text="Hi There". See the foo2 sample for futher details.

    Known bugs and problems

    @@ -35,4 +35,3 @@

    Known bugs and problems

    - diff --git a/com/win32comext/axscript/demos/client/ie/demo_menu.htm b/com/win32comext/axscript/demos/client/ie/demo_menu.htm index ba23a434c..e83c3d5b1 100644 --- a/com/win32comext/axscript/demos/client/ie/demo_menu.htm +++ b/com/win32comext/axscript/demos/client/ie/demo_menu.htm @@ -1,16 +1,14 @@

    Scripting Demos

    -

    An Introduction to the +

    An Introduction to the scripting engine. -

    The Calculator Demo is a very +

    The Calculator Demo is a very cool sample written by Aaron Watters. -

    Mouse track is another of +

    Mouse track is another of Aaron's samples, and shows how fast the Python engine is! -

    The foo2 sample is mainly used +

    The foo2 sample is mainly used for debugging and testing, but does show some forms in action. - - diff --git a/com/win32comext/axscript/demos/client/ie/marqueeDemo.htm b/com/win32comext/axscript/demos/client/ie/marqueeDemo.htm index 33847c1d7..0716d5ed4 100644 --- a/com/win32comext/axscript/demos/client/ie/marqueeDemo.htm +++ b/com/win32comext/axscript/demos/client/ie/marqueeDemo.htm @@ -13,12 +13,12 @@

    - @@ -45,7 +45,7 @@ def btnSlower_Onclick(): ax.Marquee1.ScrollDelay = 300 - +

      @@ -57,4 +57,3 @@ - diff --git a/com/win32comext/axscript/demos/client/ie/mousetrack.htm b/com/win32comext/axscript/demos/client/ie/mousetrack.htm index fee059b90..4c2627690 100644 --- a/com/win32comext/axscript/demos/client/ie/mousetrack.htm +++ b/com/win32comext/axscript/demos/client/ie/mousetrack.htm @@ -4,13 +4,13 @@ -
    - Clickable Map Image
     
    @@ -18,7 +18,7 @@ A mouse tracking demo. Move the mouse over the image above... @@ -84,7 +84,7 @@ print("Y is ", y) def PythonGlobalFunction(): - window.alert("Hello from Python - Im about to call JScript!") + window.alert("Hello from Python - I'm about to call JScript!") window.JScriptFunction() def Window_OnLoad(): diff --git a/com/win32comext/axscript/src/PyGActiveScript.cpp b/com/win32comext/axscript/src/PyGActiveScript.cpp index 88bc70fe9..dad76db29 100644 --- a/com/win32comext/axscript/src/PyGActiveScript.cpp +++ b/com/win32comext/axscript/src/PyGActiveScript.cpp @@ -143,7 +143,7 @@ STDMETHODIMP PyGActiveScript::GetScriptThreadID( hr = PyCom_SetCOMErrorFromPyException(GetIID()); } else - hr = PyCom_SetCOMErrorFromSimple(E_FAIL, GetIID(), L"Python didnt return an integer"); + hr = PyCom_SetCOMErrorFromSimple(E_FAIL, GetIID(), L"Python didn't return an integer"); return hr; } diff --git a/com/win32comext/axscript/test/leakTest.py b/com/win32comext/axscript/test/leakTest.py index 98a589d3e..7b52e36a9 100644 --- a/com/win32comext/axscript/test/leakTest.py +++ b/com/win32comext/axscript/test/leakTest.py @@ -51,7 +51,7 @@ def echo(self, *args): # self._connect_server_.Broadcast(last) -#### Connections currently wont work, as there is no way for the engine to +#### Connections currently won't work, as there is no way for the engine to #### know what events we support. We need typeinfo support. IID_ITestEvents = pythoncom.MakeIID("{8EB72F90-0D44-11d1-9C4B-00AA00125A98}") @@ -145,7 +145,7 @@ def doTestEngine(engine, echoer): print("***** Calling 'hello' failed", exc) return if echoer.last != "Goober": - print("***** Function call didnt set value correctly", repr(echoer.last)) + print("***** Function call didn't set value correctly", repr(echoer.last)) if str(ob.prop) != "Property Value": print("***** Property Value not correct - ", repr(ob.prop)) diff --git a/com/win32comext/axscript/test/testHost.py b/com/win32comext/axscript/test/testHost.py index 1dba19ed1..3b1181bb6 100644 --- a/com/win32comext/axscript/test/testHost.py +++ b/com/win32comext/axscript/test/testHost.py @@ -69,7 +69,7 @@ def fail(self, *args): # self._connect_server_.Broadcast(last) -#### Connections currently wont work, as there is no way for the engine to +#### Connections currently won't work, as there is no way for the engine to #### know what events we support. We need typeinfo support. IID_ITestEvents = pythoncom.MakeIID("{8EB72F90-0D44-11d1-9C4B-00AA00125A98}") diff --git a/com/win32comext/ifilter/demo/filterDemo.py b/com/win32comext/ifilter/demo/filterDemo.py index 513f70081..5c598fa98 100644 --- a/com/win32comext/ifilter/demo/filterDemo.py +++ b/com/win32comext/ifilter/demo/filterDemo.py @@ -126,11 +126,11 @@ def Parse(self, fileName, maxErrors=10): errCnt = 0 if flags == CHUNK_TEXT: - # its a text segment - get all available text for this chunk. + # it's a text segment - get all available text for this chunk. body_chunks = properties.setdefault(propName, []) self._get_text(body_chunks) elif flags == CHUNK_VALUE: - # its a data segment - get the value + # it's a data segment - get the value properties[propName] = self.f.GetValue() else: self._trace("Unknown flag returned by GetChunk:", flags) diff --git a/com/win32comext/ifilter/src/stdafx.h b/com/win32comext/ifilter/src/stdafx.h index 6672c006d..8a9b1c26c 100644 --- a/com/win32comext/ifilter/src/stdafx.h +++ b/com/win32comext/ifilter/src/stdafx.h @@ -4,7 +4,7 @@ // // _WIN32_DCOM screws win95 and NT :-( However, we need to define this -// so we dont lose all the constants etc that come with DCOM +// so we don't lose all the constants etc that come with DCOM // #define _WIN32_DCOM diff --git a/com/win32comext/internet/src/internet.cpp b/com/win32comext/internet/src/internet.cpp index c16f9e2f7..741af0007 100644 --- a/com/win32comext/internet/src/internet.cpp +++ b/com/win32comext/internet/src/internet.cpp @@ -106,7 +106,7 @@ BOOL PyObject_AsBINDINFO(PyObject *ob, BINDINFO *pPD) if (!PyWinObject_AsTaskAllocatedWCHAR(obExtra, &pPD->szExtraInfo, /*bNoneOK=*/TRUE)) goto done; if (obSTGM != Py_None) { - PyErr_SetString(PyExc_TypeError, "Sorry - dont support STGMEDIUM yet - must be None"); + PyErr_SetString(PyExc_TypeError, "Sorry - don't support STGMEDIUM yet - must be None"); goto done; } if (!PyWinObject_AsTaskAllocatedWCHAR(obCustomVerb, &pPD->szCustomVerb, /*bNoneOK=*/TRUE)) diff --git a/com/win32comext/mapi/src/mapi_headers/EdkMdb.h b/com/win32comext/mapi/src/mapi_headers/EdkMdb.h index 887d64c35..6de385916 100644 --- a/com/win32comext/mapi/src/mapi_headers/EdkMdb.h +++ b/com/win32comext/mapi/src/mapi_headers/EdkMdb.h @@ -17,22 +17,21 @@ * literals declared here instead of the numerical values. */ -#define pidStoreNonTransMin 0x0E40 -#define pidExchangeXmitReservedMin 0x3FE0 -#define pidExchangeNonXmitReservedMin 0x65E0 -#define pidProfileMin 0x6600 -#define pidStoreMin 0x6618 -#define pidFolderMin 0x6638 -#define pidMessageReadOnlyMin 0x6640 -#define pidMessageWriteableMin 0x6658 -#define pidAttachReadOnlyMin 0x666C -#define pidSpecialMin 0x6670 -#define pidAdminMin 0x6690 -#define pidSecureProfileMin PROP_ID_SECURE_MIN -#define pidRenMsgFldMin 0x1080 -#define pidLocalStoreInternalMin 0x6500 // Using a portion of the user-defined non-tranmittable prop for local store -#define pidLocalStoreInternalMax 0x65C0 - +#define pidStoreNonTransMin 0x0E40 +#define pidExchangeXmitReservedMin 0x3FE0 +#define pidExchangeNonXmitReservedMin 0x65E0 +#define pidProfileMin 0x6600 +#define pidStoreMin 0x6618 +#define pidFolderMin 0x6638 +#define pidMessageReadOnlyMin 0x6640 +#define pidMessageWriteableMin 0x6658 +#define pidAttachReadOnlyMin 0x666C +#define pidSpecialMin 0x6670 +#define pidAdminMin 0x6690 +#define pidSecureProfileMin PROP_ID_SECURE_MIN +#define pidRenMsgFldMin 0x1080 +#define pidLocalStoreInternalMin 0x6500 // Using a portion of the user-defined non-tranmittable prop for local store +#define pidLocalStoreInternalMax 0x65C0 /*------------------------------------------------------------------------ * @@ -49,136 +48,132 @@ /* GUID of the global section */ -#define pbGlobalProfileSectionGuid "\x13\xDB\xB0\xC8\xAA\x05\x10\x1A\x9B\xB0\x00\xAA\x00\x2F\xC4\x5A" - +#define pbGlobalProfileSectionGuid "\x13\xDB\xB0\xC8\xAA\x05\x10\x1A\x9B\xB0\x00\xAA\x00\x2F\xC4\x5A" /* Properties in the global section */ -#define PR_PROFILE_VERSION PROP_TAG( PT_LONG, pidProfileMin+0x00) -#define PR_PROFILE_CONFIG_FLAGS PROP_TAG( PT_LONG, pidProfileMin+0x01) -#define PR_PROFILE_HOME_SERVER PROP_TAG( PT_STRING8, pidProfileMin+0x02) -#define PR_PROFILE_HOME_SERVER_DN PROP_TAG( PT_STRING8, pidProfileMin+0x12) -#define PR_PROFILE_HOME_SERVER_ADDRS PROP_TAG( PT_MV_STRING8, pidProfileMin+0x13) -#define PR_PROFILE_USER PROP_TAG( PT_STRING8, pidProfileMin+0x03) -#define PR_PROFILE_CONNECT_FLAGS PROP_TAG( PT_LONG, pidProfileMin+0x04) -#define PR_PROFILE_TRANSPORT_FLAGS PROP_TAG( PT_LONG, pidProfileMin+0x05) -#define PR_PROFILE_UI_STATE PROP_TAG( PT_LONG, pidProfileMin+0x06) -#define PR_PROFILE_UNRESOLVED_NAME PROP_TAG( PT_STRING8, pidProfileMin+0x07) -#define PR_PROFILE_UNRESOLVED_SERVER PROP_TAG( PT_STRING8, pidProfileMin+0x08) -#define PR_PROFILE_BINDING_ORDER PROP_TAG( PT_STRING8, pidProfileMin+0x09) -#define PR_PROFILE_MAX_RESTRICT PROP_TAG( PT_LONG, pidProfileMin+0x0D) -#define PR_PROFILE_AB_FILES_PATH PROP_TAG( PT_STRING8, pidProfileMin+0xE) -#define PR_PROFILE_OFFLINE_STORE_PATH PROP_TAG( PT_STRING8, pidProfileMin+0x10) -#define PR_PROFILE_OFFLINE_INFO PROP_TAG( PT_BINARY, pidProfileMin+0x11) -#define PR_PROFILE_ADDR_INFO PROP_TAG( PT_BINARY, pidSpecialMin+0x17) -#define PR_PROFILE_OPTIONS_DATA PROP_TAG( PT_BINARY, pidSpecialMin+0x19) -#define PR_PROFILE_SECURE_MAILBOX PROP_TAG( PT_BINARY, pidSecureProfileMin + 0) -#define PR_DISABLE_WINSOCK PROP_TAG( PT_LONG, pidProfileMin+0x18) -#define PR_PROFILE_AUTH_PACKAGE PROP_TAG( PT_LONG, pidProfileMin+0x19) // dup tag of PR_USER_ENTRYID -#define PR_PROFILE_RECONNECT_INTERVAL PROP_TAG( PT_LONG, pidProfileMin+0x1a) // dup tag of PR_USER_NAME -#define PR_PROFILE_SERVER_VERSION PROP_TAG( PT_LONG, pidProfileMin+0x1b) +#define PR_PROFILE_VERSION PROP_TAG(PT_LONG, pidProfileMin + 0x00) +#define PR_PROFILE_CONFIG_FLAGS PROP_TAG(PT_LONG, pidProfileMin + 0x01) +#define PR_PROFILE_HOME_SERVER PROP_TAG(PT_STRING8, pidProfileMin + 0x02) +#define PR_PROFILE_HOME_SERVER_DN PROP_TAG(PT_STRING8, pidProfileMin + 0x12) +#define PR_PROFILE_HOME_SERVER_ADDRS PROP_TAG(PT_MV_STRING8, pidProfileMin + 0x13) +#define PR_PROFILE_USER PROP_TAG(PT_STRING8, pidProfileMin + 0x03) +#define PR_PROFILE_CONNECT_FLAGS PROP_TAG(PT_LONG, pidProfileMin + 0x04) +#define PR_PROFILE_TRANSPORT_FLAGS PROP_TAG(PT_LONG, pidProfileMin + 0x05) +#define PR_PROFILE_UI_STATE PROP_TAG(PT_LONG, pidProfileMin + 0x06) +#define PR_PROFILE_UNRESOLVED_NAME PROP_TAG(PT_STRING8, pidProfileMin + 0x07) +#define PR_PROFILE_UNRESOLVED_SERVER PROP_TAG(PT_STRING8, pidProfileMin + 0x08) +#define PR_PROFILE_BINDING_ORDER PROP_TAG(PT_STRING8, pidProfileMin + 0x09) +#define PR_PROFILE_MAX_RESTRICT PROP_TAG(PT_LONG, pidProfileMin + 0x0D) +#define PR_PROFILE_AB_FILES_PATH PROP_TAG(PT_STRING8, pidProfileMin + 0xE) +#define PR_PROFILE_OFFLINE_STORE_PATH PROP_TAG(PT_STRING8, pidProfileMin + 0x10) +#define PR_PROFILE_OFFLINE_INFO PROP_TAG(PT_BINARY, pidProfileMin + 0x11) +#define PR_PROFILE_ADDR_INFO PROP_TAG(PT_BINARY, pidSpecialMin + 0x17) +#define PR_PROFILE_OPTIONS_DATA PROP_TAG(PT_BINARY, pidSpecialMin + 0x19) +#define PR_PROFILE_SECURE_MAILBOX PROP_TAG(PT_BINARY, pidSecureProfileMin + 0) +#define PR_DISABLE_WINSOCK PROP_TAG(PT_LONG, pidProfileMin + 0x18) +#define PR_PROFILE_AUTH_PACKAGE PROP_TAG(PT_LONG, pidProfileMin + 0x19) // dup tag of PR_USER_ENTRYID +#define PR_PROFILE_RECONNECT_INTERVAL PROP_TAG(PT_LONG, pidProfileMin + 0x1a) // dup tag of PR_USER_NAME +#define PR_PROFILE_SERVER_VERSION PROP_TAG(PT_LONG, pidProfileMin + 0x1b) /* SE 233155 - MarkH: EMSABP DCR /* /* Properties in the abp section - I got these values from AlecDun (Outlook team) */ -#define PR_PROFILE_ABP_ALLOW_RECONNECT PROP_TAG( PT_LONG, pidProfileMin+0x39) -#define PR_PROFILE_ABP_MTHREAD_TIMEOUT_SECS PROP_TAG( PT_LONG, pidProfileMin+0x3A) +#define PR_PROFILE_ABP_ALLOW_RECONNECT PROP_TAG(PT_LONG, pidProfileMin + 0x39) +#define PR_PROFILE_ABP_MTHREAD_TIMEOUT_SECS PROP_TAG(PT_LONG, pidProfileMin + 0x3A) /* Properties passed through the Service Entry to the OST */ -#define PR_OST_ENCRYPTION PROP_TAG(PT_LONG, 0x6702) +#define PR_OST_ENCRYPTION PROP_TAG(PT_LONG, 0x6702) /* Values for PR_OST_ENCRYPTION */ -#define OSTF_NO_ENCRYPTION ((DWORD)0x80000000) -#define OSTF_COMPRESSABLE_ENCRYPTION ((DWORD)0x40000000) -#define OSTF_BEST_ENCRYPTION ((DWORD)0x20000000) +#define OSTF_NO_ENCRYPTION ((DWORD)0x80000000) +#define OSTF_COMPRESSABLE_ENCRYPTION ((DWORD)0x40000000) +#define OSTF_BEST_ENCRYPTION ((DWORD)0x20000000) /* Properties in each profile section */ -#define PR_PROFILE_OPEN_FLAGS PROP_TAG( PT_LONG, pidProfileMin+0x09) -#define PR_PROFILE_TYPE PROP_TAG( PT_LONG, pidProfileMin+0x0A) -#define PR_PROFILE_MAILBOX PROP_TAG( PT_STRING8, pidProfileMin+0x0B) -#define PR_PROFILE_SERVER PROP_TAG( PT_STRING8, pidProfileMin+0x0C) -#define PR_PROFILE_SERVER_DN PROP_TAG( PT_STRING8, pidProfileMin+0x14) +#define PR_PROFILE_OPEN_FLAGS PROP_TAG(PT_LONG, pidProfileMin + 0x09) +#define PR_PROFILE_TYPE PROP_TAG(PT_LONG, pidProfileMin + 0x0A) +#define PR_PROFILE_MAILBOX PROP_TAG(PT_STRING8, pidProfileMin + 0x0B) +#define PR_PROFILE_SERVER PROP_TAG(PT_STRING8, pidProfileMin + 0x0C) +#define PR_PROFILE_SERVER_DN PROP_TAG(PT_STRING8, pidProfileMin + 0x14) /* Properties in the Public Folders section */ -#define PR_PROFILE_FAVFLD_DISPLAY_NAME PROP_TAG(PT_STRING8, pidProfileMin+0x0F) -#define PR_PROFILE_FAVFLD_COMMENT PROP_TAG(PT_STRING8, pidProfileMin+0x15) -#define PR_PROFILE_ALLPUB_DISPLAY_NAME PROP_TAG(PT_STRING8, pidProfileMin+0x16) -#define PR_PROFILE_ALLPUB_COMMENT PROP_TAG(PT_STRING8, pidProfileMin+0x17) +#define PR_PROFILE_FAVFLD_DISPLAY_NAME PROP_TAG(PT_STRING8, pidProfileMin + 0x0F) +#define PR_PROFILE_FAVFLD_COMMENT PROP_TAG(PT_STRING8, pidProfileMin + 0x15) +#define PR_PROFILE_ALLPUB_DISPLAY_NAME PROP_TAG(PT_STRING8, pidProfileMin + 0x16) +#define PR_PROFILE_ALLPUB_COMMENT PROP_TAG(PT_STRING8, pidProfileMin + 0x17) /* Properties for Multiple Offline Address Book support (MOAB) */ -#define PR_PROFILE_MOAB PROP_TAG( PT_STRING8, pidSpecialMin + 0x0B ) -#define PR_PROFILE_MOAB_GUID PROP_TAG( PT_STRING8, pidSpecialMin + 0x0C ) -#define PR_PROFILE_MOAB_SEQ PROP_TAG( PT_LONG, pidSpecialMin + 0x0D ) +#define PR_PROFILE_MOAB PROP_TAG(PT_STRING8, pidSpecialMin + 0x0B) +#define PR_PROFILE_MOAB_GUID PROP_TAG(PT_STRING8, pidSpecialMin + 0x0C) +#define PR_PROFILE_MOAB_SEQ PROP_TAG(PT_LONG, pidSpecialMin + 0x0D) // Property for setting a list of prop_ids to be excluded // from the GetProps(NULL) call. -#define PR_GET_PROPS_EXCLUDE_PROP_ID_LIST PROP_TAG( PT_BINARY, pidSpecialMin + 0x0E ) +#define PR_GET_PROPS_EXCLUDE_PROP_ID_LIST PROP_TAG(PT_BINARY, pidSpecialMin + 0x0E) // Current value for PR_PROFILE_VERSION -#define PROFILE_VERSION ((ULONG)0x501) +#define PROFILE_VERSION ((ULONG)0x501) // Bit values for PR_PROFILE_CONFIG_FLAGS -#define CONFIG_SERVICE ((ULONG)0x00000001) -#define CONFIG_SHOW_STARTUP_UI ((ULONG)0x00000002) -#define CONFIG_SHOW_CONNECT_UI ((ULONG)0x00000004) -#define CONFIG_PROMPT_FOR_CREDENTIALS ((ULONG)0x00000008) -#define CONFIG_NO_AUTO_DETECT ((ULONG)0x00000010) -#define CONFIG_OST_CACHE_ONLY ((ULONG)0x00000020) +#define CONFIG_SERVICE ((ULONG)0x00000001) +#define CONFIG_SHOW_STARTUP_UI ((ULONG)0x00000002) +#define CONFIG_SHOW_CONNECT_UI ((ULONG)0x00000004) +#define CONFIG_PROMPT_FOR_CREDENTIALS ((ULONG)0x00000008) +#define CONFIG_NO_AUTO_DETECT ((ULONG)0x00000010) +#define CONFIG_OST_CACHE_ONLY ((ULONG)0x00000020) // Bit values for PR_PROFILE_CONNECT_FLAGS -#define CONNECT_USE_ADMIN_PRIVILEGE ((ULONG)1) -#define CONNECT_NO_RPC_ENCRYPTION ((ULONG)2) -#define CONNECT_USE_SEPARATE_CONNECTION ((ULONG)4) -#define CONNECT_NO_UNDER_COVER_CONNECTION ((ULONG)8) -#define CONNECT_ANONYMOUS_ACCESS ((ULONG)16) -#define CONNECT_NO_NOTIFICATIONS ((ULONG)32) -#define CONNECT_NO_TABLE_NOTIFICATIONS ((ULONG)32) /* BUGBUG: TEMPORARY */ -#define CONNECT_NO_ADDRESS_RESOLUTION ((ULONG)64) -#define CONNECT_RESTORE_DATABASE ((ULONG)128) - +#define CONNECT_USE_ADMIN_PRIVILEGE ((ULONG)1) +#define CONNECT_NO_RPC_ENCRYPTION ((ULONG)2) +#define CONNECT_USE_SEPARATE_CONNECTION ((ULONG)4) +#define CONNECT_NO_UNDER_COVER_CONNECTION ((ULONG)8) +#define CONNECT_ANONYMOUS_ACCESS ((ULONG)16) +#define CONNECT_NO_NOTIFICATIONS ((ULONG)32) +#define CONNECT_NO_TABLE_NOTIFICATIONS ((ULONG)32) /* BUGBUG: TEMPORARY */ +#define CONNECT_NO_ADDRESS_RESOLUTION ((ULONG)64) +#define CONNECT_RESTORE_DATABASE ((ULONG)128) // Bit values for PR_PROFILE_TRANSPORT_FLAGS -#define TRANSPORT_DOWNLOAD ((ULONG)1) -#define TRANSPORT_UPLOAD ((ULONG)2) +#define TRANSPORT_DOWNLOAD ((ULONG)1) +#define TRANSPORT_UPLOAD ((ULONG)2) // Bit values for PR_PROFILE_OPEN_FLAGS -#define OPENSTORE_USE_ADMIN_PRIVILEGE ((ULONG)0x00000001) -#define OPENSTORE_PUBLIC ((ULONG)0x00000002) -#define OPENSTORE_HOME_LOGON ((ULONG)0x00000004) -#define OPENSTORE_TAKE_OWNERSHIP ((ULONG)0x00000008) -#define OPENSTORE_OVERRIDE_HOME_MDB ((ULONG)0x00000010) -#define OPENSTORE_TRANSPORT ((ULONG)0x00000020) -#define OPENSTORE_REMOTE_TRANSPORT ((ULONG)0x00000040) -#define OPENSTORE_INTERNET_ANONYMOUS ((ULONG)0x00000080) -#define OPENSTORE_ALTERNATE_SERVER ((ULONG)0x00000100) /* reserved for internal use */ -#define OPENSTORE_IGNORE_HOME_MDB ((ULONG)0x00000200) /* reserved for internal use */ -#define OPENSTORE_NO_MAIL ((ULONG)0x00000400) /* reserved for internal use */ -#define OPENSTORE_OVERRIDE_LAST_MODIFIER ((ULONG)0x00000800) -#define OPENSTORE_CALLBACK_LOGON ((ULONG)0x00001000) /* reserved for internal use */ -#define OPENSTORE_LOCAL ((ULONG)0x00002000) -#define OPENSTORE_FAIL_IF_NO_MAILBOX ((ULONG)0x00004000) /* reserved for internal use */ -#define OPENSTORE_CACHE_EXCHANGE ((ULONG)0x00008000) -#define OPENSTORE_CLI_WITH_NAMEDPROP_FIX ((ULONG)0x00010000) /* reserved for internal use */ -#define OPENSTORE_ENABLE_LAZY_LOGGING ((ULONG)0x00020000) /* reserved for internal use */ -#define OPENSTORE_CLI_WITH_REPLID_GUID_MAPPING_FIX ((ULONG)0x00040000) /* reserved for internal use */ -#define OPENSTORE_NO_LOCALIZATION ((ULONG)0x00080000) /* reserved for internal use */ -#define OPENSTORE_RESTORE_DATABASE ((ULONG)0x00100000) -#define OPENSTORE_XFOREST_MOVE ((ULONG)0x00200000) /* reserved for internal use */ - +#define OPENSTORE_USE_ADMIN_PRIVILEGE ((ULONG)0x00000001) +#define OPENSTORE_PUBLIC ((ULONG)0x00000002) +#define OPENSTORE_HOME_LOGON ((ULONG)0x00000004) +#define OPENSTORE_TAKE_OWNERSHIP ((ULONG)0x00000008) +#define OPENSTORE_OVERRIDE_HOME_MDB ((ULONG)0x00000010) +#define OPENSTORE_TRANSPORT ((ULONG)0x00000020) +#define OPENSTORE_REMOTE_TRANSPORT ((ULONG)0x00000040) +#define OPENSTORE_INTERNET_ANONYMOUS ((ULONG)0x00000080) +#define OPENSTORE_ALTERNATE_SERVER ((ULONG)0x00000100) /* reserved for internal use */ +#define OPENSTORE_IGNORE_HOME_MDB ((ULONG)0x00000200) /* reserved for internal use */ +#define OPENSTORE_NO_MAIL ((ULONG)0x00000400) /* reserved for internal use */ +#define OPENSTORE_OVERRIDE_LAST_MODIFIER ((ULONG)0x00000800) +#define OPENSTORE_CALLBACK_LOGON ((ULONG)0x00001000) /* reserved for internal use */ +#define OPENSTORE_LOCAL ((ULONG)0x00002000) +#define OPENSTORE_FAIL_IF_NO_MAILBOX ((ULONG)0x00004000) /* reserved for internal use */ +#define OPENSTORE_CACHE_EXCHANGE ((ULONG)0x00008000) +#define OPENSTORE_CLI_WITH_NAMEDPROP_FIX ((ULONG)0x00010000) /* reserved for internal use */ +#define OPENSTORE_ENABLE_LAZY_LOGGING ((ULONG)0x00020000) /* reserved for internal use */ +#define OPENSTORE_CLI_WITH_REPLID_GUID_MAPPING_FIX ((ULONG)0x00040000) /* reserved for internal use */ +#define OPENSTORE_NO_LOCALIZATION ((ULONG)0x00080000) /* reserved for internal use */ +#define OPENSTORE_RESTORE_DATABASE ((ULONG)0x00100000) +#define OPENSTORE_XFOREST_MOVE ((ULONG)0x00200000) /* reserved for internal use */ // Values for PR_PROFILE_TYPE -#define PROFILE_PRIMARY_USER ((ULONG)1) -#define PROFILE_DELEGATE ((ULONG)2) -#define PROFILE_PUBLIC_STORE ((ULONG)3) -#define PROFILE_SUBSCRIPTION ((ULONG)4) - +#define PROFILE_PRIMARY_USER ((ULONG)1) +#define PROFILE_DELEGATE ((ULONG)2) +#define PROFILE_PUBLIC_STORE ((ULONG)3) +#define PROFILE_SUBSCRIPTION ((ULONG)4) /*------------------------------------------------------------------------ * @@ -188,111 +183,111 @@ /* PR_MDB_PROVIDER GUID in stores table */ -#define pbExchangeProviderPrimaryUserGuid "\x54\x94\xA1\xC0\x29\x7F\x10\x1B\xA5\x87\x08\x00\x2B\x2A\x25\x17" -#define pbExchangeProviderDelegateGuid "\x9e\xb4\x77\x00\x74\xe4\x11\xce\x8c\x5e\x00\xaa\x00\x42\x54\xe2" -#define pbExchangeProviderPublicGuid "\x78\xb2\xfa\x70\xaf\xf7\x11\xcd\x9b\xc8\x00\xaa\x00\x2f\xc4\x5a" -#define pbExchangeProviderXportGuid "\xa9\x06\x40\xe0\xd6\x93\x11\xcd\xaf\x95\x00\xaa\x00\x4a\x35\xc3" -#define pbExchangeProviderLocalStoreGuid "\x2D\xE5\x6B\xA1\x64\x6E\x11\xd2\x8D\x4E\x00\xC0\x4F\xAE\x23\x71" -#define pbExchangeProviderPersistStoreGuid "\x98\xA2\x3D\x67\x62\xCF\x4d\x34\x82\x79\xDB\xFA\x6A\x50\x8B\x31" +#define pbExchangeProviderPrimaryUserGuid "\x54\x94\xA1\xC0\x29\x7F\x10\x1B\xA5\x87\x08\x00\x2B\x2A\x25\x17" +#define pbExchangeProviderDelegateGuid "\x9e\xb4\x77\x00\x74\xe4\x11\xce\x8c\x5e\x00\xaa\x00\x42\x54\xe2" +#define pbExchangeProviderPublicGuid "\x78\xb2\xfa\x70\xaf\xf7\x11\xcd\x9b\xc8\x00\xaa\x00\x2f\xc4\x5a" +#define pbExchangeProviderXportGuid "\xa9\x06\x40\xe0\xd6\x93\x11\xcd\xaf\x95\x00\xaa\x00\x4a\x35\xc3" +#define pbExchangeProviderLocalStoreGuid "\x2D\xE5\x6B\xA1\x64\x6E\x11\xd2\x8D\x4E\x00\xC0\x4F\xAE\x23\x71" +#define pbExchangeProviderPersistStoreGuid "\x98\xA2\x3D\x67\x62\xCF\x4d\x34\x82\x79\xDB\xFA\x6A\x50\x8B\x31" // All properties in this section are readonly // Identity of store - // All stores -#define PR_USER_ENTRYID PROP_TAG( PT_BINARY, pidStoreMin+0x01) -#define PR_USER_NAME PROP_TAG( PT_STRING8, pidStoreMin+0x02) +// All stores +#define PR_USER_ENTRYID PROP_TAG(PT_BINARY, pidStoreMin + 0x01) +#define PR_USER_NAME PROP_TAG(PT_STRING8, pidStoreMin + 0x02) - // All mailbox stores -#define PR_MAILBOX_OWNER_ENTRYID PROP_TAG( PT_BINARY, pidStoreMin+0x03) -#define PR_MAILBOX_OWNER_NAME PROP_TAG( PT_STRING8, pidStoreMin+0x04) -#define PR_OOF_STATE PROP_TAG( PT_BOOLEAN, pidStoreMin+0x05) +// All mailbox stores +#define PR_MAILBOX_OWNER_ENTRYID PROP_TAG(PT_BINARY, pidStoreMin + 0x03) +#define PR_MAILBOX_OWNER_NAME PROP_TAG(PT_STRING8, pidStoreMin + 0x04) +#define PR_OOF_STATE PROP_TAG(PT_BOOLEAN, pidStoreMin + 0x05) // Bug#255023 Provide quota information to MAPI clients to avoid large emails from ever reaching the server -#define PR_MAX_SUBMIT_MESSAGE_SIZE PROP_TAG( PT_LONG, 0x666D) -#define PR_PROHIBIT_SEND_QUOTA PROP_TAG( PT_LONG, 0x666E) +#define PR_MAX_SUBMIT_MESSAGE_SIZE PROP_TAG(PT_LONG, 0x666D) +#define PR_PROHIBIT_SEND_QUOTA PROP_TAG(PT_LONG, 0x666E) - // Public stores -- name of hierarchy server -#define PR_HIERARCHY_SERVER PROP_TAG( PT_TSTRING, pidStoreMin+0x1B) +// Public stores -- name of hierarchy server +#define PR_HIERARCHY_SERVER PROP_TAG(PT_TSTRING, pidStoreMin + 0x1B) // Entryids of special folders - // All mailbox stores -#define PR_SCHEDULE_FOLDER_ENTRYID PROP_TAG( PT_BINARY, pidStoreMin+0x06) - - // All mailbox and gateway stores -#define PR_IPM_DAF_ENTRYID PROP_TAG( PT_BINARY, pidStoreMin+0x07) - - // Public store -#define PR_NON_IPM_SUBTREE_ENTRYID PROP_TAG( PT_BINARY, pidStoreMin+0x08) -#define PR_EFORMS_REGISTRY_ENTRYID PROP_TAG( PT_BINARY, pidStoreMin+0x09) -#define PR_SPLUS_FREE_BUSY_ENTRYID PROP_TAG( PT_BINARY, pidStoreMin+0x0A) -#define PR_OFFLINE_ADDRBOOK_ENTRYID PROP_TAG( PT_BINARY, pidStoreMin+0x0B) -#define PR_NNTP_CONTROL_FOLDER_ENTRYID PROP_TAG( PT_BINARY, pidSpecialMin+0x1B) -#define PR_EFORMS_FOR_LOCALE_ENTRYID PROP_TAG( PT_BINARY, pidStoreMin+0x0C) -#define PR_FREE_BUSY_FOR_LOCAL_SITE_ENTRYID PROP_TAG( PT_BINARY, pidStoreMin+0x0D) -#define PR_ADDRBOOK_FOR_LOCAL_SITE_ENTRYID PROP_TAG( PT_BINARY, pidStoreMin+0x0E) -#define PR_NEWSGROUP_ROOT_FOLDER_ENTRYID PROP_TAG( PT_BINARY, pidSpecialMin+0x1C) -#define PR_OFFLINE_MESSAGE_ENTRYID PROP_TAG( PT_BINARY, pidStoreMin+0x0F) -#define PR_IPM_FAVORITES_ENTRYID PROP_TAG( PT_BINARY, pidStoreMin+0x18) -#define PR_IPM_PUBLIC_FOLDERS_ENTRYID PROP_TAG( PT_BINARY, pidStoreMin+0x19) -#define PR_FAVORITES_DEFAULT_NAME PROP_TAG( PT_STRING8, pidStoreMin+0x1D) -#define PR_SYS_CONFIG_FOLDER_ENTRYID PROP_TAG( PT_BINARY, pidStoreMin+0x1E) -#define PR_NNTP_ARTICLE_FOLDER_ENTRYID PROP_TAG( PT_BINARY, pidSpecialMin+0x1A) -#define PR_EVENTS_ROOT_FOLDER_ENTRYID PROP_TAG( PT_BINARY, pidSpecialMin+0xA) - - // Gateway stores -#define PR_GW_MTSIN_ENTRYID PROP_TAG( PT_BINARY, pidStoreMin+0x10) -#define PR_GW_MTSOUT_ENTRYID PROP_TAG( PT_BINARY, pidStoreMin+0x11) -#define PR_TRANSFER_ENABLED PROP_TAG( PT_BOOLEAN, pidStoreMin+0x12) +// All mailbox stores +#define PR_SCHEDULE_FOLDER_ENTRYID PROP_TAG(PT_BINARY, pidStoreMin + 0x06) + +// All mailbox and gateway stores +#define PR_IPM_DAF_ENTRYID PROP_TAG(PT_BINARY, pidStoreMin + 0x07) + +// Public store +#define PR_NON_IPM_SUBTREE_ENTRYID PROP_TAG(PT_BINARY, pidStoreMin + 0x08) +#define PR_EFORMS_REGISTRY_ENTRYID PROP_TAG(PT_BINARY, pidStoreMin + 0x09) +#define PR_SPLUS_FREE_BUSY_ENTRYID PROP_TAG(PT_BINARY, pidStoreMin + 0x0A) +#define PR_OFFLINE_ADDRBOOK_ENTRYID PROP_TAG(PT_BINARY, pidStoreMin + 0x0B) +#define PR_NNTP_CONTROL_FOLDER_ENTRYID PROP_TAG(PT_BINARY, pidSpecialMin + 0x1B) +#define PR_EFORMS_FOR_LOCALE_ENTRYID PROP_TAG(PT_BINARY, pidStoreMin + 0x0C) +#define PR_FREE_BUSY_FOR_LOCAL_SITE_ENTRYID PROP_TAG(PT_BINARY, pidStoreMin + 0x0D) +#define PR_ADDRBOOK_FOR_LOCAL_SITE_ENTRYID PROP_TAG(PT_BINARY, pidStoreMin + 0x0E) +#define PR_NEWSGROUP_ROOT_FOLDER_ENTRYID PROP_TAG(PT_BINARY, pidSpecialMin + 0x1C) +#define PR_OFFLINE_MESSAGE_ENTRYID PROP_TAG(PT_BINARY, pidStoreMin + 0x0F) +#define PR_IPM_FAVORITES_ENTRYID PROP_TAG(PT_BINARY, pidStoreMin + 0x18) +#define PR_IPM_PUBLIC_FOLDERS_ENTRYID PROP_TAG(PT_BINARY, pidStoreMin + 0x19) +#define PR_FAVORITES_DEFAULT_NAME PROP_TAG(PT_STRING8, pidStoreMin + 0x1D) +#define PR_SYS_CONFIG_FOLDER_ENTRYID PROP_TAG(PT_BINARY, pidStoreMin + 0x1E) +#define PR_NNTP_ARTICLE_FOLDER_ENTRYID PROP_TAG(PT_BINARY, pidSpecialMin + 0x1A) +#define PR_EVENTS_ROOT_FOLDER_ENTRYID PROP_TAG(PT_BINARY, pidSpecialMin + 0xA) + +// Gateway stores +#define PR_GW_MTSIN_ENTRYID PROP_TAG(PT_BINARY, pidStoreMin + 0x10) +#define PR_GW_MTSOUT_ENTRYID PROP_TAG(PT_BINARY, pidStoreMin + 0x11) +#define PR_TRANSFER_ENABLED PROP_TAG(PT_BOOLEAN, pidStoreMin + 0x12) // This property is preinitialized to 256 bytes of zeros // GetProp on this property is guaranteed to RPC. May be used // to determine line speed of connection to server. -#define PR_TEST_LINE_SPEED PROP_TAG( PT_BINARY, pidStoreMin+0x13) +#define PR_TEST_LINE_SPEED PROP_TAG(PT_BINARY, pidStoreMin + 0x13) // Used with OpenProperty to get interface, also on folders -#define PR_HIERARCHY_SYNCHRONIZER PROP_TAG( PT_OBJECT, pidStoreMin+0x14) -#define PR_CONTENTS_SYNCHRONIZER PROP_TAG( PT_OBJECT, pidStoreMin+0x15) -#define PR_COLLECTOR PROP_TAG( PT_OBJECT, pidStoreMin+0x16) +#define PR_HIERARCHY_SYNCHRONIZER PROP_TAG(PT_OBJECT, pidStoreMin + 0x14) +#define PR_CONTENTS_SYNCHRONIZER PROP_TAG(PT_OBJECT, pidStoreMin + 0x15) +#define PR_COLLECTOR PROP_TAG(PT_OBJECT, pidStoreMin + 0x16) // Used with OpenProperty to get interface for folders, messages, attachmentson -#define PR_FAST_TRANSFER PROP_TAG( PT_OBJECT, pidStoreMin+0x17) +#define PR_FAST_TRANSFER PROP_TAG(PT_OBJECT, pidStoreMin + 0x17) // Used with OpenProperty to get interface for store object -#define PR_CHANGE_ADVISOR PROP_TAG( PT_OBJECT, pidStoreMin+0x1C) +#define PR_CHANGE_ADVISOR PROP_TAG(PT_OBJECT, pidStoreMin + 0x1C) // used to set the ics notification suppression guid -#define PR_CHANGE_NOTIFICATION_GUID PROP_TAG( PT_CLSID, pidStoreMin+0x1F) +#define PR_CHANGE_NOTIFICATION_GUID PROP_TAG(PT_CLSID, pidStoreMin + 0x1F) // This property is available on mailbox and public stores. If it exists // and its value is TRUE, the store is connected to the offline store provider. -#define PR_STORE_OFFLINE PROP_TAG( PT_BOOLEAN, pidStoreMin+0x1A) +#define PR_STORE_OFFLINE PROP_TAG(PT_BOOLEAN, pidStoreMin + 0x1A) // In transit state for store object. This state is // set when mail is being moved and it pauses mail delivery // to the mail box -#define PR_IN_TRANSIT PROP_TAG( PT_BOOLEAN, pidStoreMin) +#define PR_IN_TRANSIT PROP_TAG(PT_BOOLEAN, pidStoreMin) // Writable only with Admin rights, available on public stores and folders -#define PR_REPLICATION_STYLE PROP_TAG( PT_LONG, pidAdminMin) -#define PR_REPLICATION_SCHEDULE PROP_TAG( PT_BINARY, pidAdminMin+0x01) -#define PR_REPLICATION_MESSAGE_PRIORITY PROP_TAG( PT_LONG, pidAdminMin+0x02) +#define PR_REPLICATION_STYLE PROP_TAG(PT_LONG, pidAdminMin) +#define PR_REPLICATION_SCHEDULE PROP_TAG(PT_BINARY, pidAdminMin + 0x01) +#define PR_REPLICATION_MESSAGE_PRIORITY PROP_TAG(PT_LONG, pidAdminMin + 0x02) // Writable only with Admin rights, available on public stores -#define PR_OVERALL_MSG_AGE_LIMIT PROP_TAG( PT_LONG, pidAdminMin+0x03 ) -#define PR_REPLICATION_ALWAYS_INTERVAL PROP_TAG( PT_LONG, pidAdminMin+0x04 ) -#define PR_REPLICATION_MSG_SIZE PROP_TAG( PT_LONG, pidAdminMin+0x05 ) +#define PR_OVERALL_MSG_AGE_LIMIT PROP_TAG(PT_LONG, pidAdminMin + 0x03) +#define PR_REPLICATION_ALWAYS_INTERVAL PROP_TAG(PT_LONG, pidAdminMin + 0x04) +#define PR_REPLICATION_MSG_SIZE PROP_TAG(PT_LONG, pidAdminMin + 0x05) // default replication style=always interval (minutes) -#define STYLE_ALWAYS_INTERVAL_DEFAULT (ULONG) 15 +#define STYLE_ALWAYS_INTERVAL_DEFAULT (ULONG)15 // default replication message size limit (KB) -#define REPLICATION_MESSAGE_SIZE_LIMIT_DEFAULT (ULONG) 300 +#define REPLICATION_MESSAGE_SIZE_LIMIT_DEFAULT (ULONG)300 // Values for PR_REPLICATION_STYLE -#define STYLE_NEVER (ULONG) 0 // never replicate -#define STYLE_NORMAL (ULONG) 1 // use 84 byte schedule TIB -#define STYLE_ALWAYS (ULONG) 2 // replicate at fastest rate -#define STYLE_DEFAULT (ULONG) -1 // default value +#define STYLE_NEVER (ULONG)0 // never replicate +#define STYLE_NORMAL (ULONG)1 // use 84 byte schedule TIB +#define STYLE_ALWAYS (ULONG)2 // replicate at fastest rate +#define STYLE_DEFAULT (ULONG) - 1 // default value /*------------------------------------------------------------------------ * @@ -301,16 +296,16 @@ * *-----------------------------------------------------------------------*/ -#define PR_SOURCE_KEY PROP_TAG( PT_BINARY, pidExchangeNonXmitReservedMin+0x0) -#define PR_PARENT_SOURCE_KEY PROP_TAG( PT_BINARY, pidExchangeNonXmitReservedMin+0x1) -#define PR_CHANGE_KEY PROP_TAG( PT_BINARY, pidExchangeNonXmitReservedMin+0x2) -#define PR_PREDECESSOR_CHANGE_LIST PROP_TAG( PT_BINARY, pidExchangeNonXmitReservedMin+0x3) +#define PR_SOURCE_KEY PROP_TAG(PT_BINARY, pidExchangeNonXmitReservedMin + 0x0) +#define PR_PARENT_SOURCE_KEY PROP_TAG(PT_BINARY, pidExchangeNonXmitReservedMin + 0x1) +#define PR_CHANGE_KEY PROP_TAG(PT_BINARY, pidExchangeNonXmitReservedMin + 0x2) +#define PR_PREDECESSOR_CHANGE_LIST PROP_TAG(PT_BINARY, pidExchangeNonXmitReservedMin + 0x3) // msg-folder only property // actual FID for a msg-folder row // ptagFID for message rows // ptagInstanceID for subfolder rows -#define PR_SOURCE_FID PROP_TAG(PT_I8, pidStoreNonTransMin+0x1F) +#define PR_SOURCE_FID PROP_TAG(PT_I8, pidStoreNonTransMin + 0x1F) /*------------------------------------------------------------------------ * @@ -320,92 +315,91 @@ // folders table property used by PKM to define the catalog guid for content // indexing and searching; doubles as index enable/disable -#define PR_CATALOG PROP_TAG(PT_BINARY, pidStoreNonTransMin+0x1B) +#define PR_CATALOG PROP_TAG(PT_BINARY, pidStoreNonTransMin + 0x1B) // Is CI searching enabled on this folder? -#define PR_CI_SEARCH_ENABLED PROP_TAG(PT_BOOLEAN, pidStoreNonTransMin+0x1C) +#define PR_CI_SEARCH_ENABLED PROP_TAG(PT_BOOLEAN, pidStoreNonTransMin + 0x1C) // Is notification-based indexing enabled on this folder? -#define PR_CI_NOTIFICATION_ENABLED PROP_TAG(PT_BOOLEAN, pidStoreNonTransMin+0x1D) +#define PR_CI_NOTIFICATION_ENABLED PROP_TAG(PT_BOOLEAN, pidStoreNonTransMin + 0x1D) // Max number of cached view allowed -#define PR_MAX_CACHED_VIEWS PROP_TAG(PT_LONG, pidStoreNonTransMin+0x28) +#define PR_MAX_CACHED_VIEWS PROP_TAG(PT_LONG, pidStoreNonTransMin + 0x28) // Max number of indices allowed // Review : this ptag is used for PR_MIME_HANDLER_CLASSIDS, but because the context // is different I am reusing it here. -#define PR_MAX_INDICES PROP_TAG(PT_LONG, pidStoreNonTransMin+0x1E) +#define PR_MAX_INDICES PROP_TAG(PT_LONG, pidStoreNonTransMin + 0x1E) // folders table property containing list of guid/restriction pairs -#define PR_IMPLIED_RESTRICTIONS PROP_TAG( PT_MV_BINARY, pidSpecialMin+0x0F) +#define PR_IMPLIED_RESTRICTIONS PROP_TAG(PT_MV_BINARY, pidSpecialMin + 0x0F) // Read only, available on all folders -#define PR_FOLDER_CHILD_COUNT PROP_TAG( PT_LONG, pidFolderMin) -#define PR_RIGHTS PROP_TAG( PT_LONG, pidFolderMin+0x01) -#define PR_ACL_TABLE PROP_TAG( PT_OBJECT, pidExchangeXmitReservedMin) -#define PR_RULES_TABLE PROP_TAG( PT_OBJECT, pidExchangeXmitReservedMin+0x1) -#define PR_HAS_RULES PROP_TAG( PT_BOOLEAN, pidFolderMin+0x02) -#define PR_HAS_MODERATOR_RULES PROP_TAG( PT_BOOLEAN, pidFolderMin+0x07 ) - -//Read only, available only for public folders -#define PR_ADDRESS_BOOK_ENTRYID PROP_TAG( PT_BINARY, pidFolderMin+0x03) - -//Writable, available on folders in all stores -#define PR_ACL_DATA PROP_TAG( PT_BINARY, pidExchangeXmitReservedMin) -#define PR_RULES_DATA PROP_TAG( PT_BINARY, pidExchangeXmitReservedMin+0x1) -#define PR_EXTENDED_ACL_DATA PROP_TAG( PT_BINARY, pidExchangeXmitReservedMin+0x1E) -#define PR_FOLDER_DESIGN_FLAGS PROP_TAG( PT_LONG, pidExchangeXmitReservedMin+0x2) -#define PR_DESIGN_IN_PROGRESS PROP_TAG( PT_BOOLEAN, pidExchangeXmitReservedMin+0x4) -#define PR_SECURE_ORIGINATION PROP_TAG( PT_BOOLEAN, pidExchangeXmitReservedMin+0x5) - -//Writable, available only for public folders -#define PR_PUBLISH_IN_ADDRESS_BOOK PROP_TAG( PT_BOOLEAN, pidExchangeXmitReservedMin+0x6) -#define PR_RESOLVE_METHOD PROP_TAG( PT_LONG, pidExchangeXmitReservedMin+0x7) -#define PR_ADDRESS_BOOK_DISPLAY_NAME PROP_TAG( PT_TSTRING, pidExchangeXmitReservedMin+0x8) - -//Writable, used to indicate locale id for eforms registry subfolders -#define PR_EFORMS_LOCALE_ID PROP_TAG( PT_LONG, pidExchangeXmitReservedMin+0x9) +#define PR_FOLDER_CHILD_COUNT PROP_TAG(PT_LONG, pidFolderMin) +#define PR_RIGHTS PROP_TAG(PT_LONG, pidFolderMin + 0x01) +#define PR_ACL_TABLE PROP_TAG(PT_OBJECT, pidExchangeXmitReservedMin) +#define PR_RULES_TABLE PROP_TAG(PT_OBJECT, pidExchangeXmitReservedMin + 0x1) +#define PR_HAS_RULES PROP_TAG(PT_BOOLEAN, pidFolderMin + 0x02) +#define PR_HAS_MODERATOR_RULES PROP_TAG(PT_BOOLEAN, pidFolderMin + 0x07) + +// Read only, available only for public folders +#define PR_ADDRESS_BOOK_ENTRYID PROP_TAG(PT_BINARY, pidFolderMin + 0x03) + +// Writable, available on folders in all stores +#define PR_ACL_DATA PROP_TAG(PT_BINARY, pidExchangeXmitReservedMin) +#define PR_RULES_DATA PROP_TAG(PT_BINARY, pidExchangeXmitReservedMin + 0x1) +#define PR_EXTENDED_ACL_DATA PROP_TAG(PT_BINARY, pidExchangeXmitReservedMin + 0x1E) +#define PR_FOLDER_DESIGN_FLAGS PROP_TAG(PT_LONG, pidExchangeXmitReservedMin + 0x2) +#define PR_DESIGN_IN_PROGRESS PROP_TAG(PT_BOOLEAN, pidExchangeXmitReservedMin + 0x4) +#define PR_SECURE_ORIGINATION PROP_TAG(PT_BOOLEAN, pidExchangeXmitReservedMin + 0x5) + +// Writable, available only for public folders +#define PR_PUBLISH_IN_ADDRESS_BOOK PROP_TAG(PT_BOOLEAN, pidExchangeXmitReservedMin + 0x6) +#define PR_RESOLVE_METHOD PROP_TAG(PT_LONG, pidExchangeXmitReservedMin + 0x7) +#define PR_ADDRESS_BOOK_DISPLAY_NAME PROP_TAG(PT_TSTRING, pidExchangeXmitReservedMin + 0x8) + +// Writable, used to indicate locale id for eforms registry subfolders +#define PR_EFORMS_LOCALE_ID PROP_TAG(PT_LONG, pidExchangeXmitReservedMin + 0x9) // Writable only with Admin rights, available only for public folders -#define PR_REPLICA_LIST PROP_TAG( PT_BINARY, pidAdminMin+0x8) -#define PR_OVERALL_AGE_LIMIT PROP_TAG( PT_LONG, pidAdminMin+0x9) +#define PR_REPLICA_LIST PROP_TAG(PT_BINARY, pidAdminMin + 0x8) +#define PR_OVERALL_AGE_LIMIT PROP_TAG(PT_LONG, pidAdminMin + 0x9) // Newsgroup related properties. Writable only with Admin rights. -#define PR_IS_NEWSGROUP_ANCHOR PROP_TAG( PT_BOOLEAN, pidAdminMin+0x06) -#define PR_IS_NEWSGROUP PROP_TAG( PT_BOOLEAN, pidAdminMin+0x07) -#define PR_NEWSGROUP_COMPONENT PROP_TAG( PT_STRING8, pidAdminMin+0x15) -#define PR_INTERNET_NEWSGROUP_NAME PROP_TAG( PT_STRING8, pidAdminMin+0x17) -#define PR_NEWSFEED_INFO PROP_TAG( PT_BINARY, pidAdminMin+0x16) +#define PR_IS_NEWSGROUP_ANCHOR PROP_TAG(PT_BOOLEAN, pidAdminMin + 0x06) +#define PR_IS_NEWSGROUP PROP_TAG(PT_BOOLEAN, pidAdminMin + 0x07) +#define PR_NEWSGROUP_COMPONENT PROP_TAG(PT_STRING8, pidAdminMin + 0x15) +#define PR_INTERNET_NEWSGROUP_NAME PROP_TAG(PT_STRING8, pidAdminMin + 0x17) +#define PR_NEWSFEED_INFO PROP_TAG(PT_BINARY, pidAdminMin + 0x16) // Newsgroup related property. -#define PR_PREVENT_MSG_CREATE PROP_TAG( PT_BOOLEAN, pidExchangeNonXmitReservedMin+0x14) +#define PR_PREVENT_MSG_CREATE PROP_TAG(PT_BOOLEAN, pidExchangeNonXmitReservedMin + 0x14) // IMAP internal date -#define PR_IMAP_INTERNAL_DATE PROP_TAG( PT_SYSTIME, pidExchangeNonXmitReservedMin+0x15) +#define PR_IMAP_INTERNAL_DATE PROP_TAG(PT_SYSTIME, pidExchangeNonXmitReservedMin + 0x15) // Virtual properties to refer to Newsfeed DNs. Cannot get/set these on // any object. Supported currently only in specifying restrictions. -#define PR_INBOUND_NEWSFEED_DN PROP_TAG( PT_STRING8, pidSpecialMin+0x1D) -#define PR_OUTBOUND_NEWSFEED_DN PROP_TAG( PT_STRING8, pidSpecialMin+0x1E) +#define PR_INBOUND_NEWSFEED_DN PROP_TAG(PT_STRING8, pidSpecialMin + 0x1D) +#define PR_OUTBOUND_NEWSFEED_DN PROP_TAG(PT_STRING8, pidSpecialMin + 0x1E) // Used for controlling content conversion in NNTP -#define PR_INTERNET_CHARSET PROP_TAG( PT_TSTRING, pidAdminMin+0xA) +#define PR_INTERNET_CHARSET PROP_TAG(PT_TSTRING, pidAdminMin + 0xA) -//PR_RESOLVE_METHOD values -#define RESOLVE_METHOD_DEFAULT ((LONG)0) // default handling attach conflicts -#define RESOLVE_METHOD_LAST_WRITER_WINS ((LONG)1) // the last writer will win conflict -#define RESOLVE_METHOD_NO_CONFLICT_NOTIFICATION ((LONG)2) // no conflict notif +// PR_RESOLVE_METHOD values +#define RESOLVE_METHOD_DEFAULT ((LONG)0) // default handling attach conflicts +#define RESOLVE_METHOD_LAST_WRITER_WINS ((LONG)1) // the last writer will win conflict +#define RESOLVE_METHOD_NO_CONFLICT_NOTIFICATION ((LONG)2) // no conflict notif -//Read only, available only for public folder favorites -#define PR_PUBLIC_FOLDER_ENTRYID PROP_TAG( PT_BINARY, pidFolderMin+0x04) +// Read only, available only for public folder favorites +#define PR_PUBLIC_FOLDER_ENTRYID PROP_TAG(PT_BINARY, pidFolderMin + 0x04) -//Read only. changes everytime a subfolder is created or deleted -#define PR_HIERARCHY_CHANGE_NUM PROP_TAG( PT_LONG, pidFolderMin+0x06) +// Read only. changes everytime a subfolder is created or deleted +#define PR_HIERARCHY_CHANGE_NUM PROP_TAG(PT_LONG, pidFolderMin + 0x06) // For IFS/OLEDB to set and get user sid in LOGON -#define PR_USER_SID PROP_TAG(PT_BINARY, PROP_ID(ptagSearchState)) // pidInternalNoAccessNonTransMin+0x23) -#define PR_CREATOR_TOKEN PR_USER_SID - +#define PR_USER_SID PROP_TAG(PT_BINARY, PROP_ID(ptagSearchState)) // pidInternalNoAccessNonTransMin+0x23) +#define PR_CREATOR_TOKEN PR_USER_SID /*------------------------------------------------------------------------ * @@ -414,141 +408,140 @@ *-----------------------------------------------------------------------*/ // Read only, automatically set on all messages in all stores -#define PR_HAS_NAMED_PROPERTIES PROP_TAG(PT_BOOLEAN, pidMessageReadOnlyMin+0x0A) +#define PR_HAS_NAMED_PROPERTIES PROP_TAG(PT_BOOLEAN, pidMessageReadOnlyMin + 0x0A) // Read only but outside the provider specific range for replication thru GDK-GWs -#define PR_CREATOR_NAME PROP_TAG(PT_TSTRING, pidExchangeXmitReservedMin+0x18) -#define PR_CREATOR_ENTRYID PROP_TAG(PT_BINARY, pidExchangeXmitReservedMin+0x19) -#define PR_LAST_MODIFIER_NAME PROP_TAG(PT_TSTRING, pidExchangeXmitReservedMin+0x1A) -#define PR_LAST_MODIFIER_ENTRYID PROP_TAG(PT_BINARY, pidExchangeXmitReservedMin+0x1B) -#define PR_REPLY_RECIPIENT_SMTP_PROXIES PROP_TAG(PT_TSTRING, pidExchangeXmitReservedMin+0x1C) +#define PR_CREATOR_NAME PROP_TAG(PT_TSTRING, pidExchangeXmitReservedMin + 0x18) +#define PR_CREATOR_ENTRYID PROP_TAG(PT_BINARY, pidExchangeXmitReservedMin + 0x19) +#define PR_LAST_MODIFIER_NAME PROP_TAG(PT_TSTRING, pidExchangeXmitReservedMin + 0x1A) +#define PR_LAST_MODIFIER_ENTRYID PROP_TAG(PT_BINARY, pidExchangeXmitReservedMin + 0x1B) +#define PR_REPLY_RECIPIENT_SMTP_PROXIES PROP_TAG(PT_TSTRING, pidExchangeXmitReservedMin + 0x1C) // Read only, appears on messages which have DAM's pointing to them -#define PR_HAS_DAMS PROP_TAG( PT_BOOLEAN, pidExchangeXmitReservedMin+0x0A) -#define PR_RULE_TRIGGER_HISTORY PROP_TAG( PT_BINARY, pidExchangeXmitReservedMin+0x12) -#define PR_MOVE_TO_STORE_ENTRYID PROP_TAG( PT_BINARY, pidExchangeXmitReservedMin+0x13) -#define PR_MOVE_TO_FOLDER_ENTRYID PROP_TAG( PT_BINARY, pidExchangeXmitReservedMin+0x14) +#define PR_HAS_DAMS PROP_TAG(PT_BOOLEAN, pidExchangeXmitReservedMin + 0x0A) +#define PR_RULE_TRIGGER_HISTORY PROP_TAG(PT_BINARY, pidExchangeXmitReservedMin + 0x12) +#define PR_MOVE_TO_STORE_ENTRYID PROP_TAG(PT_BINARY, pidExchangeXmitReservedMin + 0x13) +#define PR_MOVE_TO_FOLDER_ENTRYID PROP_TAG(PT_BINARY, pidExchangeXmitReservedMin + 0x14) // Read only, available only on messages in the public store -#define PR_REPLICA_SERVER PROP_TAG(PT_TSTRING, pidMessageReadOnlyMin+0x04) -#define PR_REPLICA_VERSION PROP_TAG(PT_I8, pidMessageReadOnlyMin+0x0B) +#define PR_REPLICA_SERVER PROP_TAG(PT_TSTRING, pidMessageReadOnlyMin + 0x04) +#define PR_REPLICA_VERSION PROP_TAG(PT_I8, pidMessageReadOnlyMin + 0x0B) // SID versions of standard messaging properties -#define PR_CREATOR_SID PROP_TAG(PT_BINARY, pidStoreNonTransMin+0x18) -#define PR_LAST_MODIFIER_SID PROP_TAG(PT_BINARY, pidStoreNonTransMin+0x19) -#define PR_SENDER_SID PROP_TAG(PT_BINARY, pidStoreNonTransMin+0x0d) -#define PR_SENT_REPRESENTING_SID PROP_TAG(PT_BINARY, pidStoreNonTransMin+0x0e) -#define PR_ORIGINAL_SENDER_SID PROP_TAG(PT_BINARY, pidStoreNonTransMin+0x0f) -#define PR_ORIGINAL_SENT_REPRESENTING_SID PROP_TAG(PT_BINARY, pidStoreNonTransMin+0x10) -#define PR_READ_RECEIPT_SID PROP_TAG(PT_BINARY, pidStoreNonTransMin+0x11) -#define PR_REPORT_SID PROP_TAG(PT_BINARY, pidStoreNonTransMin+0x12) -#define PR_ORIGINATOR_SID PROP_TAG(PT_BINARY, pidStoreNonTransMin+0x13) -#define PR_REPORT_DESTINATION_SID PROP_TAG(PT_BINARY, pidStoreNonTransMin+0x14) -#define PR_ORIGINAL_AUTHOR_SID PROP_TAG(PT_BINARY, pidStoreNonTransMin+0x15) -#define PR_RECEIVED_BY_SID PROP_TAG(PT_BINARY, pidStoreNonTransMin+0x16) -#define PR_RCVD_REPRESENTING_SID PROP_TAG(PT_BINARY, pidStoreNonTransMin+0x17) - -#define PR_TRUST_SENDER_NO 0x00000000L -#define PR_TRUST_SENDER_YES 0x00000001L -#define PR_TRUST_SENDER PROP_TAG(PT_LONG, pidStoreNonTransMin+0x39) +#define PR_CREATOR_SID PROP_TAG(PT_BINARY, pidStoreNonTransMin + 0x18) +#define PR_LAST_MODIFIER_SID PROP_TAG(PT_BINARY, pidStoreNonTransMin + 0x19) +#define PR_SENDER_SID PROP_TAG(PT_BINARY, pidStoreNonTransMin + 0x0d) +#define PR_SENT_REPRESENTING_SID PROP_TAG(PT_BINARY, pidStoreNonTransMin + 0x0e) +#define PR_ORIGINAL_SENDER_SID PROP_TAG(PT_BINARY, pidStoreNonTransMin + 0x0f) +#define PR_ORIGINAL_SENT_REPRESENTING_SID PROP_TAG(PT_BINARY, pidStoreNonTransMin + 0x10) +#define PR_READ_RECEIPT_SID PROP_TAG(PT_BINARY, pidStoreNonTransMin + 0x11) +#define PR_REPORT_SID PROP_TAG(PT_BINARY, pidStoreNonTransMin + 0x12) +#define PR_ORIGINATOR_SID PROP_TAG(PT_BINARY, pidStoreNonTransMin + 0x13) +#define PR_REPORT_DESTINATION_SID PROP_TAG(PT_BINARY, pidStoreNonTransMin + 0x14) +#define PR_ORIGINAL_AUTHOR_SID PROP_TAG(PT_BINARY, pidStoreNonTransMin + 0x15) +#define PR_RECEIVED_BY_SID PROP_TAG(PT_BINARY, pidStoreNonTransMin + 0x16) +#define PR_RCVD_REPRESENTING_SID PROP_TAG(PT_BINARY, pidStoreNonTransMin + 0x17) + +#define PR_TRUST_SENDER_NO 0x00000000L +#define PR_TRUST_SENDER_YES 0x00000001L +#define PR_TRUST_SENDER PROP_TAG(PT_LONG, pidStoreNonTransMin + 0x39) // XML versions of SID properties -#define PR_CREATOR_SID_AS_XML PROP_TAG(PT_TSTRING, pidStoreNonTransMin+0x2C) -#define PR_LAST_MODIFIER_SID_AS_XML PROP_TAG(PT_TSTRING, pidStoreNonTransMin+0x2D) -#define PR_SENDER_SID_AS_XML PROP_TAG(PT_TSTRING, pidStoreNonTransMin+0x2E) -#define PR_SENT_REPRESENTING_SID_AS_XML PROP_TAG(PT_TSTRING, pidStoreNonTransMin+0x2F) -#define PR_ORIGINAL_SENDER_SID_AS_XML PROP_TAG(PT_TSTRING, pidStoreNonTransMin+0x30) -#define PR_ORIGINAL_SENT_REPRESENTING_SID_AS_XML PROP_TAG(PT_TSTRING, pidStoreNonTransMin+0x31) -#define PR_READ_RECEIPT_SID_AS_XML PROP_TAG(PT_TSTRING, pidStoreNonTransMin+0x32) -#define PR_REPORT_SID_AS_XML PROP_TAG(PT_TSTRING, pidStoreNonTransMin+0x33) -#define PR_ORIGINATOR_SID_AS_XML PROP_TAG(PT_TSTRING, pidStoreNonTransMin+0x34) -#define PR_REPORT_DESTINATION_SID_AS_XML PROP_TAG(PT_TSTRING, pidStoreNonTransMin+0x35) -#define PR_ORIGINAL_AUTHOR_SID_AS_XML PROP_TAG(PT_TSTRING, pidStoreNonTransMin+0x36) -#define PR_RECEIVED_BY_SID_AS_XML PROP_TAG(PT_TSTRING, pidStoreNonTransMin+0x37) -#define PR_RCVD_REPRESENTING_SID_AS_XML PROP_TAG(PT_TSTRING, pidStoreNonTransMin+0x38) - +#define PR_CREATOR_SID_AS_XML PROP_TAG(PT_TSTRING, pidStoreNonTransMin + 0x2C) +#define PR_LAST_MODIFIER_SID_AS_XML PROP_TAG(PT_TSTRING, pidStoreNonTransMin + 0x2D) +#define PR_SENDER_SID_AS_XML PROP_TAG(PT_TSTRING, pidStoreNonTransMin + 0x2E) +#define PR_SENT_REPRESENTING_SID_AS_XML PROP_TAG(PT_TSTRING, pidStoreNonTransMin + 0x2F) +#define PR_ORIGINAL_SENDER_SID_AS_XML PROP_TAG(PT_TSTRING, pidStoreNonTransMin + 0x30) +#define PR_ORIGINAL_SENT_REPRESENTING_SID_AS_XML PROP_TAG(PT_TSTRING, pidStoreNonTransMin + 0x31) +#define PR_READ_RECEIPT_SID_AS_XML PROP_TAG(PT_TSTRING, pidStoreNonTransMin + 0x32) +#define PR_REPORT_SID_AS_XML PROP_TAG(PT_TSTRING, pidStoreNonTransMin + 0x33) +#define PR_ORIGINATOR_SID_AS_XML PROP_TAG(PT_TSTRING, pidStoreNonTransMin + 0x34) +#define PR_REPORT_DESTINATION_SID_AS_XML PROP_TAG(PT_TSTRING, pidStoreNonTransMin + 0x35) +#define PR_ORIGINAL_AUTHOR_SID_AS_XML PROP_TAG(PT_TSTRING, pidStoreNonTransMin + 0x36) +#define PR_RECEIVED_BY_SID_AS_XML PROP_TAG(PT_TSTRING, pidStoreNonTransMin + 0x37) +#define PR_RCVD_REPRESENTING_SID_AS_XML PROP_TAG(PT_TSTRING, pidStoreNonTransMin + 0x38) // those two are pseudo-properties on folder. calling OFOLD::EcGetProps(PR_RESERVE_RANGE_OF_IDS) is // equivalent to calling EcGetLocalRepIdsOp(), calling OFOLD::EcSetProps(PR_MERGE_MIDSET_DELETED) // is equivalen to calling OFOLD::EcSetLocalRepMidsetDeleted() -#define PR_MERGE_MIDSET_DELETED PROP_TAG(PT_BINARY, pidStoreNonTransMin+0x3a) // 0x0E7A0102 -#define PR_RESERVE_RANGE_OF_IDS PROP_TAG(PT_BINARY, pidStoreNonTransMin+0x3b) // 0x0E7B0102 +#define PR_MERGE_MIDSET_DELETED PROP_TAG(PT_BINARY, pidStoreNonTransMin + 0x3a) // 0x0E7A0102 +#define PR_RESERVE_RANGE_OF_IDS PROP_TAG(PT_BINARY, pidStoreNonTransMin + 0x3b) // 0x0E7B0102 // computed message property (read only) // 44 byte binary property - used by PKM as globally unique message key // 22 bytes of global ID for FID // 22 bytes of global ID for VID -#define PR_FID_VID PROP_TAG(PT_BINARY, pidMessageReadOnlyMin+0x0C) -#define PR_FID_MID PR_FID_VID //NSK : temporary to allow transition +#define PR_FID_VID PROP_TAG(PT_BINARY, pidMessageReadOnlyMin + 0x0C) +#define PR_FID_MID PR_FID_VID // NSK : temporary to allow transition // message property - read only, xref ID in global ID format - used by PKM -#define PR_ORIGIN_ID PROP_TAG( PT_BINARY, pidMessageReadOnlyMin+0x0D) +#define PR_ORIGIN_ID PROP_TAG(PT_BINARY, pidMessageReadOnlyMin + 0x0D) // computed message property used in search folders to determine quality of // search hit match // NOTE: ptag.h consumers, see also ptagMsgFolderTemplateRes3 -#define PR_RANK PROP_TAG( PT_LONG, pidAdminMin+0x82 ) +#define PR_RANK PROP_TAG(PT_LONG, pidAdminMin + 0x82) // msg-folder property, read only // value is PR_MSG_DELIVERY_TIME if it exists, else PR_CREATION_TIME // used as the default sort time when subfolder rows are returned in views -#define PR_MSG_FOLD_TIME PROP_TAG( PT_SYSTIME, pidMessageReadOnlyMin+0x14) -#define PR_ICS_CHANGE_KEY PROP_TAG( PT_BINARY, pidMessageReadOnlyMin+0x15) +#define PR_MSG_FOLD_TIME PROP_TAG(PT_SYSTIME, pidMessageReadOnlyMin + 0x14) +#define PR_ICS_CHANGE_KEY PROP_TAG(PT_BINARY, pidMessageReadOnlyMin + 0x15) -#define PR_DEFERRED_SEND_NUMBER PROP_TAG( PT_LONG, pidExchangeXmitReservedMin+0xB) -#define PR_DEFERRED_SEND_UNITS PROP_TAG( PT_LONG, pidExchangeXmitReservedMin+0xC) -#define PR_EXPIRY_NUMBER PROP_TAG( PT_LONG, pidExchangeXmitReservedMin+0xD) -#define PR_EXPIRY_UNITS PROP_TAG( PT_LONG, pidExchangeXmitReservedMin+0xE) +#define PR_DEFERRED_SEND_NUMBER PROP_TAG(PT_LONG, pidExchangeXmitReservedMin + 0xB) +#define PR_DEFERRED_SEND_UNITS PROP_TAG(PT_LONG, pidExchangeXmitReservedMin + 0xC) +#define PR_EXPIRY_NUMBER PROP_TAG(PT_LONG, pidExchangeXmitReservedMin + 0xD) +#define PR_EXPIRY_UNITS PROP_TAG(PT_LONG, pidExchangeXmitReservedMin + 0xE) // Writeable, deferred send time -#define PR_DEFERRED_SEND_TIME PROP_TAG( PT_SYSTIME, pidExchangeXmitReservedMin+0xF) +#define PR_DEFERRED_SEND_TIME PROP_TAG(PT_SYSTIME, pidExchangeXmitReservedMin + 0xF) -//Writeable, intended for both folders and messages in gateway mailbox -#define PR_GW_ADMIN_OPERATIONS PROP_TAG( PT_LONG, pidMessageWriteableMin) +// Writeable, intended for both folders and messages in gateway mailbox +#define PR_GW_ADMIN_OPERATIONS PROP_TAG(PT_LONG, pidMessageWriteableMin) -//Writeable, used for DMS messages -#define PR_P1_CONTENT PROP_TAG( PT_BINARY, 0x1100) -#define PR_P1_CONTENT_TYPE PROP_TAG( PT_BINARY, 0x1101) +// Writeable, used for DMS messages +#define PR_P1_CONTENT PROP_TAG(PT_BINARY, 0x1100) +#define PR_P1_CONTENT_TYPE PROP_TAG(PT_BINARY, 0x1101) // Properties on deferred action messages -#define PR_CLIENT_ACTIONS PROP_TAG(PT_BINARY, pidMessageReadOnlyMin+0x5) -#define PR_DAM_ORIGINAL_ENTRYID PROP_TAG(PT_BINARY, pidMessageReadOnlyMin+0x6) -#define PR_DAM_BACK_PATCHED PROP_TAG( PT_BOOLEAN, pidMessageReadOnlyMin+0x7) +#define PR_CLIENT_ACTIONS PROP_TAG(PT_BINARY, pidMessageReadOnlyMin + 0x5) +#define PR_DAM_ORIGINAL_ENTRYID PROP_TAG(PT_BINARY, pidMessageReadOnlyMin + 0x6) +#define PR_DAM_BACK_PATCHED PROP_TAG(PT_BOOLEAN, pidMessageReadOnlyMin + 0x7) // Properties on deferred action error messages -#define PR_RULE_ERROR PROP_TAG(PT_LONG, pidMessageReadOnlyMin+0x8) -#define PR_RULE_ACTION_TYPE PROP_TAG(PT_LONG, pidMessageReadOnlyMin+0x9) -#define PR_RULE_ACTION_NUMBER PROP_TAG(PT_LONG, pidMessageReadOnlyMin+0x10) -#define PR_RULE_FOLDER_ENTRYID PROP_TAG(PT_BINARY, pidMessageReadOnlyMin+0x11) +#define PR_RULE_ERROR PROP_TAG(PT_LONG, pidMessageReadOnlyMin + 0x8) +#define PR_RULE_ACTION_TYPE PROP_TAG(PT_LONG, pidMessageReadOnlyMin + 0x9) +#define PR_RULE_ACTION_NUMBER PROP_TAG(PT_LONG, pidMessageReadOnlyMin + 0x10) +#define PR_RULE_FOLDER_ENTRYID PROP_TAG(PT_BINARY, pidMessageReadOnlyMin + 0x11) // Mime representation of a message. // Defined as 3 different types for convenience. Will be stored as file handle // internally. -#define PR_INTERNET_CONTENT PROP_TAG(PT_BINARY, pidMessageWriteableMin+0x1) -#define PR_INTERNET_CONTENT_HANDLE PROP_TAG(PT_FILE_HANDLE, pidMessageWriteableMin+0x1) -#define PR_INTERNET_CONTENT_EA PROP_TAG(PT_FILE_EA, pidMessageWriteableMin+0x1) +#define PR_INTERNET_CONTENT PROP_TAG(PT_BINARY, pidMessageWriteableMin + 0x1) +#define PR_INTERNET_CONTENT_HANDLE PROP_TAG(PT_FILE_HANDLE, pidMessageWriteableMin + 0x1) +#define PR_INTERNET_CONTENT_EA PROP_TAG(PT_FILE_EA, pidMessageWriteableMin + 0x1) // Dot-stuff state property on message -#define PR_DOTSTUFF_STATE PROP_TAG(PT_LONG, pidUserNonTransmitMin+0x1) +#define PR_DOTSTUFF_STATE PROP_TAG(PT_LONG, pidUserNonTransmitMin + 0x1) // Raw byte count of mime stream, if mime exists. -#define PR_MIME_SIZE PROP_TAG(PT_LONG, 0x6746) -#define PR_MIME_SIZE_EXTENDED PROP_TAG(PT_I8, 0x6746) +#define PR_MIME_SIZE PROP_TAG(PT_LONG, 0x6746) +#define PR_MIME_SIZE_EXTENDED PROP_TAG(PT_I8, 0x6746) // Raw byte count of ptagInternetContent, whether it is a mime message // or freedoc using OURL -#define PR_FILE_SIZE PROP_TAG(PT_LONG, 0x6747) -#define PR_FILE_SIZE_EXTENDED PROP_TAG(PT_I8, 0x6747) +#define PR_FILE_SIZE PROP_TAG(PT_LONG, 0x6747) +#define PR_FILE_SIZE_EXTENDED PROP_TAG(PT_I8, 0x6747) // Sender's editor format -#define PR_MSG_EDITOR_FORMAT PROP_TAG( PT_LONG, 0x5909 ) +#define PR_MSG_EDITOR_FORMAT PROP_TAG(PT_LONG, 0x5909) -#define EDITOR_FORMAT_DONTKNOW ((ULONG)0) -#define EDITOR_FORMAT_PLAINTEXT ((ULONG)1) -#define EDITOR_FORMAT_HTML ((ULONG)2) -#define EDITOR_FORMAT_RTF ((ULONG)3) +#define EDITOR_FORMAT_DONTKNOW ((ULONG)0) +#define EDITOR_FORMAT_PLAINTEXT ((ULONG)1) +#define EDITOR_FORMAT_HTML ((ULONG)2) +#define EDITOR_FORMAT_RTF ((ULONG)3) -#ifdef pidInternalWriteableNonTransMin +#ifdef pidInternalWriteableNonTransMin #if pidInternalWritableNonTranMin - 0x6740 #pragma error("pidInternalWritableNonTransMin definition has changed, must change definition of PR_MIME_SIZE") #endif @@ -556,72 +549,70 @@ // State of this inid as far as conversion is concerned. // Reusing mailbox table property -#define PR_CONVERSION_STATE PROP_TAG(PT_LONG, PROP_ID(ptagAdminNickName)) +#define PR_CONVERSION_STATE PROP_TAG(PT_LONG, PROP_ID(ptagAdminNickName)) // Property to represent native html content - assumed to be in the internet // codepage as determined by PR_INTERNET_CPID // -#define PR_HTML PROP_TAG( PT_BINARY, PROP_ID( PR_BODY_HTML ) ) +#define PR_HTML PROP_TAG(PT_BINARY, PROP_ID(PR_BODY_HTML)) // computed property used for moderated folder rule -// its an EntryId whose value is: +// it's an EntryId whose value is: // ptagSenderEntryId on delivery // LOGON::PbUserEntryId() for all other cases (move/copy/post) -#define PR_ACTIVE_USER_ENTRYID PROP_TAG(PT_BINARY, pidMessageReadOnlyMin+0x12) +#define PR_ACTIVE_USER_ENTRYID PROP_TAG(PT_BINARY, pidMessageReadOnlyMin + 0x12) // Property on conflict notification indicating entryid of conflicting object -#define PR_CONFLICT_ENTRYID PROP_TAG(PT_BINARY, pidExchangeXmitReservedMin+0x10) +#define PR_CONFLICT_ENTRYID PROP_TAG(PT_BINARY, pidExchangeXmitReservedMin + 0x10) // Property on messages to indicate the language client used to create this message -#define PR_MESSAGE_LOCALE_ID PROP_TAG(PT_LONG, pidExchangeXmitReservedMin+0x11) -#define PR_MESSAGE_CODEPAGE PROP_TAG( PT_LONG, pidExchangeXmitReservedMin+0x1D) +#define PR_MESSAGE_LOCALE_ID PROP_TAG(PT_LONG, pidExchangeXmitReservedMin + 0x11) +#define PR_MESSAGE_CODEPAGE PROP_TAG(PT_LONG, pidExchangeXmitReservedMin + 0x1D) // Properties on Quota warning messages to indicate Storage quota and Excess used -#define PR_STORAGE_QUOTA_LIMIT PROP_TAG(PT_LONG, pidExchangeXmitReservedMin+0x15) -#define PR_EXCESS_STORAGE_USED PROP_TAG(PT_LONG, pidExchangeXmitReservedMin+0x16) -#define PR_SVR_GENERATING_QUOTA_MSG PROP_TAG(PT_TSTRING, pidExchangeXmitReservedMin+0x17) +#define PR_STORAGE_QUOTA_LIMIT PROP_TAG(PT_LONG, pidExchangeXmitReservedMin + 0x15) +#define PR_EXCESS_STORAGE_USED PROP_TAG(PT_LONG, pidExchangeXmitReservedMin + 0x16) +#define PR_SVR_GENERATING_QUOTA_MSG PROP_TAG(PT_TSTRING, pidExchangeXmitReservedMin + 0x17) // Property affixed by delegation rule and deleted on forwards -#define PR_DELEGATED_BY_RULE PROP_TAG( PT_BOOLEAN, pidExchangeXmitReservedMin+0x3) +#define PR_DELEGATED_BY_RULE PROP_TAG(PT_BOOLEAN, pidExchangeXmitReservedMin + 0x3) // Message status bit used to indicate message is in conflict -#define MSGSTATUS_IN_CONFLICT ((ULONG) 0x800) +#define MSGSTATUS_IN_CONFLICT ((ULONG)0x800) // Message status bit used to indicate the IMAP4 $MDNSent flag -#define MSGSTATUS_MDNSENT ((ULONG) 0x4000) +#define MSGSTATUS_MDNSENT ((ULONG)0x4000) // used to indicate how much X400 private extension data is present: none, just the // message level, or both the message and recipient levels // !!The high order byte of this ULONG is reserved.!! -#define ENV_BLANK ((ULONG)0x00000000) -#define ENV_RECIP_NUM ((ULONG)0x00000001) -#define ENV_MSG_EXT ((ULONG)0x00000002) -#define ENV_RECIP_EXT ((ULONG)0x00000004) +#define ENV_BLANK ((ULONG)0x00000000) +#define ENV_RECIP_NUM ((ULONG)0x00000001) +#define ENV_MSG_EXT ((ULONG)0x00000002) +#define ENV_RECIP_EXT ((ULONG)0x00000004) - - -#define PR_X400_ENVELOPE_TYPE PROP_TAG(PT_LONG, pidMessageReadOnlyMin+0x13) -#define X400_ENV_PLAIN (ENV_BLANK) // no extension -#define X400_ENV_VALID_RECIP (ENV_RECIP_NUM | ENV_MSG_EXT) // just the message level extension -#define X400_ENV_FULL_EXT (ENV_RECIP_NUM | ENV_MSG_EXT | ENV_RECIP_EXT) // both message and recipient levels +#define PR_X400_ENVELOPE_TYPE PROP_TAG(PT_LONG, pidMessageReadOnlyMin + 0x13) +#define X400_ENV_PLAIN (ENV_BLANK) // no extension +#define X400_ENV_VALID_RECIP (ENV_RECIP_NUM | ENV_MSG_EXT) // just the message level extension +#define X400_ENV_FULL_EXT (ENV_RECIP_NUM | ENV_MSG_EXT | ENV_RECIP_EXT) // both message and recipient levels // // bitmask that indicates whether RN, NRN, DR, NDR, OOF, Auto-Reply should be suppressed // -#define AUTO_RESPONSE_SUPPRESS_DR ((ULONG)0x00000001) -#define AUTO_RESPONSE_SUPPRESS_NDR ((ULONG)0x00000002) -#define AUTO_RESPONSE_SUPPRESS_RN ((ULONG)0x00000004) -#define AUTO_RESPONSE_SUPPRESS_NRN ((ULONG)0x00000008) -#define AUTO_RESPONSE_SUPPRESS_OOF ((ULONG)0x00000010) -#define AUTO_RESPONSE_SUPPRESS_AUTO_REPLY ((ULONG)0x00000020) +#define AUTO_RESPONSE_SUPPRESS_DR ((ULONG)0x00000001) +#define AUTO_RESPONSE_SUPPRESS_NDR ((ULONG)0x00000002) +#define AUTO_RESPONSE_SUPPRESS_RN ((ULONG)0x00000004) +#define AUTO_RESPONSE_SUPPRESS_NRN ((ULONG)0x00000008) +#define AUTO_RESPONSE_SUPPRESS_OOF ((ULONG)0x00000010) +#define AUTO_RESPONSE_SUPPRESS_AUTO_REPLY ((ULONG)0x00000020) // raid 91101 - Flag indicates No RFC821 From field #define AUTO_RESPONSE_SUPPRESS_NORFC821FROM ((ULONG)0x00000040) -#define PR_AUTO_RESPONSE_SUPPRESS PROP_TAG(PT_LONG, pidExchangeXmitReservedMin - 0x01) -#define PR_INTERNET_CPID PROP_TAG(PT_LONG, pidExchangeXmitReservedMin - 0x02) +#define PR_AUTO_RESPONSE_SUPPRESS PROP_TAG(PT_LONG, pidExchangeXmitReservedMin - 0x01) +#define PR_INTERNET_CPID PROP_TAG(PT_LONG, pidExchangeXmitReservedMin - 0x02) -#define PR_SYNCEVENT_FIRED PROP_TAG(PT_BOOLEAN, pidMessageReadOnlyMin + 0x0F) +#define PR_SYNCEVENT_FIRED PROP_TAG(PT_BOOLEAN, pidMessageReadOnlyMin + 0x0F) /*------------------------------------------------------------------------ * @@ -631,8 +622,7 @@ // Appears on attachments to a message marked to be in conflict. Identifies // those attachments which are conflicting versions of the top level message -#define PR_IN_CONFLICT PROP_TAG(PT_BOOLEAN, pidAttachReadOnlyMin) - +#define PR_IN_CONFLICT PROP_TAG(PT_BOOLEAN, pidAttachReadOnlyMin) /*------------------------------------------------------------------------ * @@ -642,67 +632,66 @@ // Indicates when a message, folder, or mailbox has been deleted. // (Read only, non transmittable property). -#define PR_DELETED_ON PROP_TAG(PT_SYSTIME, pidSpecialMin+0x1F) +#define PR_DELETED_ON PROP_TAG(PT_SYSTIME, pidSpecialMin + 0x1F) // Read-only folder properties which indicate the number of messages, and child folders // that have been "soft" deleted in this folder (and the time the first message was deleted). -#define PR_DELETED_MSG_COUNT PROP_TAG(PT_LONG, pidFolderMin+0x08) -#define PR_DELETED_ASSOC_MSG_COUNT PROP_TAG(PT_LONG, pidFolderMin+0x0B) -#define PR_DELETED_FOLDER_COUNT PROP_TAG(PT_LONG, pidFolderMin + 0x09) -#define PR_OLDEST_DELETED_ON PROP_TAG(PT_SYSTIME, pidFolderMin + 0x0A) +#define PR_DELETED_MSG_COUNT PROP_TAG(PT_LONG, pidFolderMin + 0x08) +#define PR_DELETED_ASSOC_MSG_COUNT PROP_TAG(PT_LONG, pidFolderMin + 0x0B) +#define PR_DELETED_FOLDER_COUNT PROP_TAG(PT_LONG, pidFolderMin + 0x09) +#define PR_OLDEST_DELETED_ON PROP_TAG(PT_SYSTIME, pidFolderMin + 0x0A) // Total size of all soft deleted messages -#define PR_DELETED_MESSAGE_SIZE_EXTENDED PROP_TAG(PT_I8, pidAdminMin+0xB) +#define PR_DELETED_MESSAGE_SIZE_EXTENDED PROP_TAG(PT_I8, pidAdminMin + 0xB) // Total size of all normal soft deleted messages -#define PR_DELETED_NORMAL_MESSAGE_SIZE_EXTENDED PROP_TAG(PT_I8, pidAdminMin+0xC) +#define PR_DELETED_NORMAL_MESSAGE_SIZE_EXTENDED PROP_TAG(PT_I8, pidAdminMin + 0xC) // Total size of all associated soft deleted messages -#define PR_DELETED_ASSOC_MESSAGE_SIZE_EXTENDED PROP_TAG(PT_I8, pidAdminMin+0xD) +#define PR_DELETED_ASSOC_MESSAGE_SIZE_EXTENDED PROP_TAG(PT_I8, pidAdminMin + 0xD) // This property controls the retention age limit (minutes) for the Private/Public MDB, // Mailbox (private only), or Folder (public). // Note - the Folder/Mailbox retention, if set, overrides the MDB retention. -#define PR_RETENTION_AGE_LIMIT PROP_TAG(PT_LONG, pidAdminMin+0x34) +#define PR_RETENTION_AGE_LIMIT PROP_TAG(PT_LONG, pidAdminMin + 0x34) // This property controls if we maintain per user read/unread for a public // folder. By default (if this property is missing or set to FALSE) we will // maintain per user read/unread. -#define PR_DISABLE_PERUSER_READ PROP_TAG(PT_BOOLEAN, pidAdminMin+0x35) +#define PR_DISABLE_PERUSER_READ PROP_TAG(PT_BOOLEAN, pidAdminMin + 0x35) // This property is set by JET after a full backup has occurred. // It is used to determine whether or not messages and folders can be "hard" deleted // before a full backup has captured the last modification to the object. -#define PR_LAST_FULL_BACKUP PROP_TAG(PT_SYSTIME, pidSpecialMin+0x15) +#define PR_LAST_FULL_BACKUP PROP_TAG(PT_SYSTIME, pidSpecialMin + 0x15) /*------------------------------------------------------------------------ * URL related properties *-----------------------------------------------------------------------*/ // This is read only property. -#define PR_URL_NAME PROP_TAG(PT_TSTRING, pidAdminMin+0x77) //0x6707 -#define PR_URL_NAME_A PROP_TAG(PT_STRING8, pidAdminMin+0x77) -#define PR_URL_NAME_W PROP_TAG(PT_UNICODE, pidAdminMin+0x77) +#define PR_URL_NAME PROP_TAG(PT_TSTRING, pidAdminMin + 0x77) // 0x6707 +#define PR_URL_NAME_A PROP_TAG(PT_STRING8, pidAdminMin + 0x77) +#define PR_URL_NAME_W PROP_TAG(PT_UNICODE, pidAdminMin + 0x77) // This is a read-write property. -#define PR_URL_COMP_NAME PROP_TAG(PT_TSTRING, pidRenMsgFldMin+0x73) -#define PR_URL_COMP_NAME_A PROP_TAG(PT_STRING8, pidRenMsgFldMin+0x73) -#define PR_URL_COMP_NAME_W PROP_TAG(PT_UNICODE, pidRenMsgFldMin+0x73) +#define PR_URL_COMP_NAME PROP_TAG(PT_TSTRING, pidRenMsgFldMin + 0x73) +#define PR_URL_COMP_NAME_A PROP_TAG(PT_STRING8, pidRenMsgFldMin + 0x73) +#define PR_URL_COMP_NAME_W PROP_TAG(PT_UNICODE, pidRenMsgFldMin + 0x73) // this is a read-only property -#define PR_PARENT_URL_NAME PROP_TAG(PT_TSTRING, pidAdminMin+0x7D) // 0x670d -#define PR_PARENT_URL_NAME_A PROP_TAG(PT_STRING8, pidAdminMin+0x7D) -#define PR_PARENT_URL_NAME_W PROP_TAG(PT_UNICODE, pidAdminMin+0x7D) +#define PR_PARENT_URL_NAME PROP_TAG(PT_TSTRING, pidAdminMin + 0x7D) // 0x670d +#define PR_PARENT_URL_NAME_A PROP_TAG(PT_STRING8, pidAdminMin + 0x7D) +#define PR_PARENT_URL_NAME_W PROP_TAG(PT_UNICODE, pidAdminMin + 0x7D) // read-only property -#define PR_FLAT_URL_NAME PROP_TAG(PT_TSTRING, pidAdminMin+0x7E) // 0x670e -#define PR_FLAT_URL_NAME_A PROP_TAG(PT_STRING8, pidAdminMin+0x7E) -#define PR_FLAT_URL_NAME_W PROP_TAG(PT_UNICODE, pidAdminMin+0x7E) +#define PR_FLAT_URL_NAME PROP_TAG(PT_TSTRING, pidAdminMin + 0x7E) // 0x670e +#define PR_FLAT_URL_NAME_A PROP_TAG(PT_STRING8, pidAdminMin + 0x7E) +#define PR_FLAT_URL_NAME_W PROP_TAG(PT_UNICODE, pidAdminMin + 0x7E) // read-only property -#define PR_SRC_URL_NAME PROP_TAG(PT_TSTRING, pidAdminMin+0x7F) // 0x670f -#define PR_SRC_URL_NAME_A PROP_TAG(PT_STRING8, pidAdminMin+0x7F) -#define PR_SRC_URL_NAME_W PROP_TAG(PT_UNICODE, pidAdminMin+0x7F) - +#define PR_SRC_URL_NAME PROP_TAG(PT_TSTRING, pidAdminMin + 0x7F) // 0x670f +#define PR_SRC_URL_NAME_A PROP_TAG(PT_STRING8, pidAdminMin + 0x7F) +#define PR_SRC_URL_NAME_W PROP_TAG(PT_UNICODE, pidAdminMin + 0x7F) // Constant wstring to specify URL with fid encoded directly in the URL // For example, URL L"/~FlatUrlSpace/1-401" will refer to folder with FID 1-401 @@ -710,23 +699,23 @@ // in that folder. // But remember that the FID/MID have to be long term, i.e GUID-Globcnt, // the replid used above is simply to explain the idea simpler. -#define WSZ_URL_FLAT_FOLDER_SPACE L"/-FlatUrlSpace-/" -#define cwchUrlFlatFolderSpace 16 +#define WSZ_URL_FLAT_FOLDER_SPACE L"/-FlatUrlSpace-/" +#define cwchUrlFlatFolderSpace 16 // Property that defines whether a folder is secure or not -#define PR_SECURE_IN_SITE PROP_TAG(PT_BOOLEAN, pidAdminMin+0xE) +#define PR_SECURE_IN_SITE PROP_TAG(PT_BOOLEAN, pidAdminMin + 0xE) // PR_LOCAL_COMMIT_TIME is maintained on folders and messages. It is the // FileTime when the object was modified last on the given MDB. It is updated // any time the object is modified (including replicated in change).This is // strictly computed, non-transmittable and non-copyable. -#define PR_LOCAL_COMMIT_TIME PROP_TAG(PT_SYSTIME, pidAdminMin+0x79) +#define PR_LOCAL_COMMIT_TIME PROP_TAG(PT_SYSTIME, pidAdminMin + 0x79) // PR_LOCAL_COMMIT_TIME_MAX is maintained on folders only. // It is >= PR_LOCAL_COMMIT_TIME of all messages in the folder. It is updated // any time any message in the folder is modified. This is strictly computed, // non-transmittable and non-copyable. -#define PR_LOCAL_COMMIT_TIME_MAX PROP_TAG(PT_SYSTIME, pidAdminMin+0x7a) +#define PR_LOCAL_COMMIT_TIME_MAX PROP_TAG(PT_SYSTIME, pidAdminMin + 0x7a) // PR_DELETED_COUNT_TOTAL is maintained on folders only. // It is the total number of messages deleted in this folder from the beginning @@ -735,14 +724,14 @@ // 4 bytes, it will start again at 0. This is updated whenever a message in the // folder is deleted. This is strictly computed, non-transmitabble and // non-copyable. -#define PR_DELETED_COUNT_TOTAL PROP_TAG(PT_LONG, pidAdminMin+0x7b) +#define PR_DELETED_COUNT_TOTAL PROP_TAG(PT_LONG, pidAdminMin + 0x7b) -// PR_AUTO_RESET is maintained on messages only. Its PT_MV_CLSID and is deleted +// PR_AUTO_RESET is maintained on messages only. It's PT_MV_CLSID and is deleted // (by the store) anytime a message is saved, if it has not been // explicitly set on the message between the time it was opened and saved // (by the user/app that opened and later saved the message). // It is intended to be used by async callback agents. -#define PR_AUTO_RESET PROP_TAG(PT_MV_CLSID, pidAdminMin+0x7c) +#define PR_AUTO_RESET PROP_TAG(PT_MV_CLSID, pidAdminMin + 0x7c) /*------------------------------------------------------------------------ * @@ -752,14 +741,13 @@ * *-----------------------------------------------------------------------*/ -//This property can be used in a contents table to get PR_ENTRYID returned -//as a long term entryid instead of a short term entryid. -#define PR_LONGTERM_ENTRYID_FROM_TABLE PROP_TAG(PT_BINARY, pidSpecialMin) +// This property can be used in a contents table to get PR_ENTRYID returned +// as a long term entryid instead of a short term entryid. +#define PR_LONGTERM_ENTRYID_FROM_TABLE PROP_TAG(PT_BINARY, pidSpecialMin) // This is read only property that is used for contents tables that include // subfolder entries. -#define PR_SUBFOLDER PROP_TAG(PT_BOOLEAN, pidAdminMin+0x78) - +#define PR_SUBFOLDER PROP_TAG(PT_BOOLEAN, pidAdminMin + 0x78) /*------------------------------------------------------------------------ * @@ -769,25 +757,25 @@ * *-----------------------------------------------------------------------*/ -#define PR_ORIGINATOR_NAME PROP_TAG( PT_TSTRING, pidMessageWriteableMin+0x3) -#define PR_ORIGINATOR_ADDR PROP_TAG( PT_TSTRING, pidMessageWriteableMin+0x4) -#define PR_ORIGINATOR_ADDRTYPE PROP_TAG( PT_TSTRING, pidMessageWriteableMin+0x5) -#define PR_ORIGINATOR_ENTRYID PROP_TAG( PT_BINARY, pidMessageWriteableMin+0x6) -#define PR_ARRIVAL_TIME PROP_TAG( PT_SYSTIME, pidMessageWriteableMin+0x7) -#define PR_TRACE_INFO PROP_TAG( PT_BINARY, pidMessageWriteableMin+0x8) -#define PR_INTERNAL_TRACE_INFO PROP_TAG( PT_BINARY, pidMessageWriteableMin+0x12) -#define PR_SUBJECT_TRACE_INFO PROP_TAG( PT_BINARY, pidMessageWriteableMin+0x9) -#define PR_RECIPIENT_NUMBER PROP_TAG( PT_LONG, pidMessageWriteableMin+0xA) -#define PR_MTS_SUBJECT_ID PROP_TAG(PT_BINARY, pidMessageWriteableMin+0xB) -#define PR_REPORT_DESTINATION_NAME PROP_TAG(PT_TSTRING, pidMessageWriteableMin+0xC) -#define PR_REPORT_DESTINATION_ENTRYID PROP_TAG(PT_BINARY, pidMessageWriteableMin+0xD) -#define PR_CONTENT_SEARCH_KEY PROP_TAG(PT_BINARY, pidMessageWriteableMin+0xE) -#define PR_FOREIGN_ID PROP_TAG(PT_BINARY, pidMessageWriteableMin+0xF) -#define PR_FOREIGN_REPORT_ID PROP_TAG(PT_BINARY, pidMessageWriteableMin+0x10) -#define PR_FOREIGN_SUBJECT_ID PROP_TAG(PT_BINARY, pidMessageWriteableMin+0x11) -#define PR_PROMOTE_PROP_ID_LIST PROP_TAG(PT_BINARY, pidMessageWriteableMin+0x13) -#define PR_MTS_ID PR_MESSAGE_SUBMISSION_ID -#define PR_MTS_REPORT_ID PR_MESSAGE_SUBMISSION_ID +#define PR_ORIGINATOR_NAME PROP_TAG(PT_TSTRING, pidMessageWriteableMin + 0x3) +#define PR_ORIGINATOR_ADDR PROP_TAG(PT_TSTRING, pidMessageWriteableMin + 0x4) +#define PR_ORIGINATOR_ADDRTYPE PROP_TAG(PT_TSTRING, pidMessageWriteableMin + 0x5) +#define PR_ORIGINATOR_ENTRYID PROP_TAG(PT_BINARY, pidMessageWriteableMin + 0x6) +#define PR_ARRIVAL_TIME PROP_TAG(PT_SYSTIME, pidMessageWriteableMin + 0x7) +#define PR_TRACE_INFO PROP_TAG(PT_BINARY, pidMessageWriteableMin + 0x8) +#define PR_INTERNAL_TRACE_INFO PROP_TAG(PT_BINARY, pidMessageWriteableMin + 0x12) +#define PR_SUBJECT_TRACE_INFO PROP_TAG(PT_BINARY, pidMessageWriteableMin + 0x9) +#define PR_RECIPIENT_NUMBER PROP_TAG(PT_LONG, pidMessageWriteableMin + 0xA) +#define PR_MTS_SUBJECT_ID PROP_TAG(PT_BINARY, pidMessageWriteableMin + 0xB) +#define PR_REPORT_DESTINATION_NAME PROP_TAG(PT_TSTRING, pidMessageWriteableMin + 0xC) +#define PR_REPORT_DESTINATION_ENTRYID PROP_TAG(PT_BINARY, pidMessageWriteableMin + 0xD) +#define PR_CONTENT_SEARCH_KEY PROP_TAG(PT_BINARY, pidMessageWriteableMin + 0xE) +#define PR_FOREIGN_ID PROP_TAG(PT_BINARY, pidMessageWriteableMin + 0xF) +#define PR_FOREIGN_REPORT_ID PROP_TAG(PT_BINARY, pidMessageWriteableMin + 0x10) +#define PR_FOREIGN_SUBJECT_ID PROP_TAG(PT_BINARY, pidMessageWriteableMin + 0x11) +#define PR_PROMOTE_PROP_ID_LIST PROP_TAG(PT_BINARY, pidMessageWriteableMin + 0x13) +#define PR_MTS_ID PR_MESSAGE_SUBMISSION_ID +#define PR_MTS_REPORT_ID PR_MESSAGE_SUBMISSION_ID /*------------------------------------------------------------------------ * @@ -797,62 +785,58 @@ * *-----------------------------------------------------------------------*/ -#define MAX_ADMD_NAME_SIZ 17 -#define MAX_PRMD_NAME_SIZ 17 -#define MAX_COUNTRY_NAME_SIZ 4 -#define MAX_MTA_NAME_SIZ 33 +#define MAX_ADMD_NAME_SIZ 17 +#define MAX_PRMD_NAME_SIZ 17 +#define MAX_COUNTRY_NAME_SIZ 4 +#define MAX_MTA_NAME_SIZ 33 -#define ADMN_PAD 3 -#define PRMD_PAD 3 -#define COUNTRY_PAD 0 -#define MTA_PAD 3 -#define PRMD_PAD_FOR_ACTIONS 2 -#define MTA_PAD_FOR_ACTIONS 2 +#define ADMN_PAD 3 +#define PRMD_PAD 3 +#define COUNTRY_PAD 0 +#define MTA_PAD 3 +#define PRMD_PAD_FOR_ACTIONS 2 +#define MTA_PAD_FOR_ACTIONS 2 typedef struct { - LONG lAction; // The routing action the tracing site - // took.(1984 actions only) - FILETIME ftArrivalTime; // The time at which the communique - // entered the tracing site. - FILETIME ftDeferredTime; // The time are which the tracing site - // released the message. - char rgchADMDName[MAX_ADMD_NAME_SIZ+ADMN_PAD]; // ADMD - char rgchCountryName[MAX_COUNTRY_NAME_SIZ+COUNTRY_PAD]; // Country - char rgchPRMDId[MAX_PRMD_NAME_SIZ+PRMD_PAD]; // PRMD - char rgchAttADMDName[MAX_ADMD_NAME_SIZ+ADMN_PAD]; // Attempted ADMD - char rgchAttCountryName[MAX_COUNTRY_NAME_SIZ+COUNTRY_PAD]; // Attempted Country - char rgchAttPRMDId[MAX_PRMD_NAME_SIZ+PRMD_PAD_FOR_ACTIONS]; // Attempted PRMD - BYTE bAdditionalActions; // 1998 additional actions -} TRACEENTRY, FAR * LPTRACEENTRY; + LONG lAction; // The routing action the tracing site + // took.(1984 actions only) + FILETIME ftArrivalTime; // The time at which the communique + // entered the tracing site. + FILETIME ftDeferredTime; // The time are which the tracing site + // released the message. + char rgchADMDName[MAX_ADMD_NAME_SIZ + ADMN_PAD]; // ADMD + char rgchCountryName[MAX_COUNTRY_NAME_SIZ + COUNTRY_PAD]; // Country + char rgchPRMDId[MAX_PRMD_NAME_SIZ + PRMD_PAD]; // PRMD + char rgchAttADMDName[MAX_ADMD_NAME_SIZ + ADMN_PAD]; // Attempted ADMD + char rgchAttCountryName[MAX_COUNTRY_NAME_SIZ + COUNTRY_PAD]; // Attempted Country + char rgchAttPRMDId[MAX_PRMD_NAME_SIZ + PRMD_PAD_FOR_ACTIONS]; // Attempted PRMD + BYTE bAdditionalActions; // 1998 additional actions +} TRACEENTRY, FAR *LPTRACEENTRY; typedef struct { - ULONG cEntries; // Number of trace entries - TRACEENTRY rgtraceentry[MAPI_DIM]; // array of trace entries -} TRACEINFO, FAR * LPTRACEINFO; - -typedef struct -{ - LONG lAction; // The 1984 routing action the tracing domain took. - FILETIME ftArrivalTime; // The time at which the communique entered the tracing domain. - FILETIME ftDeferredTime; // The time are which the tracing domain released the message. - char rgchADMDName[MAX_ADMD_NAME_SIZ+ADMN_PAD]; // ADMD - char rgchCountryName[MAX_COUNTRY_NAME_SIZ+COUNTRY_PAD]; // Country - char rgchPRMDId[MAX_PRMD_NAME_SIZ+PRMD_PAD]; // PRMD - char rgchAttADMDName[MAX_ADMD_NAME_SIZ+ADMN_PAD]; // Attempted ADMD - char rgchAttCountryName[MAX_COUNTRY_NAME_SIZ+COUNTRY_PAD]; // Attempted Country - char rgchAttPRMDId[MAX_PRMD_NAME_SIZ+PRMD_PAD]; // Attempted PRMD - char rgchMTAName[MAX_MTA_NAME_SIZ+MTA_PAD]; // MTA Name - char rgchAttMTAName[MAX_MTA_NAME_SIZ+MTA_PAD_FOR_ACTIONS]; // Attempted MTA Name - BYTE bAdditionalActions; // 1988 additional actions -}INTTRACEENTRY, *PINTTRACEENTRY; - - -typedef struct -{ - ULONG cEntries; // Number of trace entries - INTTRACEENTRY rgIntTraceEntry[MAPI_DIM]; // array of internal trace entries -}INTTRACEINFO, *PINTTRACEINFO; + ULONG cEntries; // Number of trace entries + TRACEENTRY rgtraceentry[MAPI_DIM]; // array of trace entries +} TRACEINFO, FAR *LPTRACEINFO; +typedef struct { + LONG lAction; // The 1984 routing action the tracing domain took. + FILETIME ftArrivalTime; // The time at which the communique entered the tracing domain. + FILETIME ftDeferredTime; // The time are which the tracing domain released the message. + char rgchADMDName[MAX_ADMD_NAME_SIZ + ADMN_PAD]; // ADMD + char rgchCountryName[MAX_COUNTRY_NAME_SIZ + COUNTRY_PAD]; // Country + char rgchPRMDId[MAX_PRMD_NAME_SIZ + PRMD_PAD]; // PRMD + char rgchAttADMDName[MAX_ADMD_NAME_SIZ + ADMN_PAD]; // Attempted ADMD + char rgchAttCountryName[MAX_COUNTRY_NAME_SIZ + COUNTRY_PAD]; // Attempted Country + char rgchAttPRMDId[MAX_PRMD_NAME_SIZ + PRMD_PAD]; // Attempted PRMD + char rgchMTAName[MAX_MTA_NAME_SIZ + MTA_PAD]; // MTA Name + char rgchAttMTAName[MAX_MTA_NAME_SIZ + MTA_PAD_FOR_ACTIONS]; // Attempted MTA Name + BYTE bAdditionalActions; // 1988 additional actions +} INTTRACEENTRY, *PINTTRACEENTRY; + +typedef struct { + ULONG cEntries; // Number of trace entries + INTTRACEENTRY rgIntTraceEntry[MAPI_DIM]; // array of internal trace entries +} INTTRACEINFO, *PINTTRACEINFO; /*------------------------------------------------------------------------ * @@ -862,85 +846,74 @@ typedef struct * *-----------------------------------------------------------------------*/ - /* ulRowFlags */ -#define ROWLIST_REPLACE ((ULONG)1) - -#define ROW_ADD ((ULONG)1) -#define ROW_MODIFY ((ULONG)2) -#define ROW_REMOVE ((ULONG)4) -#define ROW_EMPTY (ROW_ADD|ROW_REMOVE) - -typedef struct _ROWENTRY -{ - ULONG ulRowFlags; - ULONG cValues; - LPSPropValue rgPropVals; -} ROWENTRY, FAR * LPROWENTRY; - -typedef struct _ROWLIST -{ - ULONG cEntries; - ROWENTRY aEntries[MAPI_DIM]; -} ROWLIST, FAR * LPROWLIST; - -#define EXCHANGE_IEXCHANGEMODIFYTABLE_METHODS(IPURE) \ - MAPIMETHOD(GetLastError) \ - (THIS_ HRESULT hResult, \ - ULONG ulFlags, \ - LPMAPIERROR FAR * lppMAPIError) IPURE; \ - MAPIMETHOD(GetTable) \ - (THIS_ ULONG ulFlags, \ - LPMAPITABLE FAR * lppTable) IPURE; \ - MAPIMETHOD(ModifyTable) \ - (THIS_ ULONG ulFlags, \ - LPROWLIST lpMods) IPURE; - -#undef INTERFACE -#define INTERFACE IExchangeModifyTable -DECLARE_MAPI_INTERFACE_(IExchangeModifyTable, IUnknown) -{ - MAPI_IUNKNOWN_METHODS(PURE) - EXCHANGE_IEXCHANGEMODIFYTABLE_METHODS(PURE) -}; -#undef IMPL +#define ROWLIST_REPLACE ((ULONG)1) + +#define ROW_ADD ((ULONG)1) +#define ROW_MODIFY ((ULONG)2) +#define ROW_REMOVE ((ULONG)4) +#define ROW_EMPTY (ROW_ADD | ROW_REMOVE) + +typedef struct _ROWENTRY { + ULONG ulRowFlags; + ULONG cValues; + LPSPropValue rgPropVals; +} ROWENTRY, FAR *LPROWENTRY; + +typedef struct _ROWLIST { + ULONG cEntries; + ROWENTRY aEntries[MAPI_DIM]; +} ROWLIST, FAR *LPROWLIST; + +#define EXCHANGE_IEXCHANGEMODIFYTABLE_METHODS(IPURE) \ + MAPIMETHOD(GetLastError) \ + (THIS_ HRESULT hResult, ULONG ulFlags, LPMAPIERROR FAR * lppMAPIError) IPURE; \ + MAPIMETHOD(GetTable) \ + (THIS_ ULONG ulFlags, LPMAPITABLE FAR * lppTable) IPURE; \ + MAPIMETHOD(ModifyTable) \ + (THIS_ ULONG ulFlags, LPROWLIST lpMods) IPURE; + +#undef INTERFACE +#define INTERFACE IExchangeModifyTable +DECLARE_MAPI_INTERFACE_(IExchangeModifyTable, + IUnknown){MAPI_IUNKNOWN_METHODS(PURE) EXCHANGE_IEXCHANGEMODIFYTABLE_METHODS(PURE)}; +#undef IMPL #define IMPL -DECLARE_MAPI_INTERFACE_PTR(IExchangeModifyTable, LPEXCHANGEMODIFYTABLE); +DECLARE_MAPI_INTERFACE_PTR(IExchangeModifyTable, LPEXCHANGEMODIFYTABLE); /* Special flag bit for GetContentsTable, GetHierarchyTable and - OpenEntry. - Supported by > 5.x servers - If set in GetContentsTable and GetHierarchyTable - we will show only items that are soft deleted, i.e deleted - by user but not yet purged from the system. If set in OpenEntry - we will open this item even if it is soft deleted */ + OpenEntry. + Supported by > 5.x servers + If set in GetContentsTable and GetHierarchyTable + we will show only items that are soft deleted, i.e deleted + by user but not yet purged from the system. If set in OpenEntry + we will open this item even if it is soft deleted */ /* Flag bits must not collide by existing definitions in Mapi */ /****** MAPI_UNICODE ((ULONG) 0x80000000) above */ /****** MAPI_DEFERRED_ERRORS ((ULONG) 0x00000008) below */ /****** MAPI_ASSOCIATED ((ULONG) 0x00000040) below */ /****** CONVENIENT_DEPTH ((ULONG) 0x00000001) */ -#define SHOW_SOFT_DELETES ((ULONG) 0x00000002) -#define SHOW_SUBFOLDERS ((ULONG) 0x00000004) +#define SHOW_SOFT_DELETES ((ULONG)0x00000002) +#define SHOW_SUBFOLDERS ((ULONG)0x00000004) // reserved flag bit(s) - do not set -#define MAPI_RESERVED1 ((ULONG) 0x00010000) +#define MAPI_RESERVED1 ((ULONG)0x00010000) // Do not block this OpenMessage (MAPI's OpenEntry) -#define MDB_OPEN_MSG_NO_BLOCK ((ULONG) 0x00000020) +#define MDB_OPEN_MSG_NO_BLOCK ((ULONG)0x00000020) // Unlock a MID at SaveChanges /****** KEEP_OPEN_READONLY ((ULONG) 0x00000001) */ /****** KEEP_OPEN_READWRITE ((ULONG) 0x00000002) */ /****** FORCE_SAVE ((ULONG) 0x00000004) */ /****** MAPI_DEFERRED_ERRORS ((ULONG) 0x00000008) */ -#define MDB_SAVE_MSG_UNLOCK ((ULONG) 0x00000040) - +#define MDB_SAVE_MSG_UNLOCK ((ULONG)0x00000040) /* Special flag bit for DeleteFolder - Supported by > 5.x servers - If set the server will hard delete the folder (i.e it will not be - retained for later recovery) */ + Supported by > 5.x servers + If set the server will hard delete the folder (i.e it will not be + retained for later recovery) */ /* Flag bits must not collide by existing definitions in Mapi */ /* DeleteFolder */ /***** #define DEL_MESSAGES ((ULONG) 0x00000001) */ @@ -949,33 +922,32 @@ DECLARE_MAPI_INTERFACE_PTR(IExchangeModifyTable, LPEXCHANGEMODIFYTABLE); /* EmptyFolder */ /***** #define DEL_ASSOCIATED ((ULONG) 0x00000008) */ -#define DELETE_HARD_DELETE ((ULONG) 0x00000010) +#define DELETE_HARD_DELETE ((ULONG)0x00000010) /* Access Control Specifics */ -//Properties -#define PR_MEMBER_ID PROP_TAG(PT_I8, pidSpecialMin+0x01) -#define PR_MEMBER_NAME PROP_TAG(PT_TSTRING, pidSpecialMin+0x02) -#define PR_MEMBER_ENTRYID PR_ENTRYID -#define PR_MEMBER_RIGHTS PROP_TAG(PT_LONG, pidSpecialMin+0x03) +// Properties +#define PR_MEMBER_ID PROP_TAG(PT_I8, pidSpecialMin + 0x01) +#define PR_MEMBER_NAME PROP_TAG(PT_TSTRING, pidSpecialMin + 0x02) +#define PR_MEMBER_ENTRYID PR_ENTRYID +#define PR_MEMBER_RIGHTS PROP_TAG(PT_LONG, pidSpecialMin + 0x03) -//Security bits +// Security bits typedef DWORD RIGHTS; -#define frightsReadAny 0x0000001L -#define frightsCreate 0x0000002L -#define frightsEditOwned 0x0000008L -#define frightsDeleteOwned 0x0000010L -#define frightsEditAny 0x0000020L -#define frightsDeleteAny 0x0000040L -#define frightsCreateSubfolder 0x0000080L -#define frightsOwner 0x0000100L -#define frightsContact 0x0000200L // NOTE: not part of rightsAll -#define frightsVisible 0x0000400L -#define rightsNone 0x00000000 -#define rightsReadOnly frightsReadAny -#define rightsReadWrite (frightsReadAny|frightsEditAny) -#define rightsAll 0x00005FBL - +#define frightsReadAny 0x0000001L +#define frightsCreate 0x0000002L +#define frightsEditOwned 0x0000008L +#define frightsDeleteOwned 0x0000010L +#define frightsEditAny 0x0000020L +#define frightsDeleteAny 0x0000040L +#define frightsCreateSubfolder 0x0000080L +#define frightsOwner 0x0000100L +#define frightsContact 0x0000200L // NOTE: not part of rightsAll +#define frightsVisible 0x0000400L +#define rightsNone 0x00000000 +#define rightsReadOnly frightsReadAny +#define rightsReadWrite (frightsReadAny | frightsEditAny) +#define rightsAll 0x00005FBL // // Mailbox specific access rights. @@ -988,91 +960,94 @@ typedef DWORD RIGHTS; // #define fsdpermUserDeleteMailbox DELETE #define fsdpermUserMailboxOwner 0x00000001 -#define fsdpermUserSendAs 0x00000002 -#define fsdpermUserPrimaryUser 0x00000004 - +#define fsdpermUserSendAs 0x00000002 +#define fsdpermUserPrimaryUser 0x00000004 -#define sdpermUserGenericRead (STANDARD_RIGHTS_READ) +#define sdpermUserGenericRead (STANDARD_RIGHTS_READ) // generic execute -#define sdpermUserGenericExecute (STANDARD_RIGHTS_EXECUTE) +#define sdpermUserGenericExecute (STANDARD_RIGHTS_EXECUTE) // generic write -#define sdpermUserGenericWrite (STANDARD_RIGHTS_WRITE | fsdpermUserDeleteMailbox) +#define sdpermUserGenericWrite (STANDARD_RIGHTS_WRITE | fsdpermUserDeleteMailbox) // generic all -#define sdpermUserGenericAll (STANDARD_RIGHTS_ALL | fsdpermUserMailboxOwner | fsdpermUserSendAs | fsdpermUserPrimaryUser) +#define sdpermUserGenericAll \ + (STANDARD_RIGHTS_ALL | fsdpermUserMailboxOwner | fsdpermUserSendAs | fsdpermUserPrimaryUser) // // Message specific rights. // typedef DWORD SDRIGHTS; -#define fsdrightReadBody 0x00000001 //** ONLY ON MESSAGES, SAME AS FILE_READ_DATA -#define fsdrightListContents 0x00000001 //** ONLY ON FOLDERS, SAME AS FILE_LIST_DATA - IGNORED -#define fsdrightWriteBody 0x00000002 //** ONLY ON MESSAGES, SAME AS FILE_WRITE_DATA -#define fsdrightCreateItem 0x00000002 //** ONLY ON FOLDERs, SAME AS FILE_ADD_FILE +#define fsdrightReadBody 0x00000001 //** ONLY ON MESSAGES, SAME AS FILE_READ_DATA +#define fsdrightListContents 0x00000001 //** ONLY ON FOLDERS, SAME AS FILE_LIST_DATA - IGNORED +#define fsdrightWriteBody 0x00000002 //** ONLY ON MESSAGES, SAME AS FILE_WRITE_DATA +#define fsdrightCreateItem 0x00000002 //** ONLY ON FOLDERs, SAME AS FILE_ADD_FILE -#define fsdrightAppendMsg 0x00000004 //** ONLY ON MESSAGES, SAME AS FILE_WRITE_DATA. ENFORCED BY IFS. -#define fsdrightCreateContainer 0x00000004 //** ONLY ON FOLDERS, SAME AS FILE_ADD_FILE +#define fsdrightAppendMsg 0x00000004 //** ONLY ON MESSAGES, SAME AS FILE_WRITE_DATA. ENFORCED BY IFS. +#define fsdrightCreateContainer 0x00000004 //** ONLY ON FOLDERS, SAME AS FILE_ADD_FILE -#define fsdrightReadProperty 0x00000008 //** SAME AS FILE_READ_EA -#define fsdrightWriteProperty 0x00000010 //** SAME AS FILE_WRITE_EA +#define fsdrightReadProperty 0x00000008 //** SAME AS FILE_READ_EA +#define fsdrightWriteProperty 0x00000010 //** SAME AS FILE_WRITE_EA -#define fsdrightExecute 0x00000020 // Same as FILE_EXECUTE/FILE_TRAVERSE. ENFORCED BY IFS -#define fsdrightReserved1 0x00000040 // Same as FILE_DELETE_CHILD.. Currently unused -#define fsdrightReadAttributes 0x00000080 // Same as FILE_READ_ATTRIBUTES. Currently unused -#define fsdrightWriteAttributes 0x00000100 // Same as FILE_WRITE_ATTRIBUTES. Currently unused +#define fsdrightExecute 0x00000020 // Same as FILE_EXECUTE/FILE_TRAVERSE. ENFORCED BY IFS +#define fsdrightReserved1 0x00000040 // Same as FILE_DELETE_CHILD.. Currently unused +#define fsdrightReadAttributes 0x00000080 // Same as FILE_READ_ATTRIBUTES. Currently unused +#define fsdrightWriteAttributes 0x00000100 // Same as FILE_WRITE_ATTRIBUTES. Currently unused -#define fsdrightWriteOwnProperty 0x00000200 //** ONLY ON MESSAGES -#define fsdrightDeleteOwnItem 0x00000400 //** ONLY ON MESSAGES -#define fsdrightViewItem 0x00000800 -#define fsdrightOwner 0x00004000 //** ONLY ON FOLDERS -#define fsdrightContact 0x00008000 //** ONLY ON FOLDERS +#define fsdrightWriteOwnProperty 0x00000200 //** ONLY ON MESSAGES +#define fsdrightDeleteOwnItem 0x00000400 //** ONLY ON MESSAGES +#define fsdrightViewItem 0x00000800 +#define fsdrightOwner 0x00004000 //** ONLY ON FOLDERS +#define fsdrightContact 0x00008000 //** ONLY ON FOLDERS // // Standard NT rights. // -#define fsdrightWriteSD WRITE_DAC -#define fsdrightDelete DELETE -#define fsdrightWriteOwner WRITE_OWNER -#define fsdrightReadControl READ_CONTROL -#define fsdrightSynchronize SYNCHRONIZE - -#define sdrightsNone 0x00000000 -#define sdrightsBestAccess MAXIMUM_ALLOWED -#define sdrightsReadOnly GENERIC_READ -#define sdrightsReadWrite GENERIC_READ | GENERIC_WRITE - -#define sdrightsGenericRead (fsdrightReadControl | fsdrightReadBody | fsdrightReadAttributes | fsdrightReadProperty | fsdrightViewItem |\ - fsdrightSynchronize) -#define sdrightsGenericWrite (fsdrightReadControl | fsdrightWriteBody | fsdrightWriteAttributes | fsdrightWriteProperty | \ - fsdrightAppendMsg | fsdrightCreateItem | fsdrightDelete | fsdrightCreateContainer | \ - fsdrightOwner | fsdrightSynchronize | fsdrightWriteSD | fsdrightWriteOwner) - -#define sdrightsGenericExecute (fsdrightReadControl | fsdrightReadAttributes | fsdrightExecute | fsdrightViewItem | fsdrightSynchronize) - -#define sdrightsGenericAll (fsdrightDelete | fsdrightReadProperty | fsdrightWriteProperty |\ - fsdrightCreateItem | fsdrightCreateContainer | fsdrightReadControl | fsdrightWriteSD |\ - fsdrightWriteOwner | fsdrightReadControl | \ - fsdrightViewItem | fsdrightOwner | \ - fsdrightWriteOwnProperty | fsdrightDeleteOwnItem | fsdrightSynchronize | \ - fsdrightExecute | fsdrightReserved1 | fsdrightReadAttributes | fsdrightWriteAttributes | \ - fsdrightReadBody | fsdrightWriteBody | fsdrightSynchronize | fsdrightContact) +#define fsdrightWriteSD WRITE_DAC +#define fsdrightDelete DELETE +#define fsdrightWriteOwner WRITE_OWNER +#define fsdrightReadControl READ_CONTROL +#define fsdrightSynchronize SYNCHRONIZE + +#define sdrightsNone 0x00000000 +#define sdrightsBestAccess MAXIMUM_ALLOWED +#define sdrightsReadOnly GENERIC_READ +#define sdrightsReadWrite GENERIC_READ | GENERIC_WRITE + +#define sdrightsGenericRead \ + (fsdrightReadControl | fsdrightReadBody | fsdrightReadAttributes | fsdrightReadProperty | fsdrightViewItem | \ + fsdrightSynchronize) +#define sdrightsGenericWrite \ + (fsdrightReadControl | fsdrightWriteBody | fsdrightWriteAttributes | fsdrightWriteProperty | fsdrightAppendMsg | \ + fsdrightCreateItem | fsdrightDelete | fsdrightCreateContainer | fsdrightOwner | fsdrightSynchronize | \ + fsdrightWriteSD | fsdrightWriteOwner) + +#define sdrightsGenericExecute \ + (fsdrightReadControl | fsdrightReadAttributes | fsdrightExecute | fsdrightViewItem | fsdrightSynchronize) + +#define sdrightsGenericAll \ + (fsdrightDelete | fsdrightReadProperty | fsdrightWriteProperty | fsdrightCreateItem | fsdrightCreateContainer | \ + fsdrightReadControl | fsdrightWriteSD | fsdrightWriteOwner | fsdrightReadControl | fsdrightViewItem | \ + fsdrightOwner | fsdrightWriteOwnProperty | fsdrightDeleteOwnItem | fsdrightSynchronize | fsdrightExecute | \ + fsdrightReserved1 | fsdrightReadAttributes | fsdrightWriteAttributes | fsdrightReadBody | fsdrightWriteBody | \ + fsdrightSynchronize | fsdrightContact) // // SDRights that together make up rightsOwner. // -#define sdrightsFolderOwner (fsdrightWriteProperty | fsdrightOwner | fsdrightWriteSD | fsdrightDelete | \ - fsdrightWriteOwner | fsdrightWriteAttributes) +#define sdrightsFolderOwner \ + (fsdrightWriteProperty | fsdrightOwner | fsdrightWriteSD | fsdrightDelete | fsdrightWriteOwner | \ + fsdrightWriteAttributes) // // Rights that are valid on folders. // -#define sdrightsFolders (fsdrightDelete | fsdrightReadProperty | fsdrightReadAttributes | \ - fsdrightWriteProperty | fsdrightWriteAttributes | fsdrightWriteOwner | \ - fsdrightReadControl | fsdrightWriteSD | fsdrightExecute | \ - fsdrightCreateContainer | fsdrightViewItem | fsdrightOwner | \ - fsdrightContact | fsdrightCreateItem | fsdrightSynchronize | fsdrightListContents | fsdrightReserved1) +#define sdrightsFolders \ + (fsdrightDelete | fsdrightReadProperty | fsdrightReadAttributes | fsdrightWriteProperty | \ + fsdrightWriteAttributes | fsdrightWriteOwner | fsdrightReadControl | fsdrightWriteSD | fsdrightExecute | \ + fsdrightCreateContainer | fsdrightViewItem | fsdrightOwner | fsdrightContact | fsdrightCreateItem | \ + fsdrightSynchronize | fsdrightListContents | fsdrightReserved1) // // Rights that are valid on messages. @@ -1080,30 +1055,31 @@ typedef DWORD SDRIGHTS; // // NB: fsdrightWriteOwnProperty/fsdrightDeleteOwnItem are NOT in this list. // -#define sdrightsItems (fsdrightDelete | fsdrightReadBody | fsdrightReadAttributes | fsdrightReadProperty | \ - fsdrightWriteProperty | fsdrightWriteBody | fsdrightWriteAttributes | fsdrightReadControl | \ - fsdrightWriteOwner | fsdrightWriteSD | fsdrightViewItem | fsdrightWriteOwnProperty | \ - fsdrightDeleteOwnItem | fsdrightSynchronize | fsdrightExecute | fsdrightAppendMsg) +#define sdrightsItems \ + (fsdrightDelete | fsdrightReadBody | fsdrightReadAttributes | fsdrightReadProperty | fsdrightWriteProperty | \ + fsdrightWriteBody | fsdrightWriteAttributes | fsdrightReadControl | fsdrightWriteOwner | fsdrightWriteSD | \ + fsdrightViewItem | fsdrightWriteOwnProperty | fsdrightDeleteOwnItem | fsdrightSynchronize | fsdrightExecute | \ + fsdrightAppendMsg) // // These access rights are ignored in the determination of a canonical ACL. Since the exchange store ignores // these rights, their presence or absense doesn't make an ACL canonical. // -#define sdrightsIgnored (fsdrightExecute | fsdrightAppendMsg | fsdrightContact | fsdrightReserved1) +#define sdrightsIgnored (fsdrightExecute | fsdrightAppendMsg | fsdrightContact | fsdrightReserved1) // // Backwards Compatible rights definitions. // -#define msgrightsGenericRead (sdrightsGenericRead & sdrightsItems) -#define msgrightsGenericWrite (sdrightsGenericWrite & sdrightsItems) -#define msgrightsGenericExecute (sdrightsGenericExecute & sdrightsItems) -#define msgrightsGenericAll (sdrightsGenericAll & sdrightsItems) +#define msgrightsGenericRead (sdrightsGenericRead & sdrightsItems) +#define msgrightsGenericWrite (sdrightsGenericWrite & sdrightsItems) +#define msgrightsGenericExecute (sdrightsGenericExecute & sdrightsItems) +#define msgrightsGenericAll (sdrightsGenericAll & sdrightsItems) -#define fldrightsGenericRead (sdrightsGenericRead & sdrightsFolders) -#define fldrightsGenericWrite (sdrightsGenericWrite & sdrightsFolders) -#define fldrightsGenericExecute (sdrightsGenericExecute & sdrightsFolders) -#define fldrightsGenericAll (sdrightsGenericAll & sdrightsFolders) +#define fldrightsGenericRead (sdrightsGenericRead & sdrightsFolders) +#define fldrightsGenericWrite (sdrightsGenericWrite & sdrightsFolders) +#define fldrightsGenericExecute (sdrightsGenericExecute & sdrightsFolders) +#define fldrightsGenericAll (sdrightsGenericAll & sdrightsFolders) // // If set in the RM control field of an NTSD, allows @@ -1120,14 +1096,15 @@ typedef DWORD SDRIGHTS; #define SET_GUID_PROP_ID(pguid, ptag) (pguid)->Data1 = PROP_ID(ptag) #define SET_GUID_SUB_PROP_ID(pguid, ptag, subptag) (pguid)->Data1 = (PROP_ID(ptag) | PROP_ID(subptag) << 16) -#define PROPERTY_GUID(ptag) { PROP_ID(ptag), \ - 0x6585, 0x11d3, \ - {0xb6, 0x19, 0x00, 0xaa, 0x00, 0x4b, 0x9c, 0x30}} \ - -#define SUB_PROPERTY_GUID(ptag, subptag) { PROP_ID(subptag) << 16 | PROP_ID(ptag), \ - 0x6585, 0x11d3, \ - {0xb6, 0x19, 0x00, 0xaa, 0x00, 0x4b, 0x9c, 0x30}} \ +#define PROPERTY_GUID(ptag) \ + { \ + PROP_ID(ptag), 0x6585, 0x11d3, { 0xb6, 0x19, 0x00, 0xaa, 0x00, 0x4b, 0x9c, 0x30 } \ + } +#define SUB_PROPERTY_GUID(ptag, subptag) \ + { \ + PROP_ID(subptag) << 16 | PROP_ID(ptag), 0x6585, 0x11d3, { 0xb6, 0x19, 0x00, 0xaa, 0x00, 0x4b, 0x9c, 0x30 } \ + } // // Transfer version for PR_NT_SECURITY_DESCRIPTOR. @@ -1156,12 +1133,12 @@ typedef DWORD SDRIGHTS; // // Please note that OLEDB/DAV reserves the even numbers of the transfer version, so it must ALWAYS be an odd number. // -#define SECURITY_DESCRIPTOR_TRANSFER_VERSION 0x0003 +#define SECURITY_DESCRIPTOR_TRANSFER_VERSION 0x0003 -#define SECURITY_DESCRIPTOR_OF(pb) (((BYTE *)(pb)) + *((WORD *)(pb))) +#define SECURITY_DESCRIPTOR_OF(pb) (((BYTE *)(pb)) + *((WORD *)(pb))) #define SECURITY_DESCRIPTOR_VERSION(pb) (*((WORD *)((pb) + sizeof(WORD)))) #define SECURITY_INFORMATION_OF(pb) (*((DWORD *)((pb) + sizeof(WORD) + sizeof(WORD)))) -#define CbSecurityDescriptorHeader(pb) (*((WORD *)(pb))) +#define CbSecurityDescriptorHeader(pb) (*((WORD *)(pb))) // // To check to see if the security descriptor version matches the currently compiled @@ -1173,57 +1150,56 @@ typedef DWORD SDRIGHTS; // Role scopes // typedef BYTE ROLESCOPE; -#define ROLESCOPE_OBJECT 0x00 // Roles will be read from the object (folder or item) itself -#define ROLESCOPE_FOLDER 0x01 // Roles will be read from the folder itself, or the containing folder if it is an item -#define ROLESCOPE_MAX ROLESCOPE_FOLDER +#define ROLESCOPE_OBJECT 0x00 // Roles will be read from the object (folder or item) itself +#define ROLESCOPE_FOLDER 0x01 // Roles will be read from the folder itself, or the containing folder if it is an item +#define ROLESCOPE_MAX ROLESCOPE_FOLDER // // Security authority used for role sids // -#define SECURITY_EXCHANGE_AUTHORITY {0,0,0,0,0,8} +#define SECURITY_EXCHANGE_AUTHORITY {0, 0, 0, 0, 0, 8} // // Application role properties // -#define PR_XMT_SECURITY_ROLE_1 PROP_TAG(PT_BINARY,0x3d25) -#define PR_XMT_SECURITY_ROLE_1_AS_XML PROP_TAG(PT_TSTRING,0x3d25) -#define PR_XMT_SECURITY_ROLE_2 PROP_TAG(PT_BINARY,0x3d26) -#define PR_XMT_SECURITY_ROLE_2_AS_XML PROP_TAG(PT_TSTRING,0x3d26) -#define PR_XMT_SECURITY_ROLE_3 PROP_TAG(PT_BINARY,0x3d27) -#define PR_XMT_SECURITY_ROLE_3_AS_XML PROP_TAG(PT_TSTRING,0x3d27) -#define PR_XMT_SECURITY_ROLE_4 PROP_TAG(PT_BINARY,0x3d28) -#define PR_XMT_SECURITY_ROLE_4_AS_XML PROP_TAG(PT_TSTRING,0x3d28) -#define PR_XMT_SECURITY_ROLE_5 PROP_TAG(PT_BINARY,0x3d29) -#define PR_XMT_SECURITY_ROLE_5_AS_XML PROP_TAG(PT_TSTRING,0x3d29) -#define PR_XMT_SECURITY_ROLE_6 PROP_TAG(PT_BINARY,0x3d2A) -#define PR_XMT_SECURITY_ROLE_6_AS_XML PROP_TAG(PT_TSTRING,0x3d2A) -#define PR_XMT_SECURITY_ROLE_7 PROP_TAG(PT_BINARY,0x3d2B) -#define PR_XMT_SECURITY_ROLE_7_AS_XML PROP_TAG(PT_TSTRING,0x3d2B) -#define PR_XMT_SECURITY_ROLE_8 PROP_TAG(PT_BINARY,0x3d2C) -#define PR_XMT_SECURITY_ROLE_8_AS_XML PROP_TAG(PT_TSTRING,0x3d2C) -#define PR_NON_XMT_SECURITY_ROLE_1 PROP_TAG(PT_BINARY,0x0E7C) -#define PR_NON_XMT_SECURITY_ROLE_1_AS_XML PROP_TAG(PT_TSTRING,0x0E7C) -#define PR_NON_XMT_SECURITY_ROLE_2 PROP_TAG(PT_BINARY,0x0E7D) -#define PR_NON_XMT_SECURITY_ROLE_2_AS_XML PROP_TAG(PT_TSTRING,0x0E7D) -#define PR_NON_XMT_SECURITY_ROLE_3 PROP_TAG(PT_BINARY,0x0E7E) -#define PR_NON_XMT_SECURITY_ROLE_3_AS_XML PROP_TAG(PT_TSTRING,0x0E7E) -#define PR_NON_XMT_SECURITY_ROLE_4 PROP_TAG(PT_BINARY,0x0E7F) -#define PR_NON_XMT_SECURITY_ROLE_4_AS_XML PROP_TAG(PT_TSTRING,0x0E7F) -#define PR_NON_XMT_SECURITY_ROLE_5 PROP_TAG(PT_BINARY,0x0E80) -#define PR_NON_XMT_SECURITY_ROLE_5_AS_XML PROP_TAG(PT_TSTRING,0x0E80) -#define PR_NON_XMT_SECURITY_ROLE_6 PROP_TAG(PT_BINARY,0x0E81) -#define PR_NON_XMT_SECURITY_ROLE_6_AS_XML PROP_TAG(PT_TSTRING,0x0E81) -#define PR_NON_XMT_SECURITY_ROLE_7 PROP_TAG(PT_BINARY,0x0E82) -#define PR_NON_XMT_SECURITY_ROLE_7_AS_XML PROP_TAG(PT_TSTRING,0x0E82) -#define PR_NON_XMT_SECURITY_ROLE_8 PROP_TAG(PT_BINARY,0x0E83) -#define PR_NON_XMT_SECURITY_ROLE_8_AS_XML PROP_TAG(PT_TSTRING,0x0E83) - +#define PR_XMT_SECURITY_ROLE_1 PROP_TAG(PT_BINARY, 0x3d25) +#define PR_XMT_SECURITY_ROLE_1_AS_XML PROP_TAG(PT_TSTRING, 0x3d25) +#define PR_XMT_SECURITY_ROLE_2 PROP_TAG(PT_BINARY, 0x3d26) +#define PR_XMT_SECURITY_ROLE_2_AS_XML PROP_TAG(PT_TSTRING, 0x3d26) +#define PR_XMT_SECURITY_ROLE_3 PROP_TAG(PT_BINARY, 0x3d27) +#define PR_XMT_SECURITY_ROLE_3_AS_XML PROP_TAG(PT_TSTRING, 0x3d27) +#define PR_XMT_SECURITY_ROLE_4 PROP_TAG(PT_BINARY, 0x3d28) +#define PR_XMT_SECURITY_ROLE_4_AS_XML PROP_TAG(PT_TSTRING, 0x3d28) +#define PR_XMT_SECURITY_ROLE_5 PROP_TAG(PT_BINARY, 0x3d29) +#define PR_XMT_SECURITY_ROLE_5_AS_XML PROP_TAG(PT_TSTRING, 0x3d29) +#define PR_XMT_SECURITY_ROLE_6 PROP_TAG(PT_BINARY, 0x3d2A) +#define PR_XMT_SECURITY_ROLE_6_AS_XML PROP_TAG(PT_TSTRING, 0x3d2A) +#define PR_XMT_SECURITY_ROLE_7 PROP_TAG(PT_BINARY, 0x3d2B) +#define PR_XMT_SECURITY_ROLE_7_AS_XML PROP_TAG(PT_TSTRING, 0x3d2B) +#define PR_XMT_SECURITY_ROLE_8 PROP_TAG(PT_BINARY, 0x3d2C) +#define PR_XMT_SECURITY_ROLE_8_AS_XML PROP_TAG(PT_TSTRING, 0x3d2C) +#define PR_NON_XMT_SECURITY_ROLE_1 PROP_TAG(PT_BINARY, 0x0E7C) +#define PR_NON_XMT_SECURITY_ROLE_1_AS_XML PROP_TAG(PT_TSTRING, 0x0E7C) +#define PR_NON_XMT_SECURITY_ROLE_2 PROP_TAG(PT_BINARY, 0x0E7D) +#define PR_NON_XMT_SECURITY_ROLE_2_AS_XML PROP_TAG(PT_TSTRING, 0x0E7D) +#define PR_NON_XMT_SECURITY_ROLE_3 PROP_TAG(PT_BINARY, 0x0E7E) +#define PR_NON_XMT_SECURITY_ROLE_3_AS_XML PROP_TAG(PT_TSTRING, 0x0E7E) +#define PR_NON_XMT_SECURITY_ROLE_4 PROP_TAG(PT_BINARY, 0x0E7F) +#define PR_NON_XMT_SECURITY_ROLE_4_AS_XML PROP_TAG(PT_TSTRING, 0x0E7F) +#define PR_NON_XMT_SECURITY_ROLE_5 PROP_TAG(PT_BINARY, 0x0E80) +#define PR_NON_XMT_SECURITY_ROLE_5_AS_XML PROP_TAG(PT_TSTRING, 0x0E80) +#define PR_NON_XMT_SECURITY_ROLE_6 PROP_TAG(PT_BINARY, 0x0E81) +#define PR_NON_XMT_SECURITY_ROLE_6_AS_XML PROP_TAG(PT_TSTRING, 0x0E81) +#define PR_NON_XMT_SECURITY_ROLE_7 PROP_TAG(PT_BINARY, 0x0E82) +#define PR_NON_XMT_SECURITY_ROLE_7_AS_XML PROP_TAG(PT_TSTRING, 0x0E82) +#define PR_NON_XMT_SECURITY_ROLE_8 PROP_TAG(PT_BINARY, 0x0E83) +#define PR_NON_XMT_SECURITY_ROLE_8_AS_XML PROP_TAG(PT_TSTRING, 0x0E83) /* Rules specifics */ // Property types -#define PT_SRESTRICTION ((ULONG) 0x00FD) -#define PT_ACTIONS ((ULONG) 0x00FE) +#define PT_SRESTRICTION ((ULONG)0x00FD) +#define PT_ACTIONS ((ULONG)0x00FE) /*----------------------------------------------------------------------- * PT_FILE_HANDLE: real data is in file specified by handle. @@ -1236,205 +1212,194 @@ typedef BYTE ROLESCOPE; * is not supported for outside calls. *-----------------------------------------------------------------------*/ -#define PT_FILE_HANDLE ((ULONG) 0x0103) -#define PT_FILE_EA ((ULONG) 0x0104) -#define PT_VIRTUAL ((ULONG) 0x0105) - -#define FVirtualProp(ptag) (PROP_TYPE(ptag) == PT_VIRTUAL) -#define FFileHandleProp(ptag) (PROP_TYPE(ptag) == PT_FILE_HANDLE || PROP_TYPE(ptag) == PT_FILE_EA) - -//Properties in rule table -#define PR_RULE_ID PROP_TAG(PT_I8, pidSpecialMin+0x04) -#define PR_RULE_IDS PROP_TAG(PT_BINARY, pidSpecialMin+0x05) -#define PR_RULE_SEQUENCE PROP_TAG(PT_LONG, pidSpecialMin+0x06) -#define PR_RULE_STATE PROP_TAG(PT_LONG, pidSpecialMin+0x07) -#define PR_RULE_USER_FLAGS PROP_TAG(PT_LONG, pidSpecialMin+0x08) -#define PR_RULE_CONDITION PROP_TAG(PT_SRESTRICTION, pidSpecialMin+0x09) -#define PR_RULE_ACTIONS PROP_TAG(PT_ACTIONS, pidSpecialMin+0x10) -#define PR_RULE_PROVIDER PROP_TAG(PT_STRING8, pidSpecialMin+0x11) -#define PR_RULE_NAME PROP_TAG(PT_TSTRING, pidSpecialMin+0x12) -#define PR_RULE_LEVEL PROP_TAG(PT_LONG, pidSpecialMin+0x13) -#define PR_RULE_PROVIDER_DATA PROP_TAG(PT_BINARY, pidSpecialMin+0x14) - -#define PR_EXTENDED_RULE_ACTIONS PROP_TAG(PT_BINARY, pidStoreNonTransMin+0x59) -#define PR_EXTENDED_RULE_CONDITION PROP_TAG(PT_BINARY, pidStoreNonTransMin+0x5a) -#define PR_EXTENDED_RULE_SIZE_LIMIT PROP_TAG(PT_LONG, pidStoreNonTransMin+0x5b) +#define PT_FILE_HANDLE ((ULONG)0x0103) +#define PT_FILE_EA ((ULONG)0x0104) +#define PT_VIRTUAL ((ULONG)0x0105) + +#define FVirtualProp(ptag) (PROP_TYPE(ptag) == PT_VIRTUAL) +#define FFileHandleProp(ptag) (PROP_TYPE(ptag) == PT_FILE_HANDLE || PROP_TYPE(ptag) == PT_FILE_EA) + +// Properties in rule table +#define PR_RULE_ID PROP_TAG(PT_I8, pidSpecialMin + 0x04) +#define PR_RULE_IDS PROP_TAG(PT_BINARY, pidSpecialMin + 0x05) +#define PR_RULE_SEQUENCE PROP_TAG(PT_LONG, pidSpecialMin + 0x06) +#define PR_RULE_STATE PROP_TAG(PT_LONG, pidSpecialMin + 0x07) +#define PR_RULE_USER_FLAGS PROP_TAG(PT_LONG, pidSpecialMin + 0x08) +#define PR_RULE_CONDITION PROP_TAG(PT_SRESTRICTION, pidSpecialMin + 0x09) +#define PR_RULE_ACTIONS PROP_TAG(PT_ACTIONS, pidSpecialMin + 0x10) +#define PR_RULE_PROVIDER PROP_TAG(PT_STRING8, pidSpecialMin + 0x11) +#define PR_RULE_NAME PROP_TAG(PT_TSTRING, pidSpecialMin + 0x12) +#define PR_RULE_LEVEL PROP_TAG(PT_LONG, pidSpecialMin + 0x13) +#define PR_RULE_PROVIDER_DATA PROP_TAG(PT_BINARY, pidSpecialMin + 0x14) + +#define PR_EXTENDED_RULE_ACTIONS PROP_TAG(PT_BINARY, pidStoreNonTransMin + 0x59) +#define PR_EXTENDED_RULE_CONDITION PROP_TAG(PT_BINARY, pidStoreNonTransMin + 0x5a) +#define PR_EXTENDED_RULE_SIZE_LIMIT PROP_TAG(PT_LONG, pidStoreNonTransMin + 0x5b) // moved to ptag.h (scottno) - still needed for 2.27 upgrader // #define PR_RULE_VERSION PROP_TAG( PT_I2, pidSpecialMin+0x1D) -//PR_STATE property values -#define ST_DISABLED 0x0000 -#define ST_ENABLED 0x0001 -#define ST_ERROR 0x0002 -#define ST_ONLY_WHEN_OOF 0x0004 -#define ST_KEEP_OOF_HIST 0x0008 -#define ST_EXIT_LEVEL 0x0010 -#define ST_SKIP_IF_SCL_IS_SAFE 0x0020 -#define ST_RULE_PARSE_ERROR 0x0040 -#define ST_CLEAR_OOF_HIST 0x80000000 +// PR_STATE property values +#define ST_DISABLED 0x0000 +#define ST_ENABLED 0x0001 +#define ST_ERROR 0x0002 +#define ST_ONLY_WHEN_OOF 0x0004 +#define ST_KEEP_OOF_HIST 0x0008 +#define ST_EXIT_LEVEL 0x0010 +#define ST_SKIP_IF_SCL_IS_SAFE 0x0020 +#define ST_RULE_PARSE_ERROR 0x0040 +#define ST_CLEAR_OOF_HIST 0x80000000 -//Empty restriction -#define NULL_RESTRICTION 0xff +// Empty restriction +#define NULL_RESTRICTION 0xff // special RELOP for Member of DL -#define RELOP_MEMBER_OF_DL 100 - -//Action types -typedef enum -{ - OP_MOVE = 1, - OP_COPY, - OP_REPLY, - OP_OOF_REPLY, - OP_DEFER_ACTION, - OP_BOUNCE, - OP_FORWARD, - OP_DELEGATE, - OP_TAG, - OP_DELETE, - OP_MARK_AS_READ, +#define RELOP_MEMBER_OF_DL 100 + +// Action types +typedef enum { + OP_MOVE = 1, + OP_COPY, + OP_REPLY, + OP_OOF_REPLY, + OP_DEFER_ACTION, + OP_BOUNCE, + OP_FORWARD, + OP_DELEGATE, + OP_TAG, + OP_DELETE, + OP_MARK_AS_READ, } ACTTYPE; // provider name for moderator rules -#define szProviderModeratorRule "MSFT:MR" -#define wszProviderModeratorRule L"MSFT:MR" +#define szProviderModeratorRule "MSFT:MR" +#define wszProviderModeratorRule L"MSFT:MR" // action flavors // for OP_REPLY -#define DO_NOT_SEND_TO_ORIGINATOR 1 -#define STOCK_REPLY_TEMPLATE 2 +#define DO_NOT_SEND_TO_ORIGINATOR 1 +#define STOCK_REPLY_TEMPLATE 2 // for OP_FORWARD -#define FWD_PRESERVE_SENDER 1 -#define FWD_DO_NOT_MUNGE_MSG 2 -#define FWD_AS_ATTACHMENT 4 - -//scBounceCode values -#define BOUNCE_MESSAGE_SIZE_TOO_LARGE (SCODE) MAPI_DIAG_LENGTH_CONSTRAINT_VIOLATD -#define BOUNCE_FORMS_MISMATCH (SCODE) MAPI_DIAG_RENDITION_UNSUPPORTED -#define BOUNCE_ACCESS_DENIED (SCODE) MAPI_DIAG_MAIL_REFUSED - -//Message class prefix for Reply and OOF Reply templates -#define szReplyTemplateMsgClassPrefix "IPM.Note.Rules.ReplyTemplate." -#define szOofTemplateMsgClassPrefix "IPM.Note.Rules.OofTemplate." - -//Action structure -typedef struct _action -{ - ACTTYPE acttype; - - // to indicate which flavor of the action. - ULONG ulActionFlavor; - - // Action restriction - // currently unused and must be set to NULL - LPSRestriction lpRes; - - // currently unused and must be set to NULL. - LPSPropTagArray lpPropTagArray; - - // User defined flags - ULONG ulFlags; - - // padding to align the union on 8 byte boundary - ULONG dwAlignPad; - - union - { - // used for OP_MOVE and OP_COPY actions - struct - { - ULONG cbStoreEntryId; - LPENTRYID lpStoreEntryId; - ULONG cbFldEntryId; - LPENTRYID lpFldEntryId; - } actMoveCopy; - - // used for OP_REPLY and OP_OOF_REPLY actions - struct - { - ULONG cbEntryId; - LPENTRYID lpEntryId; - GUID guidReplyTemplate; - } actReply; - - // used for OP_DEFER_ACTION action - struct - { - ULONG cbData; - BYTE *pbData; - } actDeferAction; - - // Error code to set for OP_BOUNCE action - SCODE scBounceCode; - - // list of address for OP_FORWARD and OP_DELEGATE action - LPADRLIST lpadrlist; - - // prop value for OP_TAG action - SPropValue propTag; - }; -} ACTION, FAR * LPACTION; +#define FWD_PRESERVE_SENDER 1 +#define FWD_DO_NOT_MUNGE_MSG 2 +#define FWD_AS_ATTACHMENT 4 + +// scBounceCode values +#define BOUNCE_MESSAGE_SIZE_TOO_LARGE (SCODE) MAPI_DIAG_LENGTH_CONSTRAINT_VIOLATD +#define BOUNCE_FORMS_MISMATCH (SCODE) MAPI_DIAG_RENDITION_UNSUPPORTED +#define BOUNCE_ACCESS_DENIED (SCODE) MAPI_DIAG_MAIL_REFUSED + +// Message class prefix for Reply and OOF Reply templates +#define szReplyTemplateMsgClassPrefix "IPM.Note.Rules.ReplyTemplate." +#define szOofTemplateMsgClassPrefix "IPM.Note.Rules.OofTemplate." + +// Action structure +typedef struct _action { + ACTTYPE acttype; + + // to indicate which flavor of the action. + ULONG ulActionFlavor; + + // Action restriction + // currently unused and must be set to NULL + LPSRestriction lpRes; + + // currently unused and must be set to NULL. + LPSPropTagArray lpPropTagArray; + + // User defined flags + ULONG ulFlags; + + // padding to align the union on 8 byte boundary + ULONG dwAlignPad; + + union { + // used for OP_MOVE and OP_COPY actions + struct { + ULONG cbStoreEntryId; + LPENTRYID lpStoreEntryId; + ULONG cbFldEntryId; + LPENTRYID lpFldEntryId; + } actMoveCopy; + + // used for OP_REPLY and OP_OOF_REPLY actions + struct { + ULONG cbEntryId; + LPENTRYID lpEntryId; + GUID guidReplyTemplate; + } actReply; + + // used for OP_DEFER_ACTION action + struct { + ULONG cbData; + BYTE *pbData; + } actDeferAction; + + // Error code to set for OP_BOUNCE action + SCODE scBounceCode; + + // list of address for OP_FORWARD and OP_DELEGATE action + LPADRLIST lpadrlist; + + // prop value for OP_TAG action + SPropValue propTag; + }; +} ACTION, FAR *LPACTION; // Rules version -#define EDK_RULES_VERSION 1 - -//Array of actions -typedef struct _actions -{ - ULONG ulVersion; // use the #define above - UINT cActions; - LPACTION lpAction; +#define EDK_RULES_VERSION 1 + +// Array of actions +typedef struct _actions { + ULONG ulVersion; // use the #define above + UINT cActions; + LPACTION lpAction; } ACTIONS; #ifdef __cplusplus extern "C" { #endif -HRESULT WINAPI -HrSerializeSRestriction(IMAPIProp * pprop, LPSRestriction prest, BYTE ** ppbRest, ULONG * pcbRest); +HRESULT WINAPI HrSerializeSRestriction(IMAPIProp *pprop, LPSRestriction prest, BYTE **ppbRest, ULONG *pcbRest); -HRESULT WINAPI -HrDeserializeSRestriction(IMAPIProp * pprop, BYTE * pbRest, ULONG cbRest, LPSRestriction * pprest); +HRESULT WINAPI HrDeserializeSRestriction(IMAPIProp *pprop, BYTE *pbRest, ULONG cbRest, LPSRestriction *pprest); -HRESULT WINAPI -HrSerializeActions(IMAPIProp * pprop, ACTIONS * pActions, BYTE ** ppbActions, ULONG * pcbActions); +HRESULT WINAPI HrSerializeActions(IMAPIProp *pprop, ACTIONS *pActions, BYTE **ppbActions, ULONG *pcbActions); -HRESULT WINAPI -HrDeserializeActions(IMAPIProp * pprop, BYTE * pbActions, ULONG cbActions, ACTIONS ** ppActions); +HRESULT WINAPI HrDeserializeActions(IMAPIProp *pprop, BYTE *pbActions, ULONG cbActions, ACTIONS **ppActions); #ifdef __cplusplus -} // extern "C" +} // extern "C" #endif // message class definitions for Deferred Action and Deffered Error messages -#define szDamMsgClass "IPC.Microsoft Exchange 4.0.Deferred Action" -#define szDemMsgClass "IPC.Microsoft Exchange 4.0.Deferred Error" +#define szDamMsgClass "IPC.Microsoft Exchange 4.0.Deferred Action" +#define szDemMsgClass "IPC.Microsoft Exchange 4.0.Deferred Error" -#define szExRuleMsgClass "IPM.ExtendedRule.Message" -#define wszExRuleMsgClass L"IPM.ExtendedRule.Message" +#define szExRuleMsgClass "IPM.ExtendedRule.Message" +#define wszExRuleMsgClass L"IPM.ExtendedRule.Message" /* * Rule error codes * Values for PR_RULE_ERROR */ -#define RULE_ERR_UNKNOWN 1 //general catchall error -#define RULE_ERR_LOAD 2 //unable to load folder rules -#define RULE_ERR_DELIVERY 3 //unable to deliver message temporarily -#define RULE_ERR_PARSING 4 //error while parsing -#define RULE_ERR_CREATE_DAE 5 //error creating DAE message -#define RULE_ERR_NO_FOLDER 6 //folder to move/copy doesn't exist -#define RULE_ERR_NO_RIGHTS 7 //no rights to move/copy into folder -#define RULE_ERR_CREATE_DAM 8 //error creating DAM -#define RULE_ERR_NO_SENDAS 9 //can not send as another user -#define RULE_ERR_NO_TEMPLATE 10 //reply template is missing -#define RULE_ERR_EXECUTION 11 //error in rule execution -#define RULE_ERR_QUOTA_EXCEEDED 12 //mailbox quota size exceeded -#define RULE_ERR_TOO_MANY_RECIPS 13 //number of recips exceded upper limit - -#define RULE_ERR_FIRST RULE_ERR_UNKNOWN -#define RULE_ERR_LAST RULE_ERR_TOO_MANY_RECIPS +#define RULE_ERR_UNKNOWN 1 // general catchall error +#define RULE_ERR_LOAD 2 // unable to load folder rules +#define RULE_ERR_DELIVERY 3 // unable to deliver message temporarily +#define RULE_ERR_PARSING 4 // error while parsing +#define RULE_ERR_CREATE_DAE 5 // error creating DAE message +#define RULE_ERR_NO_FOLDER 6 // folder to move/copy doesn't exist +#define RULE_ERR_NO_RIGHTS 7 // no rights to move/copy into folder +#define RULE_ERR_CREATE_DAM 8 // error creating DAM +#define RULE_ERR_NO_SENDAS 9 // can not send as another user +#define RULE_ERR_NO_TEMPLATE 10 // reply template is missing +#define RULE_ERR_EXECUTION 11 // error in rule execution +#define RULE_ERR_QUOTA_EXCEEDED 12 // mailbox quota size exceeded +#define RULE_ERR_TOO_MANY_RECIPS 13 // number of recips exceded upper limit + +#define RULE_ERR_FIRST RULE_ERR_UNKNOWN +#define RULE_ERR_LAST RULE_ERR_TOO_MANY_RECIPS /*------------------------------------------------------------------------ * @@ -1444,22 +1409,17 @@ HrDeserializeActions(IMAPIProp * pprop, BYTE * pbActions, ULONG cbActions, ACTIO * *-----------------------------------------------------------------------*/ -#define EXCHANGE_IEXCHANGERULEACTION_METHODS(IPURE) \ - MAPIMETHOD(ActionCount) \ - (THIS_ ULONG FAR * lpcActions) IPURE; \ - MAPIMETHOD(GetAction) \ - (THIS_ ULONG ulActionNumber, \ - LARGE_INTEGER * lpruleid, \ - LPACTION FAR * lppAction) IPURE; - -#undef INTERFACE -#define INTERFACE IExchangeRuleAction -DECLARE_MAPI_INTERFACE_(IExchangeRuleAction, IUnknown) -{ - MAPI_IUNKNOWN_METHODS(PURE) - EXCHANGE_IEXCHANGERULEACTION_METHODS(PURE) -}; -#undef IMPL +#define EXCHANGE_IEXCHANGERULEACTION_METHODS(IPURE) \ + MAPIMETHOD(ActionCount) \ + (THIS_ ULONG FAR * lpcActions) IPURE; \ + MAPIMETHOD(GetAction) \ + (THIS_ ULONG ulActionNumber, LARGE_INTEGER * lpruleid, LPACTION FAR * lppAction) IPURE; + +#undef INTERFACE +#define INTERFACE IExchangeRuleAction +DECLARE_MAPI_INTERFACE_(IExchangeRuleAction, + IUnknown){MAPI_IUNKNOWN_METHODS(PURE) EXCHANGE_IEXCHANGERULEACTION_METHODS(PURE)}; +#undef IMPL #define IMPL DECLARE_MAPI_INTERFACE_PTR(IExchangeRuleAction, LPEXCHANGERULEACTION); @@ -1472,43 +1432,26 @@ DECLARE_MAPI_INTERFACE_PTR(IExchangeRuleAction, LPEXCHANGERULEACTION); * *-----------------------------------------------------------------------*/ -#define EXCHANGE_IEXCHANGEMANAGESTORE_METHODS(IPURE) \ - MAPIMETHOD(CreateStoreEntryID) \ - (THIS_ LPSTR lpszMsgStoreDN, \ - LPSTR lpszMailboxDN, \ - ULONG ulFlags, \ - ULONG FAR * lpcbEntryID, \ - LPENTRYID FAR * lppEntryID) IPURE; \ - MAPIMETHOD(EntryIDFromSourceKey) \ - (THIS_ ULONG cFolderKeySize, \ - BYTE FAR * lpFolderSourceKey, \ - ULONG cMessageKeySize, \ - BYTE FAR * lpMessageSourceKey, \ - ULONG FAR * lpcbEntryID, \ - LPENTRYID FAR * lppEntryID) IPURE; \ - MAPIMETHOD(GetRights) \ - (THIS_ ULONG cbUserEntryID, \ - LPENTRYID lpUserEntryID, \ - ULONG cbEntryID, \ - LPENTRYID lpEntryID, \ - ULONG FAR * lpulRights) IPURE; \ - MAPIMETHOD(GetMailboxTable) \ - (THIS_ LPSTR lpszServerName, \ - LPMAPITABLE FAR * lppTable, \ - ULONG ulFlags) IPURE; \ - MAPIMETHOD(GetPublicFolderTable) \ - (THIS_ LPSTR lpszServerName, \ - LPMAPITABLE FAR * lppTable, \ - ULONG ulFlags) IPURE; - -#undef INTERFACE -#define INTERFACE IExchangeManageStore -DECLARE_MAPI_INTERFACE_(IExchangeManageStore, IUnknown) -{ - MAPI_IUNKNOWN_METHODS(PURE) - EXCHANGE_IEXCHANGEMANAGESTORE_METHODS(PURE) -}; -#undef IMPL +#define EXCHANGE_IEXCHANGEMANAGESTORE_METHODS(IPURE) \ + MAPIMETHOD(CreateStoreEntryID) \ + (THIS_ LPSTR lpszMsgStoreDN, LPSTR lpszMailboxDN, ULONG ulFlags, ULONG FAR * lpcbEntryID, \ + LPENTRYID FAR * lppEntryID) IPURE; \ + MAPIMETHOD(EntryIDFromSourceKey) \ + (THIS_ ULONG cFolderKeySize, BYTE FAR * lpFolderSourceKey, ULONG cMessageKeySize, BYTE FAR * lpMessageSourceKey, \ + ULONG FAR * lpcbEntryID, LPENTRYID FAR * lppEntryID) IPURE; \ + MAPIMETHOD(GetRights) \ + (THIS_ ULONG cbUserEntryID, LPENTRYID lpUserEntryID, ULONG cbEntryID, LPENTRYID lpEntryID, ULONG FAR * lpulRights) \ + IPURE; \ + MAPIMETHOD(GetMailboxTable) \ + (THIS_ LPSTR lpszServerName, LPMAPITABLE FAR * lppTable, ULONG ulFlags) IPURE; \ + MAPIMETHOD(GetPublicFolderTable) \ + (THIS_ LPSTR lpszServerName, LPMAPITABLE FAR * lppTable, ULONG ulFlags) IPURE; + +#undef INTERFACE +#define INTERFACE IExchangeManageStore +DECLARE_MAPI_INTERFACE_(IExchangeManageStore, + IUnknown){MAPI_IUNKNOWN_METHODS(PURE) EXCHANGE_IEXCHANGEMANAGESTORE_METHODS(PURE)}; +#undef IMPL #define IMPL DECLARE_MAPI_INTERFACE_PTR(IExchangeManageStore, LPEXCHANGEMANAGESTORE); @@ -1521,26 +1464,20 @@ DECLARE_MAPI_INTERFACE_PTR(IExchangeManageStore, LPEXCHANGEMANAGESTORE); * *-----------------------------------------------------------------------*/ -#define EXCHANGE_IEXCHANGEMANAGESTORE2_METHODS(IPURE) \ - MAPIMETHOD(CreateNewsgroupNameEntryID) \ - (THIS_ LPSTR lpszNewsgroupName, \ - ULONG FAR * lpcbEntryID, \ - LPENTRYID FAR * lppEntryID) IPURE; - -#undef INTERFACE -#define INTERFACE IExchangeManageStore2 -DECLARE_MAPI_INTERFACE_(IExchangeManageStore2, IUnknown) -{ - MAPI_IUNKNOWN_METHODS(PURE) - EXCHANGE_IEXCHANGEMANAGESTORE_METHODS(PURE) - EXCHANGE_IEXCHANGEMANAGESTORE2_METHODS(PURE) -}; -#undef IMPL +#define EXCHANGE_IEXCHANGEMANAGESTORE2_METHODS(IPURE) \ + MAPIMETHOD(CreateNewsgroupNameEntryID) \ + (THIS_ LPSTR lpszNewsgroupName, ULONG FAR * lpcbEntryID, LPENTRYID FAR * lppEntryID) IPURE; + +#undef INTERFACE +#define INTERFACE IExchangeManageStore2 +DECLARE_MAPI_INTERFACE_(IExchangeManageStore2, IUnknown){MAPI_IUNKNOWN_METHODS(PURE) + EXCHANGE_IEXCHANGEMANAGESTORE_METHODS(PURE) + EXCHANGE_IEXCHANGEMANAGESTORE2_METHODS(PURE)}; +#undef IMPL #define IMPL DECLARE_MAPI_INTERFACE_PTR(IExchangeManageStore2, LPEXCHANGEMANAGESTORE2); - /*------------------------------------------------------------------------ * * "IExchangeManageStore3" Interface Declaration @@ -1549,28 +1486,20 @@ DECLARE_MAPI_INTERFACE_PTR(IExchangeManageStore2, LPEXCHANGEMANAGESTORE2); * *-----------------------------------------------------------------------*/ -#define EXCHANGE_IEXCHANGEMANAGESTORE3_METHODS(IPURE) \ - MAPIMETHOD(GetMailboxTableOffset) \ - (THIS_ LPSTR lpszServerName, \ - LPMAPITABLE FAR * lppTable, \ - ULONG ulFlags, \ - UINT uOffset) IPURE; - -#undef INTERFACE -#define INTERFACE IExchangeManageStore3 -DECLARE_MAPI_INTERFACE_(IExchangeManageStore3, IUnknown) -{ - MAPI_IUNKNOWN_METHODS(PURE) - EXCHANGE_IEXCHANGEMANAGESTORE_METHODS(PURE) - EXCHANGE_IEXCHANGEMANAGESTORE2_METHODS(PURE) - EXCHANGE_IEXCHANGEMANAGESTORE3_METHODS(PURE) -}; -#undef IMPL +#define EXCHANGE_IEXCHANGEMANAGESTORE3_METHODS(IPURE) \ + MAPIMETHOD(GetMailboxTableOffset) \ + (THIS_ LPSTR lpszServerName, LPMAPITABLE FAR * lppTable, ULONG ulFlags, UINT uOffset) IPURE; + +#undef INTERFACE +#define INTERFACE IExchangeManageStore3 +DECLARE_MAPI_INTERFACE_(IExchangeManageStore3, IUnknown){ + MAPI_IUNKNOWN_METHODS(PURE) EXCHANGE_IEXCHANGEMANAGESTORE_METHODS(PURE) EXCHANGE_IEXCHANGEMANAGESTORE2_METHODS(PURE) + EXCHANGE_IEXCHANGEMANAGESTORE3_METHODS(PURE)}; +#undef IMPL #define IMPL DECLARE_MAPI_INTERFACE_PTR(IExchangeManageStore3, LPEXCHANGEMANAGESTORE3); - /*------------------------------------------------------------------------ * * "IExchangeManageStore4" Interface Declaration @@ -1579,29 +1508,20 @@ DECLARE_MAPI_INTERFACE_PTR(IExchangeManageStore3, LPEXCHANGEMANAGESTORE3); * *-----------------------------------------------------------------------*/ -#define EXCHANGE_IEXCHANGEMANAGESTORE4_METHODS(IPURE) \ - MAPIMETHOD(GetPublicFolderTableOffset) \ - (THIS_ LPSTR lpszServerName, \ - LPMAPITABLE FAR * lppTable, \ - ULONG ulFlags, \ - UINT uOffset) IPURE; - -#undef INTERFACE -#define INTERFACE IExchangeManageStore4 -DECLARE_MAPI_INTERFACE_(IExchangeManageStore4, IUnknown) -{ - MAPI_IUNKNOWN_METHODS(PURE) - EXCHANGE_IEXCHANGEMANAGESTORE_METHODS(PURE) - EXCHANGE_IEXCHANGEMANAGESTORE2_METHODS(PURE) - EXCHANGE_IEXCHANGEMANAGESTORE3_METHODS(PURE) - EXCHANGE_IEXCHANGEMANAGESTORE4_METHODS(PURE) -}; -#undef IMPL +#define EXCHANGE_IEXCHANGEMANAGESTORE4_METHODS(IPURE) \ + MAPIMETHOD(GetPublicFolderTableOffset) \ + (THIS_ LPSTR lpszServerName, LPMAPITABLE FAR * lppTable, ULONG ulFlags, UINT uOffset) IPURE; + +#undef INTERFACE +#define INTERFACE IExchangeManageStore4 +DECLARE_MAPI_INTERFACE_(IExchangeManageStore4, IUnknown){ + MAPI_IUNKNOWN_METHODS(PURE) EXCHANGE_IEXCHANGEMANAGESTORE_METHODS(PURE) EXCHANGE_IEXCHANGEMANAGESTORE2_METHODS(PURE) + EXCHANGE_IEXCHANGEMANAGESTORE3_METHODS(PURE) EXCHANGE_IEXCHANGEMANAGESTORE4_METHODS(PURE)}; +#undef IMPL #define IMPL DECLARE_MAPI_INTERFACE_PTR(IExchangeManageStore4, LPEXCHANGEMANAGESTORE4); - /*------------------------------------------------------------------------ * * "IExchangeNntpNewsfeed" Interface Declaration @@ -1610,110 +1530,101 @@ DECLARE_MAPI_INTERFACE_PTR(IExchangeManageStore4, LPEXCHANGEMANAGESTORE4); * *-----------------------------------------------------------------------*/ -#define EXCHANGE_IEXCHANGENNTPNEWSFEED_METHODS(IPURE) \ - MAPIMETHOD(Configure) \ - (THIS_ LPSTR lpszNewsfeedDN, \ - ULONG cValues, \ - LPSPropValue lpIMailPropArray) IPURE; \ - MAPIMETHOD(CheckMsgIds) \ - (THIS_ LPSTR lpszMsgIds, \ - ULONG FAR * lpcfWanted, \ - BYTE FAR ** lppfWanted) IPURE; \ - MAPIMETHOD(OpenArticleStream) \ - (THIS_ LPSTREAM FAR * lppStream) IPURE; \ - - -#undef INTERFACE -#define INTERFACE IExchangeNntpNewsfeed -DECLARE_MAPI_INTERFACE_(IExchangeNntpNewsfeed, IUnknown) -{ - MAPI_IUNKNOWN_METHODS(PURE) - EXCHANGE_IEXCHANGENNTPNEWSFEED_METHODS(PURE) -}; -#undef IMPL +#define EXCHANGE_IEXCHANGENNTPNEWSFEED_METHODS(IPURE) \ + MAPIMETHOD(Configure) \ + (THIS_ LPSTR lpszNewsfeedDN, ULONG cValues, LPSPropValue lpIMailPropArray) IPURE; \ + MAPIMETHOD(CheckMsgIds) \ + (THIS_ LPSTR lpszMsgIds, ULONG FAR * lpcfWanted, BYTE FAR * *lppfWanted) IPURE; \ + MAPIMETHOD(OpenArticleStream) \ + (THIS_ LPSTREAM FAR * lppStream) IPURE; + +#undef INTERFACE +#define INTERFACE IExchangeNntpNewsfeed +DECLARE_MAPI_INTERFACE_(IExchangeNntpNewsfeed, + IUnknown){MAPI_IUNKNOWN_METHODS(PURE) EXCHANGE_IEXCHANGENNTPNEWSFEED_METHODS(PURE)}; +#undef IMPL #define IMPL DECLARE_MAPI_INTERFACE_PTR(IExchangeNntpNewsfeed, LPEXCHANGENNTPNEWSFEED); // Properties for GetMailboxTable -#define PR_NT_USER_NAME PROP_TAG(PT_TSTRING, pidAdminMin+0x10) +#define PR_NT_USER_NAME PROP_TAG(PT_TSTRING, pidAdminMin + 0x10) // // PR_LOCALE_ID definition has been moved down and combined with other // locale-specific properties. It is still being returned through the // mailbox table. // -//#define PR_LOCALE_ID PROP_TAG( PT_LONG, pidAdminMin+0x11 ) -#define PR_LAST_LOGON_TIME PROP_TAG(PT_SYSTIME, pidAdminMin+0x12 ) -#define PR_LAST_LOGOFF_TIME PROP_TAG(PT_SYSTIME, pidAdminMin+0x13 ) -#define PR_STORAGE_LIMIT_INFORMATION PROP_TAG(PT_LONG, pidAdminMin+0x14 ) +// #define PR_LOCALE_ID PROP_TAG( PT_LONG, pidAdminMin+0x11 ) +#define PR_LAST_LOGON_TIME PROP_TAG(PT_SYSTIME, pidAdminMin + 0x12) +#define PR_LAST_LOGOFF_TIME PROP_TAG(PT_SYSTIME, pidAdminMin + 0x13) +#define PR_STORAGE_LIMIT_INFORMATION PROP_TAG(PT_LONG, pidAdminMin + 0x14) // property on disabling message read (unread) receipt // reusing Folders table property (pidAdminMin+0x15) -#define PR_INTERNET_MDNS PROP_TAG(PT_BOOLEAN, PROP_ID(PR_NEWSGROUP_COMPONENT)) +#define PR_INTERNET_MDNS PROP_TAG(PT_BOOLEAN, PROP_ID(PR_NEWSGROUP_COMPONENT)) // properties for mailbox quota info - reusing properties from folder table - // folder pathname, owner, and contacts re-used. -#define PR_QUOTA_WARNING_THRESHOLD PROP_TAG(PT_LONG, pidAdminMin+0x91) -#define PR_QUOTA_SEND_THRESHOLD PROP_TAG(PT_LONG, pidAdminMin+0x92) -#define PR_QUOTA_RECEIVE_THRESHOLD PROP_TAG(PT_LONG, pidAdminMin+0x93) - +#define PR_QUOTA_WARNING_THRESHOLD PROP_TAG(PT_LONG, pidAdminMin + 0x91) +#define PR_QUOTA_SEND_THRESHOLD PROP_TAG(PT_LONG, pidAdminMin + 0x92) +#define PR_QUOTA_RECEIVE_THRESHOLD PROP_TAG(PT_LONG, pidAdminMin + 0x93) // Properties for GetPublicFolderTable -#define PR_FOLDER_FLAGS PROP_TAG(PT_LONG, pidAdminMin+0x18) -#define PR_LAST_ACCESS_TIME PROP_TAG(PT_SYSTIME, pidAdminMin+0x19) -#define PR_RESTRICTION_COUNT PROP_TAG(PT_LONG, pidAdminMin+0x1A) -#define PR_CATEG_COUNT PROP_TAG(PT_LONG, pidAdminMin+0x1B) -#define PR_CACHED_COLUMN_COUNT PROP_TAG(PT_LONG, pidAdminMin+0x1C) -#define PR_NORMAL_MSG_W_ATTACH_COUNT PROP_TAG(PT_LONG, pidAdminMin+0x1D) -#define PR_ASSOC_MSG_W_ATTACH_COUNT PROP_TAG(PT_LONG, pidAdminMin+0x1E) -#define PR_RECIPIENT_ON_NORMAL_MSG_COUNT PROP_TAG(PT_LONG, pidAdminMin+0x1F) -#define PR_RECIPIENT_ON_ASSOC_MSG_COUNT PROP_TAG(PT_LONG, pidAdminMin+0x20) -#define PR_ATTACH_ON_NORMAL_MSG_COUNT PROP_TAG(PT_LONG, pidAdminMin+0x21) -#define PR_ATTACH_ON_ASSOC_MSG_COUNT PROP_TAG(PT_LONG, pidAdminMin+0x22) -#define PR_NORMAL_MESSAGE_SIZE PROP_TAG(PT_LONG, pidAdminMin+0x23) -#define PR_NORMAL_MESSAGE_SIZE_EXTENDED PROP_TAG(PT_I8, pidAdminMin+0x23) -#define PR_ASSOC_MESSAGE_SIZE PROP_TAG(PT_LONG, pidAdminMin+0x24) -#define PR_ASSOC_MESSAGE_SIZE_EXTENDED PROP_TAG(PT_I8, pidAdminMin+0x24) -#define PR_FOLDER_PATHNAME PROP_TAG(PT_TSTRING, pidAdminMin+0x25) -#define PR_OWNER_COUNT PROP_TAG(PT_LONG, pidAdminMin+0x26) -#define PR_CONTACT_COUNT PROP_TAG(PT_LONG, pidAdminMin+0x27) +#define PR_FOLDER_FLAGS PROP_TAG(PT_LONG, pidAdminMin + 0x18) +#define PR_LAST_ACCESS_TIME PROP_TAG(PT_SYSTIME, pidAdminMin + 0x19) +#define PR_RESTRICTION_COUNT PROP_TAG(PT_LONG, pidAdminMin + 0x1A) +#define PR_CATEG_COUNT PROP_TAG(PT_LONG, pidAdminMin + 0x1B) +#define PR_CACHED_COLUMN_COUNT PROP_TAG(PT_LONG, pidAdminMin + 0x1C) +#define PR_NORMAL_MSG_W_ATTACH_COUNT PROP_TAG(PT_LONG, pidAdminMin + 0x1D) +#define PR_ASSOC_MSG_W_ATTACH_COUNT PROP_TAG(PT_LONG, pidAdminMin + 0x1E) +#define PR_RECIPIENT_ON_NORMAL_MSG_COUNT PROP_TAG(PT_LONG, pidAdminMin + 0x1F) +#define PR_RECIPIENT_ON_ASSOC_MSG_COUNT PROP_TAG(PT_LONG, pidAdminMin + 0x20) +#define PR_ATTACH_ON_NORMAL_MSG_COUNT PROP_TAG(PT_LONG, pidAdminMin + 0x21) +#define PR_ATTACH_ON_ASSOC_MSG_COUNT PROP_TAG(PT_LONG, pidAdminMin + 0x22) +#define PR_NORMAL_MESSAGE_SIZE PROP_TAG(PT_LONG, pidAdminMin + 0x23) +#define PR_NORMAL_MESSAGE_SIZE_EXTENDED PROP_TAG(PT_I8, pidAdminMin + 0x23) +#define PR_ASSOC_MESSAGE_SIZE PROP_TAG(PT_LONG, pidAdminMin + 0x24) +#define PR_ASSOC_MESSAGE_SIZE_EXTENDED PROP_TAG(PT_I8, pidAdminMin + 0x24) +#define PR_FOLDER_PATHNAME PROP_TAG(PT_TSTRING, pidAdminMin + 0x25) +#define PR_OWNER_COUNT PROP_TAG(PT_LONG, pidAdminMin + 0x26) +#define PR_CONTACT_COUNT PROP_TAG(PT_LONG, pidAdminMin + 0x27) /* the absolute size limitation of a public folder */ -#define PR_PF_OVER_HARD_QUOTA_LIMIT PROP_TAG(PT_LONG, pidAdminMin+0x91) +#define PR_PF_OVER_HARD_QUOTA_LIMIT PROP_TAG(PT_LONG, pidAdminMin + 0x91) /* the size limit of a message in a public folder */ -#define PR_PF_MSG_SIZE_LIMIT PROP_TAG(PT_LONG, pidAdminMin+0x92) +#define PR_PF_MSG_SIZE_LIMIT PROP_TAG(PT_LONG, pidAdminMin + 0x92) // Do not inherit expiry settings from the MDB wide settings and instead use folder specific ones // (if folder specific is not set, it will still not get from MDB and remain with no expiry at all) -#define PR_PF_DISALLOW_MDB_WIDE_EXPIRY PROP_TAG(PT_BOOLEAN, pidAdminMin+0x93) +#define PR_PF_DISALLOW_MDB_WIDE_EXPIRY PROP_TAG(PT_BOOLEAN, pidAdminMin + 0x93) // Locale-specific properties -#define PR_LOCALE_ID PROP_TAG(PT_LONG, pidAdminMin+0x11) -#define PR_CODE_PAGE_ID PROP_TAG(PT_LONG, pidAdminMin+0x33) -#define PR_SORT_LOCALE_ID PROP_TAG(PT_LONG, pidAdminMin+0x75) +#define PR_LOCALE_ID PROP_TAG(PT_LONG, pidAdminMin + 0x11) +#define PR_CODE_PAGE_ID PROP_TAG(PT_LONG, pidAdminMin + 0x33) +#define PR_SORT_LOCALE_ID PROP_TAG(PT_LONG, pidAdminMin + 0x75) // PT_I8 version of PR_MESSAGE_SIZE defined in mapitags.h -#define PR_MESSAGE_SIZE_EXTENDED PROP_TAG(PT_I8, PROP_ID(PR_MESSAGE_SIZE)) +#define PR_MESSAGE_SIZE_EXTENDED PROP_TAG(PT_I8, PROP_ID(PR_MESSAGE_SIZE)) /* Bits in PR_FOLDER_FLAGS */ -#define MDB_FOLDER_IPM 0x1 -#define MDB_FOLDER_SEARCH 0x2 -#define MDB_FOLDER_NORMAL 0x4 -#define MDB_FOLDER_RULES 0x8 +#define MDB_FOLDER_IPM 0x1 +#define MDB_FOLDER_SEARCH 0x2 +#define MDB_FOLDER_NORMAL 0x4 +#define MDB_FOLDER_RULES 0x8 /* Bits used in ulFlags in GetPublicFolderTable() */ -#define MDB_NON_IPM 0x10 -#define MDB_IPM 0x20 +#define MDB_NON_IPM 0x10 +#define MDB_IPM 0x20 /* Bits in PR_STORAGE_LIMIT_INFORMATION */ -#define MDB_LIMIT_BELOW 0x1 -#define MDB_LIMIT_ISSUE_WARNING 0x2 -#define MDB_LIMIT_PROHIBIT_SEND 0x4 -#define MDB_LIMIT_NO_CHECK 0x8 -#define MDB_LIMIT_DISABLED 0x10 +#define MDB_LIMIT_BELOW 0x1 +#define MDB_LIMIT_ISSUE_WARNING 0x2 +#define MDB_LIMIT_PROHIBIT_SEND 0x4 +#define MDB_LIMIT_NO_CHECK 0x8 +#define MDB_LIMIT_DISABLED 0x10 /* A define for "no quota infomation" when retrieving the quota information */ -#define MDB_QUOTA_NOQUOTA 0xFFFFFFFF +#define MDB_QUOTA_NOQUOTA 0xFFFFFFFF /*------------------------------------------------------------------------ * @@ -1729,40 +1640,28 @@ DECLARE_MAPI_INTERFACE_PTR(IExchangeNntpNewsfeed, LPEXCHANGENNTPNEWSFEED); // Use MAPI_MOVE for move option // Transfer methods -#define TRANSFER_COPYTO 1 -#define TRANSFER_COPYPROPS 2 -#define TRANSFER_COPYMESSAGES 3 -#define TRANSFER_COPYFOLDER 4 - - -#define EXCHANGE_IEXCHANGEFASTTRANSFER_METHODS(IPURE) \ - MAPIMETHOD(Config) \ - (THIS_ ULONG ulFlags, \ - ULONG ulTransferMethod) IPURE; \ - MAPIMETHOD(TransferBuffer) \ - (THIS_ ULONG cb, \ - LPBYTE lpb, \ - ULONG *lpcbProcessed) IPURE; \ - STDMETHOD_(BOOL, IsInterfaceOk) \ - (THIS_ ULONG ulTransferMethod, \ - REFIID refiid, \ - LPSPropTagArray lpptagList, \ - ULONG ulFlags) IPURE; - -#undef INTERFACE -#define INTERFACE IExchangeFastTransfer -DECLARE_MAPI_INTERFACE_(IExchangeFastTransfer, IUnknown) -{ - MAPI_IUNKNOWN_METHODS(PURE) - EXCHANGE_IEXCHANGEFASTTRANSFER_METHODS(PURE) -}; -#undef IMPL +#define TRANSFER_COPYTO 1 +#define TRANSFER_COPYPROPS 2 +#define TRANSFER_COPYMESSAGES 3 +#define TRANSFER_COPYFOLDER 4 + +#define EXCHANGE_IEXCHANGEFASTTRANSFER_METHODS(IPURE) \ + MAPIMETHOD(Config) \ + (THIS_ ULONG ulFlags, ULONG ulTransferMethod) IPURE; \ + MAPIMETHOD(TransferBuffer) \ + (THIS_ ULONG cb, LPBYTE lpb, ULONG * lpcbProcessed) IPURE; \ + STDMETHOD_(BOOL, IsInterfaceOk) \ + (THIS_ ULONG ulTransferMethod, REFIID refiid, LPSPropTagArray lpptagList, ULONG ulFlags) IPURE; + +#undef INTERFACE +#define INTERFACE IExchangeFastTransfer +DECLARE_MAPI_INTERFACE_(IExchangeFastTransfer, + IUnknown){MAPI_IUNKNOWN_METHODS(PURE) EXCHANGE_IEXCHANGEFASTTRANSFER_METHODS(PURE)}; +#undef IMPL #define IMPL DECLARE_MAPI_INTERFACE_PTR(IExchangeFastTransfer, LPEXCHANGEFASTTRANSFER); - - /*------------------------------------------------------------------------ * * "IExchangeExportChanges" Interface Declaration @@ -1771,33 +1670,22 @@ DECLARE_MAPI_INTERFACE_PTR(IExchangeFastTransfer, LPEXCHANGEFASTTRANSFER); * *-----------------------------------------------------------------------*/ -#define EXCHANGE_IEXCHANGEEXPORTCHANGES_METHODS(IPURE) \ - MAPIMETHOD(GetLastError) \ - (THIS_ HRESULT hResult, \ - ULONG ulFlags, \ - LPMAPIERROR FAR * lppMAPIError) IPURE; \ - MAPIMETHOD(Config) \ - (THIS_ LPSTREAM lpStream, \ - ULONG ulFlags, \ - LPUNKNOWN lpUnk, \ - LPSRestriction lpRestriction, \ - LPSPropTagArray lpIncludeProps, \ - LPSPropTagArray lpExcludeProps, \ - ULONG ulBufferSize) IPURE; \ - MAPIMETHOD(Synchronize) \ - (THIS_ ULONG FAR * lpulSteps, \ - ULONG FAR * lpulProgress) IPURE; \ - MAPIMETHOD(UpdateState) \ - (THIS_ LPSTREAM lpStream) IPURE; - -#undef INTERFACE -#define INTERFACE IExchangeExportChanges -DECLARE_MAPI_INTERFACE_(IExchangeExportChanges, IUnknown) -{ - MAPI_IUNKNOWN_METHODS(PURE) - EXCHANGE_IEXCHANGEEXPORTCHANGES_METHODS(PURE) -}; -#undef IMPL +#define EXCHANGE_IEXCHANGEEXPORTCHANGES_METHODS(IPURE) \ + MAPIMETHOD(GetLastError) \ + (THIS_ HRESULT hResult, ULONG ulFlags, LPMAPIERROR FAR * lppMAPIError) IPURE; \ + MAPIMETHOD(Config) \ + (THIS_ LPSTREAM lpStream, ULONG ulFlags, LPUNKNOWN lpUnk, LPSRestriction lpRestriction, \ + LPSPropTagArray lpIncludeProps, LPSPropTagArray lpExcludeProps, ULONG ulBufferSize) IPURE; \ + MAPIMETHOD(Synchronize) \ + (THIS_ ULONG FAR * lpulSteps, ULONG FAR * lpulProgress) IPURE; \ + MAPIMETHOD(UpdateState) \ + (THIS_ LPSTREAM lpStream) IPURE; + +#undef INTERFACE +#define INTERFACE IExchangeExportChanges +DECLARE_MAPI_INTERFACE_(IExchangeExportChanges, + IUnknown){MAPI_IUNKNOWN_METHODS(PURE) EXCHANGE_IEXCHANGEEXPORTCHANGES_METHODS(PURE)}; +#undef IMPL #define IMPL DECLARE_MAPI_INTERFACE_PTR(IExchangeExportChanges, LPEXCHANGEEXPORTCHANGES); @@ -1811,25 +1699,17 @@ DECLARE_MAPI_INTERFACE_PTR(IExchangeExportChanges, LPEXCHANGEEXPORTCHANGES); * *-----------------------------------------------------------------------*/ -#define EXCHANGE_IEXCHANGEEXPORTCHANGES2_METHODS(IPURE) \ - MAPIMETHOD(ConfigForConversionStream) \ - (THIS_ LPSTREAM lpStream, \ - ULONG ulFlags, \ - LPUNKNOWN lpUnk, \ - LPSRestriction lpRestriction, \ - ULONG cValuesConversion, \ - LPSPropValue lpPropArrayConversion, \ - ULONG ulBufferSize) IPURE; - -#undef INTERFACE -#define INTERFACE IExchangeExportChanges2 -DECLARE_MAPI_INTERFACE_(IExchangeExportChanges2, IExchangeExportChanges) -{ - MAPI_IUNKNOWN_METHODS(PURE) - EXCHANGE_IEXCHANGEEXPORTCHANGES_METHODS(PURE) - EXCHANGE_IEXCHANGEEXPORTCHANGES2_METHODS(PURE) -}; -#undef IMPL +#define EXCHANGE_IEXCHANGEEXPORTCHANGES2_METHODS(IPURE) \ + MAPIMETHOD(ConfigForConversionStream) \ + (THIS_ LPSTREAM lpStream, ULONG ulFlags, LPUNKNOWN lpUnk, LPSRestriction lpRestriction, ULONG cValuesConversion, \ + LPSPropValue lpPropArrayConversion, ULONG ulBufferSize) IPURE; + +#undef INTERFACE +#define INTERFACE IExchangeExportChanges2 +DECLARE_MAPI_INTERFACE_(IExchangeExportChanges2, IExchangeExportChanges){ + MAPI_IUNKNOWN_METHODS(PURE) EXCHANGE_IEXCHANGEEXPORTCHANGES_METHODS(PURE) + EXCHANGE_IEXCHANGEEXPORTCHANGES2_METHODS(PURE)}; +#undef IMPL #define IMPL DECLARE_MAPI_INTERFACE_PTR(IExchangeExportChanges2, LPEXCHANGEEXPORTCHANGES2); @@ -1843,36 +1723,25 @@ DECLARE_MAPI_INTERFACE_PTR(IExchangeExportChanges2, LPEXCHANGEEXPORTCHANGES2); * *-----------------------------------------------------------------------*/ -#define EXCHANGE_IEXCHANGEEXPORTCHANGES3_METHODS(IPURE) \ - MAPIMETHOD(ConfigForSelectiveSync) \ - (THIS_ LPSTREAM lpStream, \ - ULONG ulFlags, \ - LPUNKNOWN lpUnk, \ - LPENTRYLIST lpMsgList, \ - LPSRestriction lpRestriction, \ - LPSPropTagArray lpIncludeProps, \ - LPSPropTagArray lpExcludeProps, \ - ULONG ulBufferSize) IPURE; - -#undef INTERFACE -#define INTERFACE IExchangeExportChanges3 -DECLARE_MAPI_INTERFACE_(IExchangeExportChanges3, IExchangeExportChanges2) -{ - MAPI_IUNKNOWN_METHODS(PURE) - EXCHANGE_IEXCHANGEEXPORTCHANGES_METHODS(PURE) - EXCHANGE_IEXCHANGEEXPORTCHANGES2_METHODS(PURE) - EXCHANGE_IEXCHANGEEXPORTCHANGES3_METHODS(PURE) -}; -#undef IMPL +#define EXCHANGE_IEXCHANGEEXPORTCHANGES3_METHODS(IPURE) \ + MAPIMETHOD(ConfigForSelectiveSync) \ + (THIS_ LPSTREAM lpStream, ULONG ulFlags, LPUNKNOWN lpUnk, LPENTRYLIST lpMsgList, LPSRestriction lpRestriction, \ + LPSPropTagArray lpIncludeProps, LPSPropTagArray lpExcludeProps, ULONG ulBufferSize) IPURE; + +#undef INTERFACE +#define INTERFACE IExchangeExportChanges3 +DECLARE_MAPI_INTERFACE_(IExchangeExportChanges3, IExchangeExportChanges2){ + MAPI_IUNKNOWN_METHODS(PURE) EXCHANGE_IEXCHANGEEXPORTCHANGES_METHODS(PURE) + EXCHANGE_IEXCHANGEEXPORTCHANGES2_METHODS(PURE) EXCHANGE_IEXCHANGEEXPORTCHANGES3_METHODS(PURE)}; +#undef IMPL #define IMPL DECLARE_MAPI_INTERFACE_PTR(IExchangeExportChanges3, LPEXCHANGEEXPORTCHANGES3); -typedef struct _ReadState -{ - ULONG cbSourceKey; - BYTE * pbSourceKey; - ULONG ulFlags; +typedef struct _ReadState { + ULONG cbSourceKey; + BYTE *pbSourceKey; + ULONG ulFlags; } READSTATE, *LPREADSTATE; /*------------------------------------------------------------------------ @@ -1883,53 +1752,32 @@ typedef struct _ReadState * *-----------------------------------------------------------------------*/ - -#define EXCHANGE_IEXCHANGEIMPORTCONTENTSCHANGES_METHODS(IPURE) \ - MAPIMETHOD(GetLastError) \ - (THIS_ HRESULT hResult, \ - ULONG ulFlags, \ - LPMAPIERROR FAR * lppMAPIError) IPURE; \ - MAPIMETHOD(Config) \ - (THIS_ LPSTREAM lpStream, \ - ULONG ulFlags) IPURE; \ - MAPIMETHOD(UpdateState) \ - (THIS_ LPSTREAM lpStream) IPURE; \ - MAPIMETHOD(ImportMessageChange) \ - (THIS_ ULONG cpvalChanges, \ - LPSPropValue ppvalChanges, \ - ULONG ulFlags, \ - LPMESSAGE *lppmessage) IPURE; \ - MAPIMETHOD(ImportMessageDeletion) \ - (THIS_ ULONG ulFlags, \ - LPENTRYLIST lpSrcEntryList) IPURE; \ - MAPIMETHOD(ImportPerUserReadStateChange) \ - (THIS_ ULONG cElements, \ - LPREADSTATE lpReadState) IPURE; \ - MAPIMETHOD(ImportMessageMove) \ - (THIS_ ULONG cbSourceKeySrcFolder, \ - BYTE FAR * pbSourceKeySrcFolder, \ - ULONG cbSourceKeySrcMessage, \ - BYTE FAR * pbSourceKeySrcMessage, \ - ULONG cbPCLMessage, \ - BYTE FAR * pbPCLMessage, \ - ULONG cbSourceKeyDestMessage, \ - BYTE FAR * pbSourceKeyDestMessage, \ - ULONG cbChangeNumDestMessage, \ - BYTE FAR * pbChangeNumDestMessage) IPURE; - - -#undef INTERFACE -#define INTERFACE IExchangeImportContentsChanges -DECLARE_MAPI_INTERFACE_(IExchangeImportContentsChanges, IUnknown) -{ - MAPI_IUNKNOWN_METHODS(PURE) - EXCHANGE_IEXCHANGEIMPORTCONTENTSCHANGES_METHODS(PURE) -}; -#undef IMPL +#define EXCHANGE_IEXCHANGEIMPORTCONTENTSCHANGES_METHODS(IPURE) \ + MAPIMETHOD(GetLastError) \ + (THIS_ HRESULT hResult, ULONG ulFlags, LPMAPIERROR FAR * lppMAPIError) IPURE; \ + MAPIMETHOD(Config) \ + (THIS_ LPSTREAM lpStream, ULONG ulFlags) IPURE; \ + MAPIMETHOD(UpdateState) \ + (THIS_ LPSTREAM lpStream) IPURE; \ + MAPIMETHOD(ImportMessageChange) \ + (THIS_ ULONG cpvalChanges, LPSPropValue ppvalChanges, ULONG ulFlags, LPMESSAGE * lppmessage) IPURE; \ + MAPIMETHOD(ImportMessageDeletion) \ + (THIS_ ULONG ulFlags, LPENTRYLIST lpSrcEntryList) IPURE; \ + MAPIMETHOD(ImportPerUserReadStateChange) \ + (THIS_ ULONG cElements, LPREADSTATE lpReadState) IPURE; \ + MAPIMETHOD(ImportMessageMove) \ + (THIS_ ULONG cbSourceKeySrcFolder, BYTE FAR * pbSourceKeySrcFolder, ULONG cbSourceKeySrcMessage, \ + BYTE FAR * pbSourceKeySrcMessage, ULONG cbPCLMessage, BYTE FAR * pbPCLMessage, ULONG cbSourceKeyDestMessage, \ + BYTE FAR * pbSourceKeyDestMessage, ULONG cbChangeNumDestMessage, BYTE FAR * pbChangeNumDestMessage) IPURE; + +#undef INTERFACE +#define INTERFACE IExchangeImportContentsChanges +DECLARE_MAPI_INTERFACE_(IExchangeImportContentsChanges, + IUnknown){MAPI_IUNKNOWN_METHODS(PURE) EXCHANGE_IEXCHANGEIMPORTCONTENTSCHANGES_METHODS(PURE)}; +#undef IMPL #define IMPL -DECLARE_MAPI_INTERFACE_PTR(IExchangeImportContentsChanges, - LPEXCHANGEIMPORTCONTENTSCHANGES); +DECLARE_MAPI_INTERFACE_PTR(IExchangeImportContentsChanges, LPEXCHANGEIMPORTCONTENTSCHANGES); /*------------------------------------------------------------------------ * @@ -1941,33 +1789,21 @@ DECLARE_MAPI_INTERFACE_PTR(IExchangeImportContentsChanges, * *-----------------------------------------------------------------------*/ - -#define EXCHANGE_IEXCHANGEIMPORTCONTENTSCHANGES2_METHODS(IPURE) \ - MAPIMETHOD(ConfigForConversionStream) \ - (THIS_ LPSTREAM lpStream, \ - ULONG ulFlags, \ - ULONG cValuesConversion, \ - LPSPropValue lpPropArrayConversion) IPURE; \ - MAPIMETHOD(ImportMessageChangeAsAStream) \ - (THIS_ ULONG cpvalChanges, \ - LPSPropValue ppvalChanges, \ - ULONG ulFlags, \ - LPSTREAM *lppstream) IPURE; \ - - -#undef INTERFACE -#define INTERFACE IExchangeImportContentsChanges2 -DECLARE_MAPI_INTERFACE_(IExchangeImportContentsChanges2, IExchangeImportContentsChanges) -{ - MAPI_IUNKNOWN_METHODS(PURE) - EXCHANGE_IEXCHANGEIMPORTCONTENTSCHANGES_METHODS(PURE) - EXCHANGE_IEXCHANGEIMPORTCONTENTSCHANGES2_METHODS(PURE) -}; -#undef IMPL +#define EXCHANGE_IEXCHANGEIMPORTCONTENTSCHANGES2_METHODS(IPURE) \ + MAPIMETHOD(ConfigForConversionStream) \ + (THIS_ LPSTREAM lpStream, ULONG ulFlags, ULONG cValuesConversion, LPSPropValue lpPropArrayConversion) IPURE; \ + MAPIMETHOD(ImportMessageChangeAsAStream) \ + (THIS_ ULONG cpvalChanges, LPSPropValue ppvalChanges, ULONG ulFlags, LPSTREAM * lppstream) IPURE; + +#undef INTERFACE +#define INTERFACE IExchangeImportContentsChanges2 +DECLARE_MAPI_INTERFACE_(IExchangeImportContentsChanges2, IExchangeImportContentsChanges){ + MAPI_IUNKNOWN_METHODS(PURE) EXCHANGE_IEXCHANGEIMPORTCONTENTSCHANGES_METHODS(PURE) + EXCHANGE_IEXCHANGEIMPORTCONTENTSCHANGES2_METHODS(PURE)}; +#undef IMPL #define IMPL -DECLARE_MAPI_INTERFACE_PTR(IExchangeImportContentsChanges2, - LPEXCHANGEIMPORTCONTENTSCHANGES2); +DECLARE_MAPI_INTERFACE_PTR(IExchangeImportContentsChanges2, LPEXCHANGEIMPORTCONTENTSCHANGES2); /*------------------------------------------------------------------------ * @@ -1977,86 +1813,62 @@ DECLARE_MAPI_INTERFACE_PTR(IExchangeImportContentsChanges2, * *-----------------------------------------------------------------------*/ -#define EXCHANGE_IEXCHANGEIMPORTHIERARCHYCHANGES_METHODS(IPURE) \ - MAPIMETHOD(GetLastError) \ - (THIS_ HRESULT hResult, \ - ULONG ulFlags, \ - LPMAPIERROR FAR * lppMAPIError) IPURE; \ - MAPIMETHOD(Config) \ - (THIS_ LPSTREAM lpStream, \ - ULONG ulFlags) IPURE; \ - MAPIMETHOD(UpdateState) \ - (THIS_ LPSTREAM lpStream) IPURE; \ - MAPIMETHOD(ImportFolderChange) \ - (THIS_ ULONG cpvalChanges, \ - LPSPropValue ppvalChanges) IPURE; \ - MAPIMETHOD(ImportFolderDeletion) \ - (THIS_ ULONG ulFlags, \ - LPENTRYLIST lpSrcEntryList) IPURE; - -#undef INTERFACE -#define INTERFACE IExchangeImportHierarchyChanges -DECLARE_MAPI_INTERFACE_(IExchangeImportHierarchyChanges, IUnknown) -{ - MAPI_IUNKNOWN_METHODS(PURE) - EXCHANGE_IEXCHANGEIMPORTHIERARCHYCHANGES_METHODS(PURE) -}; -#undef IMPL +#define EXCHANGE_IEXCHANGEIMPORTHIERARCHYCHANGES_METHODS(IPURE) \ + MAPIMETHOD(GetLastError) \ + (THIS_ HRESULT hResult, ULONG ulFlags, LPMAPIERROR FAR * lppMAPIError) IPURE; \ + MAPIMETHOD(Config) \ + (THIS_ LPSTREAM lpStream, ULONG ulFlags) IPURE; \ + MAPIMETHOD(UpdateState) \ + (THIS_ LPSTREAM lpStream) IPURE; \ + MAPIMETHOD(ImportFolderChange) \ + (THIS_ ULONG cpvalChanges, LPSPropValue ppvalChanges) IPURE; \ + MAPIMETHOD(ImportFolderDeletion) \ + (THIS_ ULONG ulFlags, LPENTRYLIST lpSrcEntryList) IPURE; + +#undef INTERFACE +#define INTERFACE IExchangeImportHierarchyChanges +DECLARE_MAPI_INTERFACE_(IExchangeImportHierarchyChanges, + IUnknown){MAPI_IUNKNOWN_METHODS(PURE) EXCHANGE_IEXCHANGEIMPORTHIERARCHYCHANGES_METHODS(PURE)}; +#undef IMPL #define IMPL -DECLARE_MAPI_INTERFACE_PTR(IExchangeImportHierarchyChanges, - LPEXCHANGEIMPORTHIERARCHYCHANGES); - -#define ulHierChanged (0x01) - -#define EXCHANGE_IEXCHANGECHANGEADVISESINK_METHODS(IPURE) \ - MAPIMETHOD_(ULONG, OnNotify) \ - (THIS_ ULONG ulFlags, \ - LPENTRYLIST lpEntryList) IPURE; \ - -#undef INTERFACE -#define INTERFACE IExchangeChangeAdviseSink -DECLARE_MAPI_INTERFACE_(IExchangeChangeAdviseSink, IUnknown) -{ - BEGIN_INTERFACE - MAPI_IUNKNOWN_METHODS(PURE) - EXCHANGE_IEXCHANGECHANGEADVISESINK_METHODS(PURE) -}; -#undef IMPL +DECLARE_MAPI_INTERFACE_PTR(IExchangeImportHierarchyChanges, LPEXCHANGEIMPORTHIERARCHYCHANGES); + +#define ulHierChanged (0x01) + +#define EXCHANGE_IEXCHANGECHANGEADVISESINK_METHODS(IPURE) \ + MAPIMETHOD_(ULONG, OnNotify) \ + (THIS_ ULONG ulFlags, LPENTRYLIST lpEntryList) IPURE; + +#undef INTERFACE +#define INTERFACE IExchangeChangeAdviseSink +DECLARE_MAPI_INTERFACE_(IExchangeChangeAdviseSink, IUnknown){BEGIN_INTERFACE MAPI_IUNKNOWN_METHODS(PURE) + EXCHANGE_IEXCHANGECHANGEADVISESINK_METHODS(PURE)}; +#undef IMPL #define IMPL -DECLARE_MAPI_INTERFACE_PTR(IExchangeChangeAdviseSink, - LPEXCHANGECHANGEADVISESINK); - -#define EXCHANGE_IEXCHANGECHANGEADVISOR_METHODS(IPURE) \ - MAPIMETHOD(GetLastError) \ - (THIS_ HRESULT hResult, \ - ULONG ulFlags, \ - LPMAPIERROR FAR * lppMAPIError) IPURE; \ - MAPIMETHOD(Config) \ - (THIS_ LPSTREAM lpStream, \ - LPGUID lpGUID, \ - LPEXCHANGECHANGEADVISESINK lpAdviseSink, \ - ULONG ulFlags) IPURE; \ - MAPIMETHOD(UpdateState) \ - (THIS_ LPSTREAM lpStream) IPURE; \ - MAPIMETHOD(AddKeys) \ - (THIS_ LPENTRYLIST lpEntryList) IPURE; \ - MAPIMETHOD(RemoveKeys) \ - (THIS_ LPENTRYLIST lpEntryList) IPURE; - -#undef INTERFACE -#define INTERFACE IExchangeChangeAdvisor -DECLARE_MAPI_INTERFACE_(IExchangeChangeAdvisor, IUnknown) -{ - MAPI_IUNKNOWN_METHODS(PURE) - EXCHANGE_IEXCHANGECHANGEADVISOR_METHODS(PURE) -}; -#undef IMPL +DECLARE_MAPI_INTERFACE_PTR(IExchangeChangeAdviseSink, LPEXCHANGECHANGEADVISESINK); + +#define EXCHANGE_IEXCHANGECHANGEADVISOR_METHODS(IPURE) \ + MAPIMETHOD(GetLastError) \ + (THIS_ HRESULT hResult, ULONG ulFlags, LPMAPIERROR FAR * lppMAPIError) IPURE; \ + MAPIMETHOD(Config) \ + (THIS_ LPSTREAM lpStream, LPGUID lpGUID, LPEXCHANGECHANGEADVISESINK lpAdviseSink, ULONG ulFlags) IPURE; \ + MAPIMETHOD(UpdateState) \ + (THIS_ LPSTREAM lpStream) IPURE; \ + MAPIMETHOD(AddKeys) \ + (THIS_ LPENTRYLIST lpEntryList) IPURE; \ + MAPIMETHOD(RemoveKeys) \ + (THIS_ LPENTRYLIST lpEntryList) IPURE; + +#undef INTERFACE +#define INTERFACE IExchangeChangeAdvisor +DECLARE_MAPI_INTERFACE_(IExchangeChangeAdvisor, + IUnknown){MAPI_IUNKNOWN_METHODS(PURE) EXCHANGE_IEXCHANGECHANGEADVISOR_METHODS(PURE)}; +#undef IMPL #define IMPL -DECLARE_MAPI_INTERFACE_PTR(IExchangeChangeAdvisor, - LPEXCHANGECHANGEADVISOR); +DECLARE_MAPI_INTERFACE_PTR(IExchangeChangeAdvisor, LPEXCHANGECHANGEADVISOR); /*-------------------------------------------------------------------- * @@ -2066,27 +1878,19 @@ DECLARE_MAPI_INTERFACE_PTR(IExchangeChangeAdvisor, * *--------------------------------------------------------------------*/ -#define EXCHANGE_IEXCHANGEBADITEMCALLBACK_METHODS(IPURE) \ - MAPIMETHOD(BadItem) \ - (THIS_ HRESULT hResult, \ - ULONG ulFlags, \ - LPWSTR lpwszFolderName, \ - LPSBinary lpsbFolderEid, \ - ULONG cValues, \ - LPSPropValue lpPropArray) IPURE; - -#undef INTERFACE -#define INTERFACE IExchangeBadItemCallback -DECLARE_MAPI_INTERFACE_(IExchangeBadItemCallback, IUnknown) -{ - MAPI_IUNKNOWN_METHODS(PURE) - EXCHANGE_IEXCHANGEBADITEMCALLBACK_METHODS(PURE) -}; -#undef IMPL +#define EXCHANGE_IEXCHANGEBADITEMCALLBACK_METHODS(IPURE) \ + MAPIMETHOD(BadItem) \ + (THIS_ HRESULT hResult, ULONG ulFlags, LPWSTR lpwszFolderName, LPSBinary lpsbFolderEid, ULONG cValues, \ + LPSPropValue lpPropArray) IPURE; + +#undef INTERFACE +#define INTERFACE IExchangeBadItemCallback +DECLARE_MAPI_INTERFACE_(IExchangeBadItemCallback, + IUnknown){MAPI_IUNKNOWN_METHODS(PURE) EXCHANGE_IEXCHANGEBADITEMCALLBACK_METHODS(PURE)}; +#undef IMPL #define IMPL -DECLARE_MAPI_INTERFACE_PTR(IExchangeBadItemCallback, - LPEXCHANGEBADITEMCALLBACK); +DECLARE_MAPI_INTERFACE_PTR(IExchangeBadItemCallback, LPEXCHANGEBADITEMCALLBACK); /*-------------------------------------------------------------------- * @@ -2096,35 +1900,27 @@ DECLARE_MAPI_INTERFACE_PTR(IExchangeBadItemCallback, * *--------------------------------------------------------------------*/ -#define EXCHANGE_IEXCHANGEMOVEUSERPROGRESS_METHODS(IPURE) \ - MAPIMETHOD(NextFolder) \ - (THIS_ ULONG ulFlags, \ - LPWSTR lpwszFolderName) IPURE; \ - MAPIMETHOD(Progress) \ - (THIS_ ULONG ulFlags, \ - ULONG ulCount, \ - ULONG ulTotal) IPURE; \ - MAPIMETHOD(Restart) \ - (THIS_ ULONG ulFlags) IPURE; \ - -#undef INTERFACE -#define INTERFACE IExchangeMoveUserProgress -DECLARE_MAPI_INTERFACE_(IExchangeMoveUserProgress, IUnknown) -{ - MAPI_IUNKNOWN_METHODS(PURE) - EXCHANGE_IEXCHANGEMOVEUSERPROGRESS_METHODS(PURE) -}; -#undef IMPL +#define EXCHANGE_IEXCHANGEMOVEUSERPROGRESS_METHODS(IPURE) \ + MAPIMETHOD(NextFolder) \ + (THIS_ ULONG ulFlags, LPWSTR lpwszFolderName) IPURE; \ + MAPIMETHOD(Progress) \ + (THIS_ ULONG ulFlags, ULONG ulCount, ULONG ulTotal) IPURE; \ + MAPIMETHOD(Restart) \ + (THIS_ ULONG ulFlags) IPURE; + +#undef INTERFACE +#define INTERFACE IExchangeMoveUserProgress +DECLARE_MAPI_INTERFACE_(IExchangeMoveUserProgress, + IUnknown){MAPI_IUNKNOWN_METHODS(PURE) EXCHANGE_IEXCHANGEMOVEUSERPROGRESS_METHODS(PURE)}; +#undef IMPL #define IMPL -DECLARE_MAPI_INTERFACE_PTR(IExchangeMoveUserProgress, - LPEXCHANGEMOVEUSERPROGRESS); +DECLARE_MAPI_INTERFACE_PTR(IExchangeMoveUserProgress, LPEXCHANGEMOVEUSERPROGRESS); // Internal flag for IMsgStore::CopyTo which tells the move user processing // that there are potential extended callback objects hanhing off of the // IMAPIProgress object. -#define MAPI_EXTENDEDCALLBACKS ((ULONG) 0x00000400) - +#define MAPI_EXTENDEDCALLBACKS ((ULONG)0x00000400) /*------------------------------------------------------------------------ * @@ -2132,21 +1928,21 @@ DECLARE_MAPI_INTERFACE_PTR(IExchangeMoveUserProgress, * *-----------------------------------------------------------------------*/ -#define MAKE_SYNC_E(err) (MAKE_SCODE(SEVERITY_ERROR, FACILITY_ITF, err)) -#define MAKE_SYNC_W(warn) (MAKE_SCODE(SEVERITY_SUCCESS, FACILITY_ITF, warn)) +#define MAKE_SYNC_E(err) (MAKE_SCODE(SEVERITY_ERROR, FACILITY_ITF, err)) +#define MAKE_SYNC_W(warn) (MAKE_SCODE(SEVERITY_SUCCESS, FACILITY_ITF, warn)) -#define SYNC_E_UNKNOWN_FLAGS MAPI_E_UNKNOWN_FLAGS -#define SYNC_E_INVALID_PARAMETER E_INVALIDARG -#define SYNC_E_ERROR E_FAIL -#define SYNC_E_OBJECT_DELETED MAKE_SYNC_E(0x800) -#define SYNC_E_IGNORE MAKE_SYNC_E(0x801) -#define SYNC_E_CONFLICT MAKE_SYNC_E(0x802) -#define SYNC_E_NO_PARENT MAKE_SYNC_E(0x803) -#define SYNC_E_CYCLE MAKE_SYNC_E(0x804) -#define SYNC_E_UNSYNCHRONIZED MAKE_SYNC_E(0x805) +#define SYNC_E_UNKNOWN_FLAGS MAPI_E_UNKNOWN_FLAGS +#define SYNC_E_INVALID_PARAMETER E_INVALIDARG +#define SYNC_E_ERROR E_FAIL +#define SYNC_E_OBJECT_DELETED MAKE_SYNC_E(0x800) +#define SYNC_E_IGNORE MAKE_SYNC_E(0x801) +#define SYNC_E_CONFLICT MAKE_SYNC_E(0x802) +#define SYNC_E_NO_PARENT MAKE_SYNC_E(0x803) +#define SYNC_E_CYCLE MAKE_SYNC_E(0x804) +#define SYNC_E_UNSYNCHRONIZED MAKE_SYNC_E(0x805) -#define SYNC_W_PROGRESS MAKE_SYNC_W(0x820) -#define SYNC_W_CLIENT_CHANGE_NEWER MAKE_SYNC_W(0x821) +#define SYNC_W_PROGRESS MAKE_SYNC_W(0x820) +#define SYNC_W_CLIENT_CHANGE_NEWER MAKE_SYNC_W(0x821) /*------------------------------------------------------------------------ * @@ -2154,25 +1950,25 @@ DECLARE_MAPI_INTERFACE_PTR(IExchangeMoveUserProgress, * *-----------------------------------------------------------------------*/ -#define SYNC_UNICODE 0x01 -#define SYNC_NO_DELETIONS 0x02 -#define SYNC_NO_SOFT_DELETIONS 0x04 -#define SYNC_READ_STATE 0x08 -#define SYNC_ASSOCIATED 0x10 -#define SYNC_NORMAL 0x20 -#define SYNC_NO_CONFLICTS 0x40 -#define SYNC_ONLY_SPECIFIED_PROPS 0x80 -#define SYNC_NO_FOREIGN_KEYS 0x100 -#define SYNC_LIMITED_IMESSAGE 0x200 -#define SYNC_CATCHUP 0x400 -#define SYNC_NEW_MESSAGE 0x800 // only applicable to ImportMessageChange() -#define SYNC_MSG_SELECTIVE 0x1000 // Used internally. Will reject if used by clients. -#define SYNC_BEST_BODY 0x2000 +#define SYNC_UNICODE 0x01 +#define SYNC_NO_DELETIONS 0x02 +#define SYNC_NO_SOFT_DELETIONS 0x04 +#define SYNC_READ_STATE 0x08 +#define SYNC_ASSOCIATED 0x10 +#define SYNC_NORMAL 0x20 +#define SYNC_NO_CONFLICTS 0x40 +#define SYNC_ONLY_SPECIFIED_PROPS 0x80 +#define SYNC_NO_FOREIGN_KEYS 0x100 +#define SYNC_LIMITED_IMESSAGE 0x200 +#define SYNC_CATCHUP 0x400 +#define SYNC_NEW_MESSAGE 0x800 // only applicable to ImportMessageChange() +#define SYNC_MSG_SELECTIVE 0x1000 // Used internally. Will reject if used by clients. +#define SYNC_BEST_BODY 0x2000 #define SYNC_IGNORE_SPECIFIED_ON_ASSOCIATED 0x4000 -#define SYNC_PROGRESS_MODE 0x8000 // AirMapi progress mode -#define SYNC_FXRECOVERMODE 0x10000 -#define SYNC_DEFER_CONFIG 0x20000 -#define SYNC_FORCE_UNICODE 0x40000 // Forces server to return Unicode properties +#define SYNC_PROGRESS_MODE 0x8000 // AirMapi progress mode +#define SYNC_FXRECOVERMODE 0x10000 +#define SYNC_DEFER_CONFIG 0x20000 +#define SYNC_FORCE_UNICODE 0x40000 // Forces server to return Unicode properties /*------------------------------------------------------------------------ * @@ -2180,8 +1976,8 @@ DECLARE_MAPI_INTERFACE_PTR(IExchangeMoveUserProgress, * *-----------------------------------------------------------------------*/ -#define SYNC_SOFT_DELETE 0x01 -#define SYNC_EXPIRY 0x02 +#define SYNC_SOFT_DELETE 0x01 +#define SYNC_EXPIRY 0x02 /*------------------------------------------------------------------------ * @@ -2189,7 +1985,7 @@ DECLARE_MAPI_INTERFACE_PTR(IExchangeMoveUserProgress, * *-----------------------------------------------------------------------*/ -#define SYNC_READ 0x01 +#define SYNC_READ 0x01 /*------------------------------------------------------------------------ * @@ -2197,8 +1993,8 @@ DECLARE_MAPI_INTERFACE_PTR(IExchangeMoveUserProgress, * *-----------------------------------------------------------------------*/ -#define MESSAGE_BEST_BODY 0x10 -#define MESSAGE_SEND_ENTRYID 0x20 +#define MESSAGE_BEST_BODY 0x10 +#define MESSAGE_SEND_ENTRYID 0x20 /*------------------------------------------------------------------------ * @@ -2208,7 +2004,6 @@ DECLARE_MAPI_INTERFACE_PTR(IExchangeMoveUserProgress, #define SUPRESS_NOTIFICATIONS_ON_MY_ACTIONS 0x01000 - /*------------------------------------------------------------------------ * * "IExchangeFavorites" Interface Declaration @@ -2220,26 +2015,20 @@ DECLARE_MAPI_INTERFACE_PTR(IExchangeMoveUserProgress, * *-----------------------------------------------------------------------*/ -#define EXCHANGE_IEXCHANGEFAVORITES_METHODS(IPURE) \ - MAPIMETHOD(GetLastError) \ - (THIS_ HRESULT hResult, \ - ULONG ulFlags, \ - LPMAPIERROR FAR * lppMAPIError) IPURE; \ - MAPIMETHOD(AddFavorites) \ - (THIS_ LPENTRYLIST lpEntryList) IPURE; \ - MAPIMETHOD(DelFavorites) \ - (THIS_ LPENTRYLIST lpEntryList) IPURE; \ - -#undef INTERFACE -#define INTERFACE IExchangeFavorites -DECLARE_MAPI_INTERFACE_(IExchangeFavorites, IUnknown) -{ - MAPI_IUNKNOWN_METHODS(PURE) - EXCHANGE_IEXCHANGEFAVORITES_METHODS(PURE) -}; +#define EXCHANGE_IEXCHANGEFAVORITES_METHODS(IPURE) \ + MAPIMETHOD(GetLastError) \ + (THIS_ HRESULT hResult, ULONG ulFlags, LPMAPIERROR FAR * lppMAPIError) IPURE; \ + MAPIMETHOD(AddFavorites) \ + (THIS_ LPENTRYLIST lpEntryList) IPURE; \ + MAPIMETHOD(DelFavorites) \ + (THIS_ LPENTRYLIST lpEntryList) IPURE; -DECLARE_MAPI_INTERFACE_PTR(IExchangeFavorites, LPEXCHANGEFAVORITES); +#undef INTERFACE +#define INTERFACE IExchangeFavorites +DECLARE_MAPI_INTERFACE_(IExchangeFavorites, + IUnknown){MAPI_IUNKNOWN_METHODS(PURE) EXCHANGE_IEXCHANGEFAVORITES_METHODS(PURE)}; +DECLARE_MAPI_INTERFACE_PTR(IExchangeFavorites, LPEXCHANGEFAVORITES); /*------------------------------------------------------------------------ * @@ -2247,17 +2036,16 @@ DECLARE_MAPI_INTERFACE_PTR(IExchangeFavorites, LPEXCHANGEFAVORITES); * *-----------------------------------------------------------------------*/ -#define PR_AUTO_ADD_NEW_SUBS PROP_TAG(PT_BOOLEAN, pidExchangeNonXmitReservedMin+0x5) -#define PR_NEW_SUBS_GET_AUTO_ADD PROP_TAG(PT_BOOLEAN, pidExchangeNonXmitReservedMin+0x6) +#define PR_AUTO_ADD_NEW_SUBS PROP_TAG(PT_BOOLEAN, pidExchangeNonXmitReservedMin + 0x5) +#define PR_NEW_SUBS_GET_AUTO_ADD PROP_TAG(PT_BOOLEAN, pidExchangeNonXmitReservedMin + 0x6) /*------------------------------------------------------------------------ * * Properties used by the Offline Folders API * *-----------------------------------------------------------------------*/ -#define PR_OFFLINE_FLAGS PROP_TAG(PT_LONG, pidFolderMin+0x5) -#define PR_SYNCHRONIZE_FLAGS PROP_TAG(PT_LONG, pidExchangeNonXmitReservedMin+0x4) - +#define PR_OFFLINE_FLAGS PROP_TAG(PT_LONG, pidFolderMin + 0x5) +#define PR_SYNCHRONIZE_FLAGS PROP_TAG(PT_LONG, pidExchangeNonXmitReservedMin + 0x4) /*------------------------------------------------------------------------ * @@ -2265,10 +2053,10 @@ DECLARE_MAPI_INTERFACE_PTR(IExchangeFavorites, LPEXCHANGEFAVORITES); * *-----------------------------------------------------------------------*/ -#define OF_AVAILABLE_OFFLINE ((ULONG) 0x00000001) -#define OF_FORCE ((ULONG) 0x80000000) +#define OF_AVAILABLE_OFFLINE ((ULONG)0x00000001) +#define OF_FORCE ((ULONG)0x80000000) -#define SF_DISABLE_STARTUP_SYNC ((ULONG) 0x00000001) +#define SF_DISABLE_STARTUP_SYNC ((ULONG)0x00000001) /*------------------------------------------------------------------------ * @@ -2278,39 +2066,33 @@ DECLARE_MAPI_INTERFACE_PTR(IExchangeFavorites, LPEXCHANGEFAVORITES); * *-----------------------------------------------------------------------*/ -#define EXCHANGE_IEXCHANGEMESSAGECONVERSION_METHODS(IPURE) \ - MAPIMETHOD(OpenStream) \ - (THIS_ ULONG cValues, \ - LPSPropValue lpPropArray, \ - LPSTREAM FAR * lppStream) IPURE; -#undef INTERFACE -#define INTERFACE IExchangeMessageConversion -DECLARE_MAPI_INTERFACE_(IExchangeMessageConversion, IUnknown) -{ - MAPI_IUNKNOWN_METHODS(PURE) - EXCHANGE_IEXCHANGEMESSAGECONVERSION_METHODS(PURE) -}; -#undef IMPL +#define EXCHANGE_IEXCHANGEMESSAGECONVERSION_METHODS(IPURE) \ + MAPIMETHOD(OpenStream) \ + (THIS_ ULONG cValues, LPSPropValue lpPropArray, LPSTREAM FAR * lppStream) IPURE; +#undef INTERFACE +#define INTERFACE IExchangeMessageConversion +DECLARE_MAPI_INTERFACE_(IExchangeMessageConversion, + IUnknown){MAPI_IUNKNOWN_METHODS(PURE) EXCHANGE_IEXCHANGEMESSAGECONVERSION_METHODS(PURE)}; +#undef IMPL #define IMPL DECLARE_MAPI_INTERFACE_PTR(IExchangeMessageConversion, LPEXCHANGEMESSAGECONVERSION); -#define PR_MESSAGE_SITE_NAME PROP_TAG(PT_TSTRING, pidExchangeNonXmitReservedMin+0x7) -#define PR_MESSAGE_SITE_NAME_A PROP_TAG(PT_STRING8, pidExchangeNonXmitReservedMin+0x7) -#define PR_MESSAGE_SITE_NAME_W PROP_TAG(PT_UNICODE, pidExchangeNonXmitReservedMin+0x7) - -#define PR_MESSAGE_PROCESSED PROP_TAG(PT_BOOLEAN, pidExchangeNonXmitReservedMin+0x8) +#define PR_MESSAGE_SITE_NAME PROP_TAG(PT_TSTRING, pidExchangeNonXmitReservedMin + 0x7) +#define PR_MESSAGE_SITE_NAME_A PROP_TAG(PT_STRING8, pidExchangeNonXmitReservedMin + 0x7) +#define PR_MESSAGE_SITE_NAME_W PROP_TAG(PT_UNICODE, pidExchangeNonXmitReservedMin + 0x7) -#define PR_MSG_BODY_ID PROP_TAG(PT_LONG, pidExchangeXmitReservedMin-0x03) +#define PR_MESSAGE_PROCESSED PROP_TAG(PT_BOOLEAN, pidExchangeNonXmitReservedMin + 0x8) +#define PR_MSG_BODY_ID PROP_TAG(PT_LONG, pidExchangeXmitReservedMin - 0x03) -#define PR_BILATERAL_INFO PROP_TAG(PT_BINARY, pidExchangeXmitReservedMin-0x04) -#define PR_DL_REPORT_FLAGS PROP_TAG(PT_LONG, pidExchangeXmitReservedMin-0x05) +#define PR_BILATERAL_INFO PROP_TAG(PT_BINARY, pidExchangeXmitReservedMin - 0x04) +#define PR_DL_REPORT_FLAGS PROP_TAG(PT_LONG, pidExchangeXmitReservedMin - 0x05) -#define PRIV_DL_HIDE_MEMBERS 0x00000001 -#define PRIV_DL_REPORT_TO_ORIG 0x00000002 +#define PRIV_DL_HIDE_MEMBERS 0x00000001 +#define PRIV_DL_REPORT_TO_ORIG 0x00000002 #define PRIV_DL_REPORT_TO_OWNER 0x00000004 -#define PRIV_DL_ALLOW_OOF 0x00000008 +#define PRIV_DL_ALLOW_OOF 0x00000008 /*--------------------------------------------------------------------------------- * @@ -2320,95 +2102,92 @@ DECLARE_MAPI_INTERFACE_PTR(IExchangeMessageConversion, LPEXCHANGEMESSAGECONVERSI * if the message is not read, or NULL if it is read. * *---------------------------------------------------------------------------------*/ -#define PR_ABSTRACT PROP_TAG(PT_TSTRING, pidExchangeXmitReservedMin-0x06) -#define PR_ABSTRACT_A PROP_TAG(PT_STRING8, pidExchangeXmitReservedMin-0x06) -#define PR_ABSTRACT_W PROP_TAG(PT_UNICODE, pidExchangeXmitReservedMin-0x06) +#define PR_ABSTRACT PROP_TAG(PT_TSTRING, pidExchangeXmitReservedMin - 0x06) +#define PR_ABSTRACT_A PROP_TAG(PT_STRING8, pidExchangeXmitReservedMin - 0x06) +#define PR_ABSTRACT_W PROP_TAG(PT_UNICODE, pidExchangeXmitReservedMin - 0x06) -#define PR_PREVIEW PROP_TAG(PT_TSTRING, pidExchangeXmitReservedMin-0x07) -#define PR_PREVIEW_A PROP_TAG(PT_STRING8, pidExchangeXmitReservedMin-0x07) -#define PR_PREVIEW_W PROP_TAG(PT_UNICODE, pidExchangeXmitReservedMin-0x07) +#define PR_PREVIEW PROP_TAG(PT_TSTRING, pidExchangeXmitReservedMin - 0x07) +#define PR_PREVIEW_A PROP_TAG(PT_STRING8, pidExchangeXmitReservedMin - 0x07) +#define PR_PREVIEW_W PROP_TAG(PT_UNICODE, pidExchangeXmitReservedMin - 0x07) -#define PR_PREVIEW_UNREAD PROP_TAG(PT_TSTRING, pidExchangeXmitReservedMin-0x08) -#define PR_PREVIEW_UNREAD_A PROP_TAG(PT_STRING8, pidExchangeXmitReservedMin-0x08) -#define PR_PREVIEW_UNREAD_W PROP_TAG(PT_UNICODE, pidExchangeXmitReservedMin-0x08) +#define PR_PREVIEW_UNREAD PROP_TAG(PT_TSTRING, pidExchangeXmitReservedMin - 0x08) +#define PR_PREVIEW_UNREAD_A PROP_TAG(PT_STRING8, pidExchangeXmitReservedMin - 0x08) +#define PR_PREVIEW_UNREAD_W PROP_TAG(PT_UNICODE, pidExchangeXmitReservedMin - 0x08) // // Informs IMAIL that full fidelity should be discarded for this message. // -#define PR_DISABLE_FULL_FIDELITY PROP_TAG(PT_BOOLEAN, pidRenMsgFldMin+0x72) +#define PR_DISABLE_FULL_FIDELITY PROP_TAG(PT_BOOLEAN, pidRenMsgFldMin + 0x72) // file attributes for messages / folders // need to be in REN property range in order to replicate -#define PR_ATTR_HIDDEN PROP_TAG(PT_BOOLEAN, pidRenMsgFldMin+0x74) -#define PR_ATTR_SYSTEM PROP_TAG(PT_BOOLEAN, pidRenMsgFldMin+0x75) -#define PR_ATTR_READONLY PROP_TAG(PT_BOOLEAN, pidRenMsgFldMin+0x76) +#define PR_ATTR_HIDDEN PROP_TAG(PT_BOOLEAN, pidRenMsgFldMin + 0x74) +#define PR_ATTR_SYSTEM PROP_TAG(PT_BOOLEAN, pidRenMsgFldMin + 0x75) +#define PR_ATTR_READONLY PROP_TAG(PT_BOOLEAN, pidRenMsgFldMin + 0x76) // Flag indicating whether msg has been read or not (read-only prop for now - not replicated). -#define PR_READ PROP_TAG(PT_BOOLEAN, pidStoreNonTransMin+0x29) +#define PR_READ PROP_TAG(PT_BOOLEAN, pidStoreNonTransMin + 0x29) // Administrative security descriptor for a folder, if present. // -#define PR_ADMIN_SECURITY_DESCRIPTOR PROP_TAG(PT_BINARY, 0x3d21) +#define PR_ADMIN_SECURITY_DESCRIPTOR PROP_TAG(PT_BINARY, 0x3d21) // // Win32 compatible representation of folder/message security descriptor // -#define PR_WIN32_SECURITY_DESCRIPTOR PROP_TAG(PT_BINARY, 0x3d22) +#define PR_WIN32_SECURITY_DESCRIPTOR PROP_TAG(PT_BINARY, 0x3d22) // // TRUE if PR_NT_SECURITY_DESCRIPTOR describes non Win32 ACL semantics. // If this is set, components that use PR_WIN32_SECURITY_DESCRIPTOR cannot // allow modification of PR_NT_SECURITY_DESCRIPTOR (or PR_DEFAULT_MESSAGE_SD). // -#define PR_NON_WIN32_ACL PROP_TAG(PT_BOOLEAN, 0x3d23) +#define PR_NON_WIN32_ACL PROP_TAG(PT_BOOLEAN, 0x3d23) // // TRUE if any items in the folder contain item level ACLs // -#define PR_ITEM_LEVEL_ACL PROP_TAG(PT_BOOLEAN, 0x3d24) +#define PR_ITEM_LEVEL_ACL PROP_TAG(PT_BOOLEAN, 0x3d24) -#define PR_DAV_TRANSFER_SECURITY_DESCRIPTOR PROP_TAG(PT_BINARY, 0x0E84) +#define PR_DAV_TRANSFER_SECURITY_DESCRIPTOR PROP_TAG(PT_BINARY, 0x0E84) // // XML formatted versions of the NT SECURITY DESCRIPTOR properties -#define PR_NT_SECURITY_DESCRIPTOR_AS_XML PROP_TAG(PT_TSTRING, pidStoreNonTransMin+0x2A) -#define PR_NT_SECURITY_DESCRIPTOR_AS_XML_A PROP_TAG(PT_STRING8, pidStoreNonTransMin+0x2A) -#define PR_NT_SECURITY_DESCRIPTOR_AS_XML_W PROP_TAG(PT_UNICODE, pidStoreNonTransMin+0x2A) -#define PR_ADMIN_SECURITY_DESCRIPTOR_AS_XML PROP_TAG(PT_TSTRING, pidStoreNonTransMin+0x2B) -#define PR_ADMIN_SECURITY_DESCRIPTOR_AS_XML_A PROP_TAG(PT_STRING8, pidStoreNonTransMin+0x2B) -#define PR_ADMIN_SECURITY_DESCRIPTOR_AS_XML_W PROP_TAG(PT_UNICODE, pidStoreNonTransMin+0x2B) - +#define PR_NT_SECURITY_DESCRIPTOR_AS_XML PROP_TAG(PT_TSTRING, pidStoreNonTransMin + 0x2A) +#define PR_NT_SECURITY_DESCRIPTOR_AS_XML_A PROP_TAG(PT_STRING8, pidStoreNonTransMin + 0x2A) +#define PR_NT_SECURITY_DESCRIPTOR_AS_XML_W PROP_TAG(PT_UNICODE, pidStoreNonTransMin + 0x2A) +#define PR_ADMIN_SECURITY_DESCRIPTOR_AS_XML PROP_TAG(PT_TSTRING, pidStoreNonTransMin + 0x2B) +#define PR_ADMIN_SECURITY_DESCRIPTOR_AS_XML_A PROP_TAG(PT_STRING8, pidStoreNonTransMin + 0x2B) +#define PR_ADMIN_SECURITY_DESCRIPTOR_AS_XML_W PROP_TAG(PT_UNICODE, pidStoreNonTransMin + 0x2B) /*------------------------------------------------------------------------------------ -* -* OWA Info Property -* -*------------------------------------------------------------------------------------*/ -#define PR_OWA_URL PROP_TAG (PT_STRING8, pidRenMsgFldMin+0x71) - + * + * OWA Info Property + * + *------------------------------------------------------------------------------------*/ +#define PR_OWA_URL PROP_TAG(PT_STRING8, pidRenMsgFldMin + 0x71) //$ The value of this property ID will change in the future. Do not rely on //$ its current value. Rely on the define only. -#define PR_STORE_SLOWLINK PROP_TAG(PT_BOOLEAN, 0x7c0a) - +#define PR_STORE_SLOWLINK PROP_TAG(PT_BOOLEAN, 0x7c0a) /* * Registry locations of settings */ #if defined(WIN32) && !defined(MAC) -#define SZ_HPC_V2 "Software\\Microsoft\\Windows CE Services" -#define SZ_HPC_V2_MAJOR "MajorVersion" // = 2 -#define SZ_HPC_V2_MINOR "MinorVersion" // = 0 or 1 +#define SZ_HPC_V2 "Software\\Microsoft\\Windows CE Services" +#define SZ_HPC_V2_MAJOR "MajorVersion" // = 2 +#define SZ_HPC_V2_MINOR "MinorVersion" // = 0 or 1 -#define SZ_HPC_V1 "Software\\Microsoft\\Pegasus" -#define SZ_HPC_V1_MAJOR "MajorVersion" // = 1 Major and Minor numbers didn't appear -#define SZ_HPC_V1_MINOR "MinorVersion" // = 1 until after v1.0 was released -#define SZ_HPC_V1_0 "InstalledDir" // present for v1.0 +#define SZ_HPC_V1 "Software\\Microsoft\\Pegasus" +#define SZ_HPC_V1_MAJOR "MajorVersion" // = 1 Major and Minor numbers didn't appear +#define SZ_HPC_V1_MINOR "MinorVersion" // = 1 until after v1.0 was released +#define SZ_HPC_V1_0 "InstalledDir" // present for v1.0 #define SZ_OUTL_OST_OPTIONS "Software\\Microsoft\\Office\\8.0\\Outlook\\OST" #define SZ_NO_OST "NoOST" -#define NO_OST_FLAG_ALLOWED 0 // OST's are allowed on the machine -#define NO_OST_FLAG_CACHE_ONLY 1 // OST can only be used as a cache -#define NO_OST_FLAG_NOT_ALLOWED 2 // OST's are not allowed on the machine -#define NO_OST_FLAG_NO_CACHE 3 // OST's are not allowed as a cache -#define NO_OST_DEFAULT NO_OST_FLAG_ALLOWED +#define NO_OST_FLAG_ALLOWED 0 // OST's are allowed on the machine +#define NO_OST_FLAG_CACHE_ONLY 1 // OST can only be used as a cache +#define NO_OST_FLAG_NOT_ALLOWED 2 // OST's are not allowed on the machine +#define NO_OST_FLAG_NO_CACHE 3 // OST's are not allowed as a cache +#define NO_OST_DEFAULT NO_OST_FLAG_ALLOWED #endif /* @@ -2418,7 +2197,7 @@ DECLARE_MAPI_INTERFACE_PTR(IExchangeMessageConversion, LPEXCHANGEMESSAGECONVERSI * sync events for that folder by specifying the corresponding GUID in * the NEWLOGON object. */ -#define PR_SYNCEVENT_SUPPRESS_GUID PROP_TAG( PT_BINARY, 0x3880 ) +#define PR_SYNCEVENT_SUPPRESS_GUID PROP_TAG(PT_BINARY, 0x3880) /* * The following are the well-known GUIDS for the different special folders. @@ -2427,7 +2206,7 @@ DECLARE_MAPI_INTERFACE_PTR(IExchangeMessageConversion, LPEXCHANGEMESSAGECONVERSI * each folder. */ // {B2DC5B57-AF2D-4915-BAE3-90E5BDFB0070} -//static const GUID guidOutboxSyncEvents = +// static const GUID guidOutboxSyncEvents = //{ // 0xb2dc5b57, 0xaf2d, 0x4915, // { @@ -2436,7 +2215,7 @@ DECLARE_MAPI_INTERFACE_PTR(IExchangeMessageConversion, LPEXCHANGEMESSAGECONVERSI //}; // // {2185EE91-28CD-4d9b-BFB4-BC49BB1DD8C0} -//static const GUID guidMTSInSyncEvents = +// static const GUID guidMTSInSyncEvents = //{ // 0x2185ee91, 0x28cd, 0x4d9b, // { @@ -2445,7 +2224,7 @@ DECLARE_MAPI_INTERFACE_PTR(IExchangeMessageConversion, LPEXCHANGEMESSAGECONVERSI //}; // // {1BDBAFD3-1384-449b-A200-DE4745B07839} -//static const GUID guidMTSOutSyncEvents = +// static const GUID guidMTSOutSyncEvents = //{ // 0x1bdbafd3, 0x1384, 0x449b, // { @@ -2454,7 +2233,7 @@ DECLARE_MAPI_INTERFACE_PTR(IExchangeMessageConversion, LPEXCHANGEMESSAGECONVERSI //}; // // {221ED74D-0B5C-4c0e-8807-23AFDD8AC2FF} -//static const GUID guidTransportTempFolderSyncEvents = +// static const GUID guidTransportTempFolderSyncEvents = //{ // 0x221ed74d, 0xb5c, 0x4c0e, // { @@ -2462,63 +2241,62 @@ DECLARE_MAPI_INTERFACE_PTR(IExchangeMessageConversion, LPEXCHANGEMESSAGECONVERSI // } //}; - /* * Lock properties */ - //REVIEW:: some of these definitions appear both in MAPITAGS.H and EDKMDB.H - //one set of definitions should be removed -#define PR_LOCK_BRANCH_ID PROP_TAG( PT_I8, 0x3800 ) -#define PR_LOCK_RESOURCE_FID PROP_TAG( PT_I8, 0x3801 ) -#define PR_LOCK_RESOURCE_DID PROP_TAG( PT_I8, 0x3802 ) -#define PR_LOCK_RESOURCE_VID PROP_TAG( PT_I8, 0x3803 ) -#define PR_LOCK_ENLISTMENT_CONTEXT PROP_TAG( PT_BINARY, 0x3804 ) -#define PR_LOCK_TYPE PROP_TAG( PT_SHORT, 0x3805 ) -#define PR_LOCK_SCOPE PROP_TAG( PT_SHORT, 0x3806 ) -#define PR_LOCK_TRANSIENT_ID PROP_TAG( PT_BINARY, 0x3807 ) -#define PR_LOCK_DEPTH PROP_TAG( PT_LONG, 0x3808 ) -#define PR_LOCK_TIMEOUT PROP_TAG( PT_LONG, 0x3809 ) -#define PR_LOCK_EXPIRY_TIME PROP_TAG( PT_SYSTIME, 0x380a ) -#define PR_LOCK_GLID PROP_TAG( PT_BINARY, 0x380b ) -#define PR_LOCK_NULL_URL_W PROP_TAG( PT_UNICODE, 0x380c ) +// REVIEW:: some of these definitions appear both in MAPITAGS.H and EDKMDB.H +// one set of definitions should be removed +#define PR_LOCK_BRANCH_ID PROP_TAG(PT_I8, 0x3800) +#define PR_LOCK_RESOURCE_FID PROP_TAG(PT_I8, 0x3801) +#define PR_LOCK_RESOURCE_DID PROP_TAG(PT_I8, 0x3802) +#define PR_LOCK_RESOURCE_VID PROP_TAG(PT_I8, 0x3803) +#define PR_LOCK_ENLISTMENT_CONTEXT PROP_TAG(PT_BINARY, 0x3804) +#define PR_LOCK_TYPE PROP_TAG(PT_SHORT, 0x3805) +#define PR_LOCK_SCOPE PROP_TAG(PT_SHORT, 0x3806) +#define PR_LOCK_TRANSIENT_ID PROP_TAG(PT_BINARY, 0x3807) +#define PR_LOCK_DEPTH PROP_TAG(PT_LONG, 0x3808) +#define PR_LOCK_TIMEOUT PROP_TAG(PT_LONG, 0x3809) +#define PR_LOCK_EXPIRY_TIME PROP_TAG(PT_SYSTIME, 0x380a) +#define PR_LOCK_GLID PROP_TAG(PT_BINARY, 0x380b) +#define PR_LOCK_NULL_URL_W PROP_TAG(PT_UNICODE, 0x380c) /* * Lock flags */ -#define LOCK_NON_PERSISTENT 0x00000001 -#define LOCK_BLOCKING_MID_LOCK 0x00000002 -#define LOCK_NULL_RESOURCE 0x00000004 -#define LOCK_READ_ACCESS_CHECK_ONLY 0x00000008 -#define LOCK_WRITE_THROUGH_GOP 0x00010000 +#define LOCK_NON_PERSISTENT 0x00000001 +#define LOCK_BLOCKING_MID_LOCK 0x00000002 +#define LOCK_NULL_RESOURCE 0x00000004 +#define LOCK_READ_ACCESS_CHECK_ONLY 0x00000008 +#define LOCK_WRITE_THROUGH_GOP 0x00010000 // This bit is reserved and must not be set! -#define LOCK_RESERVED 0x80000000 +#define LOCK_RESERVED 0x80000000 /* * Unlock flags */ -#define UNLOCK_CHECKIN_ABORT 0x00000001 -#define UNLOCK_CHECKIN_KEEP_LOCKED 0x00000002 -#define UNLOCK_BLOCKING_MID_LOCK_ALL 0x00000004 -#define UNLOCK_BLOCKING_MID_LOCK_LOGON_ONLY 0x00000008 -#define UNLOCK_NULL_RESOURCE 0x00000010 -#define UNLOCK_WRITE_THROUGH_GOP 0x00010000 +#define UNLOCK_CHECKIN_ABORT 0x00000001 +#define UNLOCK_CHECKIN_KEEP_LOCKED 0x00000002 +#define UNLOCK_BLOCKING_MID_LOCK_ALL 0x00000004 +#define UNLOCK_BLOCKING_MID_LOCK_LOGON_ONLY 0x00000008 +#define UNLOCK_NULL_RESOURCE 0x00000010 +#define UNLOCK_WRITE_THROUGH_GOP 0x00010000 /* * Versioning flags for folder */ -#define wNonVersionedFolder ((WORD)0x0000) -#define wVersionedFolderSimple ((WORD)0x0001) -#define wVersionedFolderAuto ((WORD)0x0002) //When you auto version it is simple versioned as well. +#define wNonVersionedFolder ((WORD)0x0000) +#define wVersionedFolderSimple ((WORD)0x0001) +#define wVersionedFolderAuto ((WORD)0x0002) // When you auto version it is simple versioned as well. /* * Versioning operation codes for version rows in ptagVersionedOperation */ -#define fVersionedDelete ((ULONG)0x01) -#define fVersionedUnDelete ((ULONG)0x02) -#define fVersionedPin ((ULONG)0x04) -#define fVersionedUnPin ((ULONG)0x08) -#define fVersionedMoveIn ((ULONG)0x10) -#define fVersionedMoveOut ((ULONG)0x20) +#define fVersionedDelete ((ULONG)0x01) +#define fVersionedUnDelete ((ULONG)0x02) +#define fVersionedPin ((ULONG)0x04) +#define fVersionedUnPin ((ULONG)0x08) +#define fVersionedMoveIn ((ULONG)0x10) +#define fVersionedMoveOut ((ULONG)0x20) /*------------------------------------------------------------------------ * @@ -2527,28 +2305,28 @@ DECLARE_MAPI_INTERFACE_PTR(IExchangeMessageConversion, LPEXCHANGEMESSAGECONVERSI * These are properties that will be used internally by local store. * Properties that are listed here are used in components other than the local store *-----------------------------------------------------------------------*/ -#define pidLISMsgFolderPropMin pidLocalStoreInternalMin+0xa0 // 0x65a0 -#define pidLISMsgFolderPropMax pidLocalStoreInternalMin+0xc0 // 0x65c0 +#define pidLISMsgFolderPropMin pidLocalStoreInternalMin + 0xa0 // 0x65a0 +#define pidLISMsgFolderPropMax pidLocalStoreInternalMin + 0xc0 // 0x65c0 -#define pidLISErrorCodeMin pidLISMsgFolderPropMin+0xa // 0x65aa -#define pidLISErrorCodeMax pidLISMsgFolderPropMin+0x10 // 0x65b0 +#define pidLISErrorCodeMin pidLISMsgFolderPropMin + 0xa // 0x65aa +#define pidLISErrorCodeMax pidLISMsgFolderPropMin + 0x10 // 0x65b0 -#define pidLISInterfacePropMin pidLocalStoreInternalMin+0xd0 // 0x65d0 -#define pidLISInterfacePropMax pidLocalStoreInternalMin+0xe0 // 0x65e0 +#define pidLISInterfacePropMin pidLocalStoreInternalMin + 0xd0 // 0x65d0 +#define pidLISInterfacePropMax pidLocalStoreInternalMin + 0xe0 // 0x65e0 -#define ptagLISSubfolders PROP_TAG( PT_BOOLEAN, pidLocalStoreInternalMin+0x0) -#define ptagLISUnreadCount PROP_TAG( PT_LONG, pidLocalStoreInternalMin+0x1) +#define ptagLISSubfolders PROP_TAG(PT_BOOLEAN, pidLocalStoreInternalMin + 0x0) +#define ptagLISUnreadCount PROP_TAG(PT_LONG, pidLocalStoreInternalMin + 0x1) -#define ptagLISErrorCode PROP_TAG( PT_LONG, pidLISErrorCodeMin+0x0) // PROP_TAG(PT_LONG, 0x65aa) -#define ptagLISErrorItemType PROP_TAG( PT_LONG, pidLISErrorCodeMin+0x1) // PROP_TAG(PT_LONG, 0x65ab) -#define ptagLISErrorOperation PROP_TAG( PT_LONG, pidLISErrorCodeMin+0x2) // PROP_TAG(PT_LONG, 0x65ac) -#define ptagLISErrorItemUrl PROP_TAG( PT_UNICODE, pidLISErrorCodeMin+0x3) // PROP_TAG(PT_UNICODE, 0x65ad) -#define ptagLISErrorSourceUrl PROP_TAG( PT_UNICODE, pidLISErrorCodeMin+0x4) // PROP_TAG(PT_UNICODE, 0x65ae) -#define ptagLISModifiedPropertyList PROP_TAG( PT_UNICODE, pidLISErrorCodeMin+0x5) // PROP_TAG(PT_UNICODE, 0x65af) -#define ptagLISExtendedErrorinfo PROP_TAG( PT_LONG, pidLISErrorCodeMin+0x6) // PROP_TAG(PT_LONG, 0x65b0) +#define ptagLISErrorCode PROP_TAG(PT_LONG, pidLISErrorCodeMin + 0x0) // PROP_TAG(PT_LONG, 0x65aa) +#define ptagLISErrorItemType PROP_TAG(PT_LONG, pidLISErrorCodeMin + 0x1) // PROP_TAG(PT_LONG, 0x65ab) +#define ptagLISErrorOperation PROP_TAG(PT_LONG, pidLISErrorCodeMin + 0x2) // PROP_TAG(PT_LONG, 0x65ac) +#define ptagLISErrorItemUrl PROP_TAG(PT_UNICODE, pidLISErrorCodeMin + 0x3) // PROP_TAG(PT_UNICODE, 0x65ad) +#define ptagLISErrorSourceUrl PROP_TAG(PT_UNICODE, pidLISErrorCodeMin + 0x4) // PROP_TAG(PT_UNICODE, 0x65ae) +#define ptagLISModifiedPropertyList PROP_TAG(PT_UNICODE, pidLISErrorCodeMin + 0x5) // PROP_TAG(PT_UNICODE, 0x65af) +#define ptagLISExtendedErrorinfo PROP_TAG(PT_LONG, pidLISErrorCodeMin + 0x6) // PROP_TAG(PT_LONG, 0x65b0) // Not in msgfolder prop range -#define ptagLISErrorLogUrl PROP_TAG( PT_UNICODE, pidLocalStoreInternalMin+0x70) // PROP_TAG(PT_UNICODE, 0x6570) +#define ptagLISErrorLogUrl PROP_TAG(PT_UNICODE, pidLocalStoreInternalMin + 0x70) // PROP_TAG(PT_UNICODE, 0x6570) // Ptags used between EXOLEDB and LSCache on client machine to pass // along the actual client SQL query from EXOLEDB to LSCache in the RES_COMMENT @@ -2557,18 +2335,18 @@ DECLARE_MAPI_INTERFACE_PTR(IExchangeMessageConversion, LPEXCHANGEMESSAGECONVERSI // // ptagSql = The identifying property for the SQL restriction. // The value will be the original complete clause. -#define ptagSql PROP_TAG(PT_UNICODE, pidLISInterfacePropMin+0x0) -#define ptagSqlSelect PROP_TAG(PT_UNICODE, pidLISInterfacePropMin+0x1) -#define ptagSqlFrom PROP_TAG(PT_UNICODE, pidLISInterfacePropMin+0x2) -#define ptagSqlWhere PROP_TAG(PT_UNICODE, pidLISInterfacePropMin+0x3) -#define ptagSqlOrder PROP_TAG(PT_UNICODE, pidLISInterfacePropMin+0x4) -#define ptagSqlGroup PROP_TAG(PT_UNICODE, pidLISInterfacePropMin+0x5) +#define ptagSql PROP_TAG(PT_UNICODE, pidLISInterfacePropMin + 0x0) +#define ptagSqlSelect PROP_TAG(PT_UNICODE, pidLISInterfacePropMin + 0x1) +#define ptagSqlFrom PROP_TAG(PT_UNICODE, pidLISInterfacePropMin + 0x2) +#define ptagSqlWhere PROP_TAG(PT_UNICODE, pidLISInterfacePropMin + 0x3) +#define ptagSqlOrder PROP_TAG(PT_UNICODE, pidLISInterfacePropMin + 0x4) +#define ptagSqlGroup PROP_TAG(PT_UNICODE, pidLISInterfacePropMin + 0x5) -#define PR_RULE_SERVER_RULE_ID PROP_TAG(PT_I8, pidLISMsgFolderPropMin+0x0) // Corresponding server RUID for LIS +#define PR_RULE_SERVER_RULE_ID PROP_TAG(PT_I8, pidLISMsgFolderPropMin + 0x0) // Corresponding server RUID for LIS // this is a hackish property to be used by sync event code to say that changes // need client refresh. The only valid value is TRUE. See #168797 for more info -#define PR_FORCE_CLIENT_REFRESH PROP_TAG(PT_BOOLEAN, pidLISMsgFolderPropMin+0x1) +#define PR_FORCE_CLIENT_REFRESH PROP_TAG(PT_BOOLEAN, pidLISMsgFolderPropMin + 0x1) /*------------------------------------------------------------------------ * @@ -2578,46 +2356,45 @@ DECLARE_MAPI_INTERFACE_PTR(IExchangeMessageConversion, LPEXCHANGEMESSAGECONVERSI *-----------------------------------------------------------------------*/ // Name and version of anti-virus product that performed the last scan of an item. -#define PR_ANTIVIRUS_VENDOR PROP_TAG(PT_STRING8, pidStoreNonTransMin+0x45) // 0x0E85001E -#define PR_ANTIVIRUS_VERSION PROP_TAG(PT_LONG, pidStoreNonTransMin+0x46) // 0x0E860003 +#define PR_ANTIVIRUS_VENDOR PROP_TAG(PT_STRING8, pidStoreNonTransMin + 0x45) // 0x0E85001E +#define PR_ANTIVIRUS_VERSION PROP_TAG(PT_LONG, pidStoreNonTransMin + 0x46) // 0x0E860003 // Results ot the last scan of an item. -#define PR_ANTIVIRUS_SCAN_STATUS PROP_TAG(PT_LONG, pidStoreNonTransMin+0x47) // 0x0E870003 +#define PR_ANTIVIRUS_SCAN_STATUS PROP_TAG(PT_LONG, pidStoreNonTransMin + 0x47) // 0x0E870003 // List of virus identification strings of all viruses found by the last scan, if virus has been cleaned // or detected, separated by commans. Empty string if no virus has been found. -#define PR_ANTIVIRUS_SCAN_INFO PROP_TAG(PT_STRING8, pidStoreNonTransMin+0x48) // 0x0E88001F +#define PR_ANTIVIRUS_SCAN_INFO PROP_TAG(PT_STRING8, pidStoreNonTransMin + 0x48) // 0x0E88001F /* * Possible values of PR_ANTIVIRUS_SCAN_STATUS */ // Anti-virus product has completed scanning of an item, and found no virus. -#define ANTIVIRUS_SCAN_NO_VIRUS 0 +#define ANTIVIRUS_SCAN_NO_VIRUS 0 // Anti-virus product has detected a virus in an item, or assumed the item may contain a virus // based on item's properties, like filename or content type. -#define ANTIVIRUS_SCAN_VIRUS_PRESENT 1 +#define ANTIVIRUS_SCAN_VIRUS_PRESENT 1 // Anti-virus product has detected a virus in an item, and applied changes to remove the virus. // The item should be safe to use after modifications. -#define ANTIVIRUS_SCAN_VIRUS_CLEANED 2 +#define ANTIVIRUS_SCAN_VIRUS_CLEANED 2 // Anti-virus product has detected a virus in an item, and has requested that the message be // deleted. This item shouldn't be allowed to be opened. -#define ANTIVIRUS_SCAN_VIRUS_DELETED 3 +#define ANTIVIRUS_SCAN_VIRUS_DELETED 3 // Presents the same list as PR_DISPLAY_TO except uses the format "[addrtype1:addr1]; [addrtype2:addr2]" -#define PR_ADDR_TO PROP_TAG(PT_TSTRING, pidStoreNonTransMin+0x57) // 0x0E97 -#define PR_ADDR_TO_A PROP_TAG(PT_STRING8, pidStoreNonTransMin+0x57) -#define PR_ADDR_TO_W PROP_TAG(PT_UNICODE, pidStoreNonTransMin+0x57) +#define PR_ADDR_TO PROP_TAG(PT_TSTRING, pidStoreNonTransMin + 0x57) // 0x0E97 +#define PR_ADDR_TO_A PROP_TAG(PT_STRING8, pidStoreNonTransMin + 0x57) +#define PR_ADDR_TO_W PROP_TAG(PT_UNICODE, pidStoreNonTransMin + 0x57) // Presents the same list as PR_DISPLAY_CC except uses the format "[addrtype1:addr1]; [addrtype2:addr2]" -#define PR_ADDR_CC PROP_TAG(PT_TSTRING, pidStoreNonTransMin+0x58) // 0x0E98 -#define PR_ADDR_CC_A PROP_TAG(PT_STRING8, pidStoreNonTransMin+0x58) -#define PR_ADDR_CC_W PROP_TAG(PT_UNICODE, pidStoreNonTransMin+0x58) - +#define PR_ADDR_CC PROP_TAG(PT_TSTRING, pidStoreNonTransMin + 0x58) // 0x0E98 +#define PR_ADDR_CC_A PROP_TAG(PT_STRING8, pidStoreNonTransMin + 0x58) +#define PR_ADDR_CC_W PROP_TAG(PT_UNICODE, pidStoreNonTransMin + 0x58) // This property IS NO LONGER USED. I've left it here to avoid possible build break. -#define ptagLISNewMail PROP_TAG(PT_BOOLEAN, 0x65c5) +#define ptagLISNewMail PROP_TAG(PT_BOOLEAN, 0x65c5) -#endif //EDKMDB_INCLUDED +#endif // EDKMDB_INCLUDED diff --git a/com/win32comext/mapi/src/mapiutil.cpp b/com/win32comext/mapi/src/mapiutil.cpp index e09e03c1d..b704c77f6 100644 --- a/com/win32comext/mapi/src/mapiutil.cpp +++ b/com/win32comext/mapi/src/mapiutil.cpp @@ -512,7 +512,7 @@ PyObject *PyMAPIObject_FromSPropValue(SPropValue *pv) default: printf("File %s: Unsupported MAPI property type 0x%X", __FILE__, PROP_TYPE(pv->ulPropTag)); - /* Dont set exception, as this prevents otherwise valid props from + /* Don't set exception, as this prevents otherwise valid props from being returned */ val = Py_None; diff --git a/com/win32comext/shell/demos/explorer_browser.py b/com/win32comext/shell/demos/explorer_browser.py index fb6f9b2a3..7aec82d99 100644 --- a/com/win32comext/shell/demos/explorer_browser.py +++ b/com/win32comext/shell/demos/explorer_browser.py @@ -35,7 +35,7 @@ def OnViewCreated(self, view): # be that view! try: pyview = unwrap(view) - print("and look - its a Python implemented view!", pyview) + print("and look - it's a Python implemented view!", pyview) except ValueError: pass diff --git a/com/win32comext/shell/demos/servers/empty_volume_cache.py b/com/win32comext/shell/demos/servers/empty_volume_cache.py index 63a729e85..b5fb32e15 100644 --- a/com/win32comext/shell/demos/servers/empty_volume_cache.py +++ b/com/win32comext/shell/demos/servers/empty_volume_cache.py @@ -87,14 +87,14 @@ def _GetDirectories(self): ] def _WalkCallback(self, arg, directory, files): - # callback function for os.path.walk - no need to be member, but its + # callback function for os.path.walk - no need to be member, but it's # close to the callers :) callback, total_list = arg for file in files: fqn = os.path.join(directory, file).lower() if file.endswith(".pyc") or file.endswith(".pyo"): # See below - total_list is None means delete files, - # otherwise it is a list where the result is stored. Its a + # otherwise it is a list where the result is stored. It's a # list simply due to the way os.walk works - only [0] is # referenced if total_list is None: diff --git a/com/win32comext/shell/demos/servers/folder_view.py b/com/win32comext/shell/demos/servers/folder_view.py index f7e8436e1..163297d9b 100644 --- a/com/win32comext/shell/demos/servers/folder_view.py +++ b/com/win32comext/shell/demos/servers/folder_view.py @@ -58,7 +58,7 @@ def _make_ids(s): # These strings are what the user sees and would be localized. -# XXX - its possible that the shell might persist these values, so +# XXX - it's possible that the shell might persist these values, so # this scheme wouldn't really be suitable in a real ap. IDS_UNSPECIFIED = _make_ids("unspecified") IDS_SMALL = _make_ids("small") @@ -529,7 +529,7 @@ def QueryContextMenu(self, hMenu, indexMenu, idCmdFirst, idCmdLast, uFlags): def InvokeCommand(self, ci): mask, hwnd, verb, params, dir, nShow, hotkey, hicon = ci - # this seems very convuluted, but its what the sample does :) + # this seems very convuluted, but it's what the sample does :) for verb_name, verb_id, flag in folderViewImplContextMenuIDs: if isinstance(verb, int): matches = verb == verb_id @@ -642,7 +642,7 @@ def GetAttributesOf(self, pidls, attrFlags): # Retrieves an OLE interface that can be used to carry out # actions on the specified file objects or folders. def GetUIObjectOf(self, hwndOwner, pidls, iid, inout): - assert len(pidls) == 1, "oops - arent expecting more than one!" + assert len(pidls) == 1, "oops - aren't expecting more than one!" assert len(pidls[0]) == 1, "assuming relative pidls!" item = pidl_to_item(pidls[0]) if iid == shell.IID_IContextMenu: @@ -780,7 +780,7 @@ def MapColumnToSCID(self, iCol): # IPersistFolder2 methods # Retrieves the PIDLIST_ABSOLUTE for the folder object. def GetCurFolder(self): - # The docs say this is OK, but I suspect its a problem in this case :) + # The docs say this is OK, but I suspect it's a problem in this case :) # assert self.pidl, "haven't been initialized?" return self.pidl diff --git a/com/win32comext/shell/demos/servers/shell_view.py b/com/win32comext/shell/demos/servers/shell_view.py index 61d53a81d..abd56bd57 100644 --- a/com/win32comext/shell/demos/servers/shell_view.py +++ b/com/win32comext/shell/demos/servers/shell_view.py @@ -175,7 +175,7 @@ def CompareIDs(self, param, id1, id2): def GetUIObjectOf(self, hwndOwner, pidls, iid, inout): # delegate to the shell. - assert len(pidls) == 1, "oops - arent expecting more than one!" + assert len(pidls) == 1, "oops - aren't expecting more than one!" pidl = pidls[0] folder, child_pidl = self._GetFolderAndPIDLForPIDL(pidl) try: diff --git a/com/win32comext/shell/shellcon.py b/com/win32comext/shell/shellcon.py index 37841a971..90a5073eb 100644 --- a/com/win32comext/shell/shellcon.py +++ b/com/win32comext/shell/shellcon.py @@ -856,12 +856,12 @@ def EIRESID(x): ASSOCF_OPEN_BYEXENAME = 0x00000002 # executable is being passed in ASSOCF_INIT_DEFAULTTOSTAR = 0x00000004 # treat "*" as the BaseClass ASSOCF_INIT_DEFAULTTOFOLDER = 0x00000008 # treat "Folder" as the BaseClass -ASSOCF_NOUSERSETTINGS = 0x00000010 # dont use HKCU -ASSOCF_NOTRUNCATE = 0x00000020 # dont truncate the return string +ASSOCF_NOUSERSETTINGS = 0x00000010 # don't use HKCU +ASSOCF_NOTRUNCATE = 0x00000020 # don't truncate the return string ASSOCF_VERIFY = 0x00000040 # verify data is accurate (DISK HITS) ASSOCF_REMAPRUNDLL = 0x00000080 # actually gets info about rundlls target if applicable ASSOCF_NOFIXUPS = 0x00000100 # attempt to fix errors if found -ASSOCF_IGNOREBASECLASS = 0x00000200 # dont recurse into the baseclass +ASSOCF_IGNOREBASECLASS = 0x00000200 # don't recurse into the baseclass ASSOCSTR_COMMAND = 1 # shell\verb\command string ASSOCSTR_EXECUTABLE = 2 # the executable part of command string diff --git a/com/win32comext/shell/src/PyIQueryAssociations.h b/com/win32comext/shell/src/PyIQueryAssociations.h index 416b6273e..5eaba23ac 100644 --- a/com/win32comext/shell/src/PyIQueryAssociations.h +++ b/com/win32comext/shell/src/PyIQueryAssociations.h @@ -18,12 +18,12 @@ enum { ASSOCF_OPEN_BYEXENAME = 0x00000002, // executable is being passed in ASSOCF_INIT_DEFAULTTOSTAR = 0x00000004, // treat "*" as the BaseClass ASSOCF_INIT_DEFAULTTOFOLDER = 0x00000008, // treat "Folder" as the BaseClass - ASSOCF_NOUSERSETTINGS = 0x00000010, // dont use HKCU - ASSOCF_NOTRUNCATE = 0x00000020, // dont truncate the return string + ASSOCF_NOUSERSETTINGS = 0x00000010, // don't use HKCU + ASSOCF_NOTRUNCATE = 0x00000020, // don't truncate the return string ASSOCF_VERIFY = 0x00000040, // verify data is accurate (DISK HITS) ASSOCF_REMAPRUNDLL = 0x00000080, // actually gets info about rundlls target if applicable ASSOCF_NOFIXUPS = 0x00000100, // attempt to fix errors if found - ASSOCF_IGNOREBASECLASS = 0x00000200, // dont recurse into the baseclass + ASSOCF_IGNOREBASECLASS = 0x00000200, // don't recurse into the baseclass }; typedef DWORD ASSOCF; #define LWSTDAPI STDAPI diff --git a/com/win32comext/shell/src/shell.cpp b/com/win32comext/shell/src/shell.cpp index 2222ef00b..27d51f8d6 100644 --- a/com/win32comext/shell/src/shell.cpp +++ b/com/win32comext/shell/src/shell.cpp @@ -241,7 +241,7 @@ PyObject *PyObject_FromPIDL(LPCITEMIDLIST pidl, BOOL bFreeSystemPIDL) } // The length may be too large to read (and causing an // exception deep inside Python doesn't always leave - // things in a good state! Its also inconvenient to + // things in a good state! It's also inconvenient to // always pass the size of the object - so explicitly // check we can read the memory. UINT cbdata = pidl->mkid.cb - sizeof(pidl->mkid.cb); diff --git a/com/win32comext/taskscheduler/test/test_addtask_1.py b/com/win32comext/taskscheduler/test/test_addtask_1.py index 284e3511e..5f1356af1 100644 --- a/com/win32comext/taskscheduler/test/test_addtask_1.py +++ b/com/win32comext/taskscheduler/test/test_addtask_1.py @@ -36,7 +36,7 @@ new_task.SetApplicationName("py.exe") new_task.SetPriority(taskscheduler.REALTIME_PRIORITY_CLASS) new_task.SetParameters( - "-c\"import win32ui,time;win32ui.MessageBox('why aint you doing no work ?');\"" + "-c\"import win32ui,time;win32ui.MessageBox('why ain't you doing no work ?');\"" ) new_task.SetCreator("test_addtask_1.py") new_task.SetAccountInformation(win32api.GetUserName(), None) diff --git a/isapi/src/PyExtensionObjects.cpp b/isapi/src/PyExtensionObjects.cpp index d2d44a1f7..19208c19f 100644 --- a/isapi/src/PyExtensionObjects.cpp +++ b/isapi/src/PyExtensionObjects.cpp @@ -121,7 +121,7 @@ extern "C" void WINAPI DoIOCallback(EXTENSION_CONTROL_BLOCK *ecb, PVOID pContext Py_DECREF(result); worked = TRUE; done: - // If the callback failed, then its likely this request will end + // If the callback failed, then it's likely this request will end // up hanging. So on error we nuke ourselves from the map then // call DoneWithSession. We still hold the GIL, so we should be // safe from races... diff --git a/isapi/threaded_extension.py b/isapi/threaded_extension.py index ecf24c846..310bbb84b 100644 --- a/isapi/threaded_extension.py +++ b/isapi/threaded_extension.py @@ -176,7 +176,7 @@ def HandleDispatchError(self, ecb): ) except ExtensionError: # The client disconnected without reading the error body - - # its probably not a real browser at the other end, ignore it. + # it's probably not a real browser at the other end, ignore it. pass except: print("FAILED to render the error message!") diff --git a/setup.py b/setup.py index f8954603f..4723757c5 100644 --- a/setup.py +++ b/setup.py @@ -174,7 +174,7 @@ def finalize_options(self, build_ext): # like Python, always use debug info, even in release builds # (note the compiler doesn't include debug info, so you only get - # basic info - but its better than nothing!) + # basic info - but it's better than nothing!) # For now use the temp dir - later we may package them, so should # maybe move them next to the output file. pch_dir = os.path.join(build_ext.build_temp) diff --git a/win32/Demos/eventLogDemo.py b/win32/Demos/eventLogDemo.py index f3a48b958..8c9a17efb 100644 --- a/win32/Demos/eventLogDemo.py +++ b/win32/Demos/eventLogDemo.py @@ -21,7 +21,7 @@ def ReadLog(computer, logType="Application", dumpEachRecord=0): if not objects: break for object in objects: - # get it for testing purposes, but dont print it. + # get it for testing purposes, but don't print it. msg = win32evtlogutil.SafeFormatMessage(object, logType) if object.Sid is not None: try: @@ -64,8 +64,8 @@ def ReadLog(computer, logType="Application", dumpEachRecord=0): def usage(): print("Writes an event to the event log.") - print("-w : Dont write any test records.") - print("-r : Dont read the event log") + print("-w : Don't write any test records.") + print("-r : Don't read the event log") print("-c : computerName : Process the log on the specified computer") print("-v : Verbose") print("-t : LogType - Use the specified log - default = 'Application'") diff --git a/win32/Demos/service/pipeTestService.py b/win32/Demos/service/pipeTestService.py index 27aec9255..484cec987 100644 --- a/win32/Demos/service/pipeTestService.py +++ b/win32/Demos/service/pipeTestService.py @@ -85,7 +85,7 @@ def DoProcessClient(self, pipeHandle, tid): ok = 0 # A secure service would handle (and ignore!) errors writing to the - # pipe, but for the sake of this demo we dont (if only to see what errors + # pipe, but for the sake of this demo we don't (if only to see what errors # we can get when our clients break at strange times :-) if ok: msg = ( diff --git a/win32/Demos/win32clipboardDemo.py b/win32/Demos/win32clipboardDemo.py index 1c1c9f5d0..094c0c852 100644 --- a/win32/Demos/win32clipboardDemo.py +++ b/win32/Demos/win32clipboardDemo.py @@ -34,7 +34,7 @@ def TestText(): SetClipboardText(text) got = GetClipboardData(win32con.CF_TEXT) # CF_TEXT always gives us 'bytes' back . - assert got == text_bytes, f"Didnt get the correct result back - '{got!r}'." + assert got == text_bytes, f"Didn't get the correct result back - '{got!r}'." finally: CloseClipboard() @@ -42,12 +42,12 @@ def TestText(): try: # CF_UNICODE text always gives unicode objects back. got = GetClipboardData(win32con.CF_UNICODETEXT) - assert got == text, f"Didnt get the correct result back - '{got!r}'." - assert isinstance(got, str), f"Didnt get the correct result back - '{got!r}'." + assert got == text, f"Didn't get the correct result back - '{got!r}'." + assert isinstance(got, str), f"Didn't get the correct result back - '{got!r}'." # CF_OEMTEXT is a bytes-based format. got = GetClipboardData(win32con.CF_OEMTEXT) - assert got == text_bytes, f"Didnt get the correct result back - '{got!r}'." + assert got == text_bytes, f"Didn't get the correct result back - '{got!r}'." # Unicode tests EmptyClipboard() @@ -57,8 +57,8 @@ def TestText(): SetClipboardData(win32con.CF_UNICODETEXT, text) # Get it in Unicode. got = GetClipboardData(win32con.CF_UNICODETEXT) - assert got == text, f"Didnt get the correct result back - '{got!r}'." - assert isinstance(got, str), f"Didnt get the correct result back - '{got!r}'." + assert got == text, f"Didn't get the correct result back - '{got!r}'." + assert isinstance(got, str), f"Didn't get the correct result back - '{got!r}'." # Close and open the clipboard to ensure auto-conversions take place. finally: @@ -68,12 +68,12 @@ def TestText(): try: # Make sure I can still get the text as bytes got = GetClipboardData(win32con.CF_TEXT) - assert got == text_bytes, f"Didnt get the correct result back - '{got!r}'." + assert got == text_bytes, f"Didn't get the correct result back - '{got!r}'." # Make sure we get back the correct types. got = GetClipboardData(win32con.CF_UNICODETEXT) - assert isinstance(got, str), f"Didnt get the correct result back - '{got!r}'." + assert isinstance(got, str), f"Didn't get the correct result back - '{got!r}'." got = GetClipboardData(win32con.CF_OEMTEXT) - assert got == text_bytes, f"Didnt get the correct result back - '{got!r}'." + assert got == text_bytes, f"Didn't get the correct result back - '{got!r}'." print("Clipboard text tests worked correctly") finally: CloseClipboard() @@ -127,7 +127,7 @@ def TestCustomFormat(): # Now read it back. data = GetClipboardData(fmt) loaded_object = pickle.loads(data) - assert pickle.loads(data) == pickled_object, "Didnt get the correct data!" + assert pickle.loads(data) == pickled_object, "Didn't get the correct data!" print("Clipboard custom format tests worked correctly") finally: diff --git a/win32/Demos/win32comport_demo.py b/win32/Demos/win32comport_demo.py index 2ee4c3c15..1596e4139 100644 --- a/win32/Demos/win32comport_demo.py +++ b/win32/Demos/win32comport_demo.py @@ -11,7 +11,7 @@ # This demo uses userlapped IO, so that none of the read or write operations actually block (however, # in this sample, the very next thing we do _is_ block - so it shows off the concepts even though it -# doesnt exploit them. +# doesn't exploit them. import msvcrt # For the getch() function. import sys diff --git a/win32/Demos/win32netdemo.py b/win32/Demos/win32netdemo.py index 35aecda2e..7900a81a3 100644 --- a/win32/Demos/win32netdemo.py +++ b/win32/Demos/win32netdemo.py @@ -87,7 +87,7 @@ def GroupEnum(): break if not resume: break - assert nmembers, "Couldnt find a single member in a single group!" + assert nmembers, "Couldn't find a single member in a single group!" print("Enumerated all the groups") @@ -115,7 +115,7 @@ def LocalGroupEnum(): break if not resume: break - assert nmembers, "Couldnt find a single member in a single group!" + assert nmembers, "Couldn't find a single member in a single group!" print("Enumerated all the local groups") @@ -206,7 +206,7 @@ def SetInfo(userName=None): def SetComputerInfo(): - "Doesnt actually change anything, just make sure we could ;-)" + "Doesn't actually change anything, just make sure we could ;-)" info = win32net.NetWkstaGetInfo(None, 502) # *sob* - but we can't! Why not!!! # win32net.NetWkstaSetInfo(None, 502, info) diff --git a/win32/Demos/win32wnet/testwnet.py b/win32/Demos/win32wnet/testwnet.py index ca913e58f..1ddbf7d7a 100644 --- a/win32/Demos/win32wnet/testwnet.py +++ b/win32/Demos/win32wnet/testwnet.py @@ -115,7 +115,7 @@ 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!") + raise RuntimeError("Default value didn't seem to work!") TestGetUser() diff --git a/win32/Lib/regutil.py b/win32/Lib/regutil.py index 983763732..2b55e043f 100644 --- a/win32/Lib/regutil.py +++ b/win32/Lib/regutil.py @@ -76,7 +76,7 @@ def RegisterPythonExe(exeFullPath, exeAlias=None, exeAppPath=None): of the filename is used. exeAppPath -- Not supported. """ - # Note - Dont work on win32s (but we dont care anymore!) + # Note - Don't work on win32s (but we don't care anymore!) if exeAppPath: raise error("Do not support exeAppPath argument currently") if exeAlias is None: @@ -125,7 +125,7 @@ def UnregisterNamedPath(name): def GetRegisteredNamedPath(name): - """Get a registered named path, or None if it doesnt exist.""" + """Get a registered named path, or None if it doesn't exist.""" keyStr = BuildDefaultPythonKey() + "\\PythonPath" if name: keyStr = keyStr + "\\" + name diff --git a/win32/Lib/win32serviceutil.py b/win32/Lib/win32serviceutil.py index 0552e5fc3..98bc9735a 100644 --- a/win32/Lib/win32serviceutil.py +++ b/win32/Lib/win32serviceutil.py @@ -835,7 +835,7 @@ def HandleCommandLine( # Note that we install the service before calling the custom option # handler, so if the custom handler fails, we have an installed service (from NT's POV) # but is unlikely to work, as the Python code controlling it failed. Therefore - # we remove the service if the first bit works, but the second doesnt! + # we remove the service if the first bit works, but the second doesn't! try: InstallService( serviceClassString, diff --git a/win32/Lib/win32verstamp.py b/win32/Lib/win32verstamp.py index a705c967f..1fe0a6b7f 100644 --- a/win32/Lib/win32verstamp.py +++ b/win32/Lib/win32verstamp.py @@ -121,7 +121,7 @@ def VS_VERSION_INFO(maj, min, sub, build, sdata, vdata, debug=0, is_dll=1): def stamp(pathname, options): # For some reason, the API functions report success if the file is open - # but doesnt work! Try and open the file for writing, just to see if it is + # but doesn't work! Try and open the file for writing, just to see if it is # likely the stamp will work! try: f = open(pathname, "a+b") diff --git a/win32/help/win32net.html b/win32/help/win32net.html index 36e351b1f..6d4d62e18 100644 --- a/win32/help/win32net.html +++ b/win32/help/win32net.html @@ -217,7 +217,7 @@

    Creating a share

    Selecting that link will show a number of different PySHARE_INFO -structures; lets assume we want to use the PySHARE_INFO_2 structure. +structures; let's assume we want to use the PySHARE_INFO_2 structure. So do you create this PySHARE_INFO_2 Object? It is really quite simple: diff --git a/win32/scripts/VersionStamp/vssutil.py b/win32/scripts/VersionStamp/vssutil.py index 0a2fb9fc6..1e8da2bbc 100644 --- a/win32/scripts/VersionStamp/vssutil.py +++ b/win32/scripts/VersionStamp/vssutil.py @@ -115,7 +115,7 @@ def SubstituteVSSInFile(projectName, inName, outName): if version.Label: break else: - print("Couldnt find a label in the sourcesafe project!") + print("Couldn't find a label in the sourcesafe project!") return # Setup some local helpers for the conversion strings. vss_label = version.Label diff --git a/win32/src/PerfMon/PerfObjectType.cpp b/win32/src/PerfMon/PerfObjectType.cpp index f6feb1732..b496b9941 100644 --- a/win32/src/PerfMon/PerfObjectType.cpp +++ b/win32/src/PerfMon/PerfObjectType.cpp @@ -129,7 +129,7 @@ void PyPERF_OBJECT_TYPE::Term() m_obPerfMonManager = NULL; } -// Get the counter objects that Im gunna use. +// Get the counter objects that I'm gunna use. BOOL PyPERF_OBJECT_TYPE::InitPythonObjects(PyObject *obCounters) { m_obCounters = obCounters; @@ -138,8 +138,8 @@ BOOL PyPERF_OBJECT_TYPE::InitPythonObjects(PyObject *obCounters) } // Init the memory layout of the win32 perfmon structures from the mapping manager. -// Doesnt keep a reference to the mapping manager, but assumes it will stay alive -// until Im term'd! +// Doesn't keep a reference to the mapping manager, but assumes it will stay alive +// until I'm term'd! // Also _removes_ the reference to the counters' and _adds_ a reference to // the PyPerMonManager object BOOL PyPERF_OBJECT_TYPE::InitMemoryLayout(MappingManager *pmm, PyPerfMonManager *obPerfMonManager) diff --git a/win32/src/PerfMon/PyPerfMonControl.h b/win32/src/PerfMon/PyPerfMonControl.h index e3b0a358c..8a450683e 100644 --- a/win32/src/PerfMon/PyPerfMonControl.h +++ b/win32/src/PerfMon/PyPerfMonControl.h @@ -5,7 +5,7 @@ // A PERF_OBJECT_TYPE // A number of PERF_COUNTER_DEFINITIONs -// dont manage these size better cos I cant be bothered! +// don't manage these size better cos I can't be bothered! const int MMCD_SERVICE_SIZE = 25; const int MMCD_EVENTSOURCE_SIZE = 25; diff --git a/win32/src/PerfMon/perfmondata.cpp b/win32/src/PerfMon/perfmondata.cpp index 26ba10099..053387996 100644 --- a/win32/src/PerfMon/perfmondata.cpp +++ b/win32/src/PerfMon/perfmondata.cpp @@ -171,7 +171,7 @@ DWORD APIENTRY OpenPerformanceData(LPWSTR lpDeviceNames) if (!dwOpenCount) { // open Eventlog interface // The memmapped file name is derived from the DLL name. // Later we may offer to look up a string resource, but not now! - // NOTE - We dont open the event log yet, as we may wish to open it with a custom name + // NOTE - We don't open the event log yet, as we may wish to open it with a custom name // open shared memory used by application to pass performance values hSharedMemory = OpenFileMapping(FILE_MAP_READ, FALSE, szFileMapping); diff --git a/win32/src/PyTime.cpp b/win32/src/PyTime.cpp index 214186a3e..502ed8787 100644 --- a/win32/src/PyTime.cpp +++ b/win32/src/PyTime.cpp @@ -151,7 +151,7 @@ PyTypeObject PyWinDateTimeType = { PyWinDateTimeType_methods, /* tp_methods */ 0, /* tp_members */ 0, /* tp_getset */ - // we fill tp_base in at runtime; its not available statically. + // we fill tp_base in at runtime; it's not available statically. 0, /* tp_base */ 0, /* tp_dict */ 0, /* tp_descr_get */ diff --git a/win32/src/PyUnicode.cpp b/win32/src/PyUnicode.cpp index e185b7e80..b7382401e 100644 --- a/win32/src/PyUnicode.cpp +++ b/win32/src/PyUnicode.cpp @@ -21,7 +21,7 @@ BOOL PyWinObject_AsPfnAllocatedWCHAR(PyObject *stringObject, void *(*pfnAllocato if (buf == NULL) return FALSE; - /* We assume that we dont need more 'wide characters' for the result + /* We assume that we don't need more 'wide characters' for the result then the number of bytes in the input. Often we will need less, as the input may contain multi-byte chars, but we should never need more diff --git a/win32/src/PyWinTypes.h b/win32/src/PyWinTypes.h index a80d410bb..620aada9c 100644 --- a/win32/src/PyWinTypes.h +++ b/win32/src/PyWinTypes.h @@ -537,7 +537,7 @@ PYWINTYPES_EXPORT PyObject *PyWinMethod_NewHANDLE(PyObject *self, PyObject *args // A global function that does the right thing wrt closing a "handle". // The object can be either a PyHANDLE or an integer. -// If result is FALSE, a Python error is all setup (cf PyHANDLE::Close(), which doesnt set the Python error) +// If result is FALSE, a Python error is all setup (cf PyHANDLE::Close(), which doesn't set the Python error) PYWINTYPES_EXPORT BOOL PyWinObject_CloseHANDLE(PyObject *obHandle); PYWINTYPES_EXPORT BOOL PyWinObject_AsHKEY(PyObject *ob, HKEY *pRes); diff --git a/win32/src/PyWinTypesmodule.cpp b/win32/src/PyWinTypesmodule.cpp index e333de1ea..1564f84d5 100644 --- a/win32/src/PyWinTypesmodule.cpp +++ b/win32/src/PyWinTypesmodule.cpp @@ -1084,15 +1084,15 @@ PYWINTYPES_EXPORT WCHAR *GetPythonTraceback(PyObject *exc_type, PyObject *exc_va modStringIO = PyImport_ImportModule("io"); if (modStringIO == NULL) - GPEM_ERROR("cant import cStringIO"); + GPEM_ERROR("can't import cStringIO"); modTB = PyImport_ImportModule("traceback"); if (modTB == NULL) - GPEM_ERROR("cant import traceback"); + GPEM_ERROR("can't import traceback"); /* Construct a cStringIO object */ obFuncStringIO = PyObject_GetAttrString(modStringIO, "StringIO"); if (obFuncStringIO == NULL) - GPEM_ERROR("cant find cStringIO.StringIO"); + GPEM_ERROR("can't find cStringIO.StringIO"); obStringIO = PyObject_CallObject(obFuncStringIO, NULL); if (obStringIO == NULL) GPEM_ERROR("cStringIO.StringIO() failed"); @@ -1100,7 +1100,7 @@ PYWINTYPES_EXPORT WCHAR *GetPythonTraceback(PyObject *exc_type, PyObject *exc_va /* Get the traceback.print_exception function, and call it. */ obFuncTB = PyObject_GetAttrString(modTB, "print_exception"); if (obFuncTB == NULL) - GPEM_ERROR("cant find traceback.print_exception"); + GPEM_ERROR("can't find traceback.print_exception"); // Py3k has added an undocumented 'chain' argument which defaults to True // and causes all kinds of exceptions while trying to print a traceback! // This *could* be useful thought if we can tame it - later! @@ -1111,7 +1111,7 @@ PYWINTYPES_EXPORT WCHAR *GetPythonTraceback(PyObject *exc_type, PyObject *exc_va Py_None, // limit obStringIO, chain); if (argsTB == NULL) - GPEM_ERROR("cant make print_exception arguments"); + GPEM_ERROR("can't make print_exception arguments"); obResult = PyObject_CallObject(obFuncTB, argsTB); if (obResult == NULL) { @@ -1127,7 +1127,7 @@ PYWINTYPES_EXPORT WCHAR *GetPythonTraceback(PyObject *exc_type, PyObject *exc_va Py_DECREF(obFuncStringIO); obFuncStringIO = PyObject_GetAttrString(obStringIO, "getvalue"); if (obFuncStringIO == NULL) - GPEM_ERROR("cant find getvalue function"); + GPEM_ERROR("can't find getvalue function"); Py_DECREF(obResult); obResult = PyObject_CallObject(obFuncStringIO, NULL); if (obResult == NULL) diff --git a/win32/src/PythonService.cpp b/win32/src/PythonService.cpp index 48d65a540..181c97b50 100644 --- a/win32/src/PythonService.cpp +++ b/win32/src/PythonService.cpp @@ -599,7 +599,7 @@ static void PyService_InitPython() have_init = TRUE; // Often for a service, __argv[0] will be just "ExeName", rather // than "c:\path\to\ExeName.exe" - // This, however, shouldnt be a problem, as Python itself + // This, however, shouldn't be a problem, as Python itself // knows how to get the .EXE name when it needs. int pyargc; WCHAR **pyargv = CommandLineToArgvW(GetCommandLineW(), &pyargc); @@ -844,7 +844,7 @@ void WINAPI service_main(DWORD dwArgc, LPTSTR *lpszArgv) instance = LoadPythonServiceInstance(pe->klass, dwArgc, lpszArgv); // If Python has not yet registered the service control handler, then // we are in serious trouble - it is likely the service will enter a - // zombie state, where it wont do anything, but you can not start + // zombie state, where it won't do anything, but you can not start // another. Therefore, we still create register the handler, thereby // getting a handle, so we can immediately tell Windows the service // is rooted (that is a technical term!) @@ -899,7 +899,7 @@ void WINAPI service_main(DWORD dwArgc, LPTSTR *lpszArgv) // try to report the stopped status to the service control manager. Py_XDECREF(start); Py_XDECREF(instance); - if (pe && pe->sshStatusHandle) { // Wont be true if debugging. + if (pe && pe->sshStatusHandle) { // Won't be true if debugging. if (!SetServiceStatus(pe->sshStatusHandle, (stopWithError ? &stoppedErrorStatus : &stoppedStatus))) ReportAPIError(PYS_E_API_CANT_SET_STOPPED); } diff --git a/win32/src/_winxptheme.i b/win32/src/_winxptheme.i index 7b2b72bfa..3ef07bbb9 100644 --- a/win32/src/_winxptheme.i +++ b/win32/src/_winxptheme.i @@ -168,7 +168,7 @@ typedef long FLAGS; // class name) to provide the class an opportunity // to get the "best" match between the class and // the current theme. For example, a button might -// pass L"OkButton, Button" if its ID=ID_OK. If +// pass L"OkButton, Button" if it's ID=ID_OK. If // the current theme has an entry for OkButton, // that will be used. Otherwise, we fall back on // the normal Button entry. diff --git a/win32/src/win32apimodule.cpp b/win32/src/win32apimodule.cpp index f4a6dfdd9..026816e69 100644 --- a/win32/src/win32apimodule.cpp +++ b/win32/src/win32apimodule.cpp @@ -1927,7 +1927,7 @@ static PyObject *PyGetProfileSection(PyObject *self, PyObject *args) delete[] szRetBuf; size *= 2; } - szRetBuf = new TCHAR[size]; /* cant fail - may raise exception */ + szRetBuf = new TCHAR[size]; /* can't fail - may raise exception */ if (szRetBuf == NULL) { PyErr_SetString(PyExc_MemoryError, "Error allocating space for return buffer"); break; @@ -3273,7 +3273,7 @@ static BOOL PyWinObject_AsRegistryValue(PyObject *value, DWORD typ, BYTE **retDa } return FALSE; case REG_BINARY: - // ALSO handle ALL unknown data types here. Even if we cant support + // ALSO handle ALL unknown data types here. Even if we can't support // it natively, we should handle the bits. default: { PyWinBufferView pybuf(value, false, true); // None ok @@ -3353,7 +3353,7 @@ static PyObject *PyWinObject_FromRegistryValue(BYTE *retDataBuf, DWORD retDataSi break; } case REG_BINARY: - // ALSO handle ALL unknown data types here. Even if we cant support + // ALSO handle ALL unknown data types here. Even if we can't support // it natively, we should handle the bits. default: if (retDataSize == 0) { @@ -5185,8 +5185,8 @@ PyObject *PyEnumResourceLanguages(PyObject *self, PyObject *args) // Win32 Exception Handler. // // A recursive routine called by the exception handler! -// (I hope this doesnt wind too far on a stack overflow :-) -// Limited testing indicates it doesnt, and this can handle +// (I hope this doesn't wind too far on a stack overflow :-) +// Limited testing indicates it doesn't, and this can handle // a stack overflow fine. PyObject *MakeExceptionRecord(PEXCEPTION_RECORD pExceptionRecord) { diff --git a/win32/src/win32clipboardmodule.cpp b/win32/src/win32clipboardmodule.cpp index 8f552f691..9ffe4b076 100644 --- a/win32/src/win32clipboardmodule.cpp +++ b/win32/src/win32clipboardmodule.cpp @@ -863,7 +863,7 @@ static PyObject *py_set_clipboard_data(PyObject *self, PyObject *args) buf = pybuf.ptr(); bufSize = pybuf.len(); if ((PyBytes_Check(obhandle)) && (isTextFormat(format))) - bufSize++; // size doesnt include nulls! + bufSize++; // size doesn't include nulls! // else assume buffer needs no terminator... } handle = GlobalAlloc(GHND, bufSize); diff --git a/win32/src/win32gui.i b/win32/src/win32gui.i index c9fd1cf12..a59ae2823 100644 --- a/win32/src/win32gui.i +++ b/win32/src/win32gui.i @@ -6010,7 +6010,7 @@ PyGetClassName(PyObject *self, PyObject *args) return NULL; if (!PyWinObject_AsHANDLE(obhwnd, (HANDLE *)&hwnd)) return NULL; - // dont bother with lock - no callback possible. + // don't bother with lock - no callback possible. int nchars = GetClassName(hwnd, buf, sizeof buf/sizeof buf[0]); if (nchars==0) return PyWin_SetAPIError("GetClassName"); diff --git a/win32/src/win32net/win32netmisc.cpp b/win32/src/win32net/win32netmisc.cpp index 70213e28e..025665e36 100644 --- a/win32/src/win32net/win32netmisc.cpp +++ b/win32/src/win32net/win32netmisc.cpp @@ -373,7 +373,7 @@ static PyObject *PyNetShareEnum1(WCHAR *szServerName) return NULL; } - p_nr++; // next object (its a ++ because it is a typed pointer) + p_nr++; // next object (it's a ++ because it is a typed pointer) dwCount--; } while (dwCount); }; // if dwCount diff --git a/win32/src/win32net/win32netuser.cpp b/win32/src/win32net/win32netuser.cpp index d82c22f3e..e3977d4d1 100644 --- a/win32/src/win32net/win32netuser.cpp +++ b/win32/src/win32net/win32netuser.cpp @@ -511,7 +511,7 @@ PyObject *PyNetUserGetGroups(PyObject *self, PyObject *args) return NULL; } - p_nr++; // next object (its a ++ because it is a typed pointer!) + p_nr++; // next object (it's a ++ because it is a typed pointer!) dwCount--; } while (dwCount); }; // if (dwCount > 0) @@ -597,7 +597,7 @@ PyObject *PyNetUserGetLocalGroups(PyObject *self, PyObject *args) return NULL; } - p_nr++; // next object (its a ++ because it is a typed pointer!) + p_nr++; // next object (it's a ++ because it is a typed pointer!) dwCount--; } while (dwCount); }; // if (dwCount > 0) diff --git a/win32/src/win32pdhmodule.cpp b/win32/src/win32pdhmodule.cpp index 3c795fe31..5631da52a 100644 --- a/win32/src/win32pdhmodule.cpp +++ b/win32/src/win32pdhmodule.cpp @@ -665,7 +665,7 @@ static PyObject *PyGetFormattedCounterValue(PyObject *self, PyObject *args) else if (format & PDH_FMT_LARGE) rc = PyLong_FromLongLong(result.largeValue); else { - PyErr_SetString(PyExc_ValueError, "Dont know how to convert the result"); + PyErr_SetString(PyExc_ValueError, "Don't know how to convert the result"); rc = NULL; } PyObject *realrc = Py_BuildValue("iO", type, rc); @@ -731,7 +731,7 @@ static PyObject *PyPdhGetFormattedCounterArray(PyObject *self, PyObject *args) else if (format & PDH_FMT_LARGE) value = PyLong_FromLongLong(pItems[i].FmtValue.largeValue); else { - PyErr_SetString(PyExc_ValueError, "Dont know how to convert the result"); + PyErr_SetString(PyExc_ValueError, "Don't know how to convert the result"); Py_XDECREF(rc); Py_XDECREF(key); rc = NULL; diff --git a/win32/src/win32process.i b/win32/src/win32process.i index c7e95ddaa..beeb85981 100644 --- a/win32/src/win32process.i +++ b/win32/src/win32process.i @@ -460,7 +460,7 @@ static PyObject *myCreateRemoteThread(PyObject *self, PyObject *args) %native (CreateRemoteThread) myCreateRemoteThread; -// Wont expose ExitThread!!! May leak all sorts of things! +// Won't expose ExitThread!!! May leak all sorts of things! %{ diff --git a/win32/src/win32security_sspi.cpp b/win32/src/win32security_sspi.cpp index 021ca5c5f..32960b429 100644 --- a/win32/src/win32security_sspi.cpp +++ b/win32/src/win32security_sspi.cpp @@ -67,7 +67,7 @@ PySequenceMethods PySecBufferDesc_sequencemethods = { NULL, // objobjproc sq_contains; NULL, // binaryfunc sq_inplace_concat; NULL // intargfunc sq_inplace_repeat; -}; // ??? why isnt append included ??? +}; // ??? why isn't append included ??? // @object PySecBufferDesc|Sequence-like object that contains a group of buffers to be used with SSPI functions. // @comm This object is created using win32security.PySecBufferDescType(Version), where Version is an int that diff --git a/win32/src/win32wnet/win32wnet.cpp b/win32/src/win32wnet/win32wnet.cpp index c36d7e619..fe5c6ccb1 100644 --- a/win32/src/win32wnet/win32wnet.cpp +++ b/win32/src/win32wnet/win32wnet.cpp @@ -314,7 +314,7 @@ static PyObject *PyWNetEnumResource(PyObject *self, PyObject *args) // nothing hard & fast here, just a rough sizing..have to figure out something better later if (dwMaxCount == 0) // using 0 to mean a default - dwMaxCount = dwCount = 64; // lets default at 64 items + dwMaxCount = dwCount = 64; // let's default at 64 items else dwCount = dwMaxCount; // yes virginia, 0xffffffff is a LOT of items @@ -364,7 +364,7 @@ static PyObject *PyWNetEnumResource(PyObject *self, PyObject *args) return (ReturnError("Unable to create return list", "WNetEnumResource")); } - p_nr++; // next NETRESOURCE object (its a ++ because it is a typed pointer) + p_nr++; // next NETRESOURCE object (it's a ++ because it is a typed pointer) dwCount--; } while (dwCount); }; // if @@ -457,7 +457,7 @@ static PyObject *PyWNetGetUniversalName(PyObject *self, PyObject *args) // First get the buffer size. { - Py_BEGIN_ALLOW_THREADS char temp_buf[] = ""; // doesnt appear to like NULL!! + Py_BEGIN_ALLOW_THREADS char temp_buf[] = ""; // doesn't appear to like NULL!! errcode = WNetGetUniversalName(szLocalPath, level, &temp_buf, &length); Py_END_ALLOW_THREADS } diff --git a/win32/test/handles.py b/win32/test/handles.py index eb7152495..01b7f17ef 100644 --- a/win32/test/handles.py +++ b/win32/test/handles.py @@ -93,7 +93,7 @@ def testOtherHandle(self): # but the above doesn't really test everything - we want a way to # pass the handle directly into PyWinLong_AsVoidPtr. One way to # to that is to abuse win32api.GetProcAddress() - the 2nd param - # is passed to PyWinLong_AsVoidPtr() if its not a string. + # is passed to PyWinLong_AsVoidPtr() if it's not a string. # passing a handle value of '1' should work - there is something # at that ordinal win32api.GetProcAddress(sys.dllhandle, h) diff --git a/win32/test/test_pywintypes.py b/win32/test/test_pywintypes.py index 67c4a5afe..cf679b756 100644 --- a/win32/test/test_pywintypes.py +++ b/win32/test/test_pywintypes.py @@ -22,7 +22,7 @@ def testPyTimeFormat(self): def testPyTimePrint(self): # This used to crash with an invalid, or too early time. # We don't really want to check that it does cause a ValueError - # (as hopefully this wont be true forever). So either working, or + # (as hopefully this won't be true forever). So either working, or # ValueError is OK. try: t = pywintypes.Time(-2) diff --git a/win32/test/test_win32file.py b/win32/test/test_win32file.py index 159c45e67..ab5eac900 100644 --- a/win32/test/test_win32file.py +++ b/win32/test/test_win32file.py @@ -556,7 +556,7 @@ def testIter(self): self.assertEqual(set1, set2) def testBadDir(self): - dir = os.path.join(os.getcwd(), "a dir that doesnt exist", "*") + dir = os.path.join(os.getcwd(), "a dir that doesn't exist", "*") self.assertRaises(win32file.error, win32file.FindFilesIterator, dir) def testEmptySpec(self): @@ -724,7 +724,7 @@ def testEncrypt(self): except win32file.error as details: if details.winerror != winerror.ERROR_ACCESS_DENIED: raise - print("It appears this is not NTFS - cant encrypt/decrypt") + print("It appears this is not NTFS - can't encrypt/decrypt") win32file.DecryptFile(fname) finally: if f is not None: From 457bda8444635fe130f4a62c8e9091384ca46afd Mon Sep 17 00:00:00 2001 From: Avasam Date: Tue, 4 Jun 2024 11:21:28 -0400 Subject: [PATCH 20/21] Improve unit tests assertion messages (#2275) Using `unittest` assertion methods where possible (since this project doesn't use pytest) Raise `NotImplementedError` for unimplemented methods Use `raise AssertionError` instead of `assert 0` (except in `pywin/debugger`, in case that's done on purpose) --- Pythonwin/pywin/Demos/openGLDemo.py | 4 +- Pythonwin/pywin/debugger/debugger.py | 4 +- Pythonwin/pywin/framework/editor/template.py | 5 +- Pythonwin/pywin/idle/AutoIndent.py | 2 +- Pythonwin/pywin/test/test_exe.py | 6 +- Pythonwin/pywin/test/test_pywin.py | 126 ++++++++++-------- com/win32com/test/testConversionErrors.py | 6 +- com/win32com/test/testall.py | 4 +- com/win32comext/axdebug/codecontainer.py | 2 +- .../shell/demos/servers/folder_view.py | 4 +- win32/Lib/pywin32_testutil.py | 2 +- win32/test/test_exceptions.py | 3 +- win32/test/test_sspi.py | 21 ++- win32/test/test_win32file.py | 4 +- win32/test/test_win32inet.py | 5 +- win32/test/test_win32profile.py | 6 +- win32/test/test_win32trace.py | 18 +-- 17 files changed, 112 insertions(+), 110 deletions(-) diff --git a/Pythonwin/pywin/Demos/openGLDemo.py b/Pythonwin/pywin/Demos/openGLDemo.py index 9274949de..4608281e4 100644 --- a/Pythonwin/pywin/Demos/openGLDemo.py +++ b/Pythonwin/pywin/Demos/openGLDemo.py @@ -160,10 +160,10 @@ def _DestroyContexts(self): # The methods to support OpenGL def DrawScene(self): - assert 0, "You must override this method" + raise NotImplementedError("You must override this method") def Init(self): - assert 0, "You must override this method" + raise NotImplementedError("You must override this method") def OnSizeChange(self, cx, cy): pass diff --git a/Pythonwin/pywin/debugger/debugger.py b/Pythonwin/pywin/debugger/debugger.py index e44aa37ce..a8531f879 100644 --- a/Pythonwin/pywin/debugger/debugger.py +++ b/Pythonwin/pywin/debugger/debugger.py @@ -851,7 +851,7 @@ def set_cur_frame(self, frame): self.curindex = index break else: - assert 0, "Can't find the frame in the stack." + assert False, "Can't find the frame in the stack." SetInteractiveContext(frame.f_globals, frame.f_locals) self.GUIRespondDebuggerData() self.ShowCurrentLine() @@ -931,7 +931,7 @@ def GetDebuggerBar(self, barName): for id, klass, float in DebuggerDialogInfos: if klass.title == barName: return frame.GetControlBar(id) - assert 0, "Can't find a bar of that name!" + assert False, "Can't find a bar of that name!" def GUIRespondDebuggerData(self): if not self.inited: # GUI not inited - no toolbars etc. diff --git a/Pythonwin/pywin/framework/editor/template.py b/Pythonwin/pywin/framework/editor/template.py index 4b278188b..3dbc20298 100644 --- a/Pythonwin/pywin/framework/editor/template.py +++ b/Pythonwin/pywin/framework/editor/template.py @@ -1,6 +1,5 @@ import os -import pywin.framework.window import win32api import win32ui from pywin.mfc import docview @@ -19,10 +18,10 @@ def __init__( ParentEditorTemplate.__init__(self, res, makeDoc, makeFrame, makeView) def _CreateDocTemplate(self, resourceId): - assert 0, "You must override this" + raise NotImplementedError("You must override this") def CreateWin32uiDocument(self): - assert 0, "You must override this" + raise NotImplementedError("You must override this") def GetFileExtensions(self): return ".txt", ".py" diff --git a/Pythonwin/pywin/idle/AutoIndent.py b/Pythonwin/pywin/idle/AutoIndent.py index 0ed506e5a..c21fa2622 100644 --- a/Pythonwin/pywin/idle/AutoIndent.py +++ b/Pythonwin/pywin/idle/AutoIndent.py @@ -262,7 +262,7 @@ def newline_and_indent_event(self, event): else: self.reindent_to(y.compute_backslash_indent()) else: - assert 0, "bogus continuation type " + repr(c) + raise ValueError(f"bogus continuation type {c!r}") return "break" # This line starts a brand new stmt; indent relative to diff --git a/Pythonwin/pywin/test/test_exe.py b/Pythonwin/pywin/test/test_exe.py index 3063c3eed..d545bc636 100644 --- a/Pythonwin/pywin/test/test_exe.py +++ b/Pythonwin/pywin/test/test_exe.py @@ -46,7 +46,7 @@ def setUp(self): dst = os.path.dirname(pythonwinexe_path) + os.sep + pydll if not os.path.isfile(dst): try: - assert os.path.isfile(src) + self.assertTrue(os.path.isfile(src)) print(f"-- symlink {dst!r} -> {src!r}", file=sys.stderr) os.symlink(src, dst) except (OSError, AssertionError) as e: @@ -62,8 +62,8 @@ def test_exe(self): rc = "TIMEOUT" with open(self.tfn) as f: outs = f.read() - assert rc == 0, f"rc is {rc!r}, outs={outs!r}" - assert "Success!" in outs, outs + self.assertEqual(rc, 0, f"outs={outs!r}") + self.assertIn("Success!", outs) print("-- test_exe Ok! --", file=sys.stderr) def tearDown(self): diff --git a/Pythonwin/pywin/test/test_pywin.py b/Pythonwin/pywin/test/test_pywin.py index 63178e2a1..b38d87ec0 100644 --- a/Pythonwin/pywin/test/test_pywin.py +++ b/Pythonwin/pywin/test/test_pywin.py @@ -4,9 +4,7 @@ import argparse import os -import re import sys -import time import traceback import types import unittest @@ -21,8 +19,6 @@ import win32ui from pywin.framework import scriptutils -_clock = time.perf_counter - user_interaction = getattr(__main__, "user_interaction", False) # from all.py maybe file_abs = os.path.abspath(__file__) src_dir = os.path.dirname(file_abs) @@ -76,13 +72,13 @@ def test_1_pydocs_and_finddlg(self): # open a source file some_fn = src_dir + "\\_dbgscript.py" - assert some_fn != file_abs + self.assertNotEqual(some_fn, file_abs) scriptutils.JumpToDocument(some_fn) a = scriptutils.GetActiveFileName() - assert some_fn == a + self.assertEqual(some_fn, a) v = scriptutils.GetActiveEditControl() s = read_file(some_fn, encoding="latin-1", newline="\r\n") - assert s == v.GetTextRange(), "doc encoding not detected" + self.assertEqual(s, v.GetTextRange(), "doc encoding not detected") # open my own source file and check the text content scriptutils.JumpToDocument(__file__) @@ -91,14 +87,14 @@ def test_1_pydocs_and_finddlg(self): f"Hello from test_pydocs() args={sys.argv} {os.getcwd()}" ) v = scriptutils.GetActiveEditControl() - assert file_abs == v.GetDocument().GetPathName() + self.assertEqual(file_abs, v.GetDocument().GetPathName()) t = v.GetTextRange() testpat = "self.app = thisApp" - assert testpat in t + self.assertIn(testpat, t) # Umlauts for encoding test: áéúäöü - assert read_file(__file__, encoding="utf-8", newline="\r\n") == t + self.assertEqual(read_file(__file__, encoding="utf-8", newline="\r\n"), t) v.SetSel(0) - assert v.GetSel() == (0, 0) + self.assertEqual(v.GetSel(), (0, 0)) # raise the Find dialog using the menu and test it import pywin.scintilla.find @@ -111,15 +107,15 @@ def test_1_pydocs_and_finddlg(self): if "&Edit" != es: ix += 1 es = m.GetMenuString(ix, wc.MF_BYPOSITION) - assert "&Edit" == es + self.assertEqual("&Edit", es) editm = m.GetSubMenu(ix) - assert editm.GetMenuItemCount() > 10 + self.assertGreater(editm.GetMenuItemCount(), 10) for i in range(14): s = editm.GetMenuString(i, wc.MF_BYPOSITION) if s.startswith("R&eplace"): break else: - assert 0, "Replace menu entry not found" + raise AssertionError("Replace menu entry not found") replace_id = editm.GetMenuItemID(i) win32gui.PumpWaitingMessages() v.SendMessage(wc.WM_COMMAND, replace_id) @@ -127,7 +123,8 @@ def test_1_pydocs_and_finddlg(self): d.editFindText.SetWindowText(testpat) d.OnFindNext(0, 0) s, e = v.GetSel() - assert e - s == len(testpat) and s > 0 + self.assertEqual(e - s, len(testpat)) + self.assertGreater(s, 0) def test_browseobj(self): """Test object browser""" @@ -148,41 +145,43 @@ def t_Browse(*args): ), mock.patch("pywin.tools.browser.Browse", t_Browse): self.app.OnViewBrowse(0, 0) hl = o.dlg.hier_list - assert len(hl.itemHandleMap) > 10 - assert hl.listControl.GetCount() > 10 + self.assertGreater(len(hl.itemHandleMap), 10) + self.assertGreater(hl.listControl.GetCount(), 10) item = hl.GetSelectedItem() - assert "TestCase" in str(hl.listControl.GetItem(item)) - assert "TestCase" in hl.ItemFromHandle(item).GetText() + self.assertIn("TestCase", str(hl.listControl.GetItem(item))) + self.assertIn("TestCase", hl.ItemFromHandle(item).GetText()) item2 = hl.listControl.GetNextVisibleItem(item) - assert "Runs and tests" in str(hl.listControl.GetItem(item2)) + self.assertIn("Runs and tests", str(hl.listControl.GetItem(item2))) def test_options_propsheet(self): """Check Pythonwin options property sheet""" lres = [] + test = self + def t_DoModal(self): self.CreateWindow() p = self.GetPage(4) # format_page self.SetActivePage(p) p = self.GetPage(4) - assert p._DoButDefaultFont - assert ( # fixed / prop. font radio + test.assertTrue(p._DoButDefaultFont) + test.assertTrue( # fixed / prop. font radio p.GetDlgItem(win32ui.IDC_RADIO1).GetCheck() ^ p.GetDlgItem(win32ui.IDC_RADIO2).GetCheck() ) - assert p.listbox.GetCount() >= 16 # styles list - assert p.GetSelectedStyle().name + test.assertGreaterEqual(p.listbox.GetCount(), 16) # styles list + test.assertTrue(p.GetSelectedStyle().name) lres.append("done") w_obj = weakref.ref(p._obj_) - assert w_obj() + test.assertTrue(w_obj()) self.DestroyWindow() - assert p._obj_ is None - assert self._obj_ is None + test.assertIsNone(p._obj_) + test.assertIsNone(self._obj_) with mock.patch("pywin.mfc.dialog.PropertySheet.DoModal", t_DoModal): self.app.OnViewOptions(0, 0) - assert lres + self.assertTrue(lres) def test_ctrls(self): from pywin.mfc import dialog @@ -213,9 +212,9 @@ def test_ctrls(self): slider.CreateWindow(_cst, (0, 10, 200, 40), d, 100) win32gui.PumpWaitingMessages() mi, ma = slider.GetRange() - assert slider.GetPos() == 0 + self.assertEqual(slider.GetPos(), 0) slider.SetPos(20) - assert slider.GetPos() == 20 + self.assertEqual(slider.GetPos(), 20) # progress pc = win32ui.CreateProgressCtrl() @@ -227,9 +226,9 @@ def test_ctrls(self): # edit edit = win32ui.CreateEdit() edit.CreateWindow(_cst | wc.WS_BORDER, (5, 60, 100, 80), d, 101) - assert d.GetDlgItem(101) is edit + self.assertIs(d.GetDlgItem(101), edit) d.DestroyWindow() - assert d._obj_ is None + self.assertIsNone(d._obj_) def test_dc(self): from pywin.mfc import window @@ -290,8 +289,16 @@ def OnPaint(self): self.addCleanup(lambda: (o.cnt_ondestroy or w.DestroyWindow())) win32gui.PumpWaitingMessages() dc = w.GetDC() - assert o.cnt_onpaint > 0, "".join( - traceback.format_exception(None, o.exc, o.exc.__traceback__) + self.assertGreater( + o.cnt_onpaint, + 0, + ( + "".join( + traceback.format_exception(type(o.exc), o.exc, o.exc.__traceback__) + ) + if hasattr(o, "exc") + else None + ), ) pix = dc.GetPixel(1, 1) bmp = win32ui.CreateBitmap() @@ -300,13 +307,13 @@ def OnPaint(self): dcb.SelectObject(bmp) dcb.BitBlt((0, 0), (30, 30), dc, (0, 0), wc.SRCCOPY) sbits = bmp.GetBitmapBits(0) - assert any(sbits[:4]) + self.assertTrue(any(sbits[:4])) w.ReleaseDC(dc) - assert pix == 255 # red - assert o.cnt_ondestroy == 0 + self.assertEqual(pix, 255, "not red") + self.assertEqual(o.cnt_ondestroy, 0) w.DestroyWindow() - assert o.cnt_ondestroy == 1 + self.assertEqual(o.cnt_ondestroy, 1) def test_ia(self): """Test interactive, run, autocomplete, exec""" @@ -318,8 +325,9 @@ def test_ia(self): scriptutils.JumpToDocument(fn) cmGo = win32ui.IDC_DBG_GO mf.SendMessage(wc.WM_COMMAND, cmGo) - assert __main__.aa == 33 == ia.interp.globals["aa"] - assert __main__.ff() == 132 + self.assertEqual(__main__.aa, 33) + self.assertEqual(ia.interp.globals["aa"], 33) + self.assertEqual(__main__.ff(), 132) # ia auto-indent + auto-complete + exec ia.SetFocus() @@ -329,18 +337,20 @@ def test_ia(self): ia.ProcessEnterEvent(None) ia.ReplaceSel("CC") tail1 = ia.GetTextRange(ia.GetTextLength() - 20) - assert tail1.endswith("... \tCC"), "wrong auto-indent: %r" % tail1 + self.assertTrue(tail1.endswith("... \tCC"), f"wrong auto-indent: {tail1!r}") ia.SendMessage(wc.WM_KEYDOWN, win32api.VkKeyScan(".")) ia.SendMessage(wc.WM_KEYUP, win32api.VkKeyScan(".")) ia.SendMessage(wc.WM_KEYDOWN, wc.VK_TAB) # select 1st entry ia.SendMessage(wc.WM_KEYUP, wc.VK_TAB) tail2 = ia.GetTextRange(ia.GetTextLength() - 20) - assert tail2.endswith("... \tCC.cc"), "wrong auto-complete: %r" % tail2 + self.assertTrue( + tail2.endswith("... \tCC.cc"), f"wrong auto-complete: {tail2!r}" + ) ia.ProcessEnterEvent(None) ia.SendMessage(wc.WM_KEYDOWN, wc.VK_RETURN) ia.SendMessage(wc.WM_KEYUP, wc.VK_RETURN) execd = ia.GetTextRange(ia.GetTextLength() - 20) - assert "\n44" in execd, "wrong result: %r" % execd # CC.cc == 44 + self.assertIn("\n44", execd, "wrong result") # CC.cc == 44 # ia calltip + call exec ia.SetFocus() @@ -350,18 +360,18 @@ def test_ia(self): shift = ss_vk & 0x100 ## N/E win32api.SendInput() t_GKS = lambda key: (key == wc.VK_SHIFT and shift) and 0x8000 or 0 with mock.patch("win32api.GetKeyState", t_GKS): - assert not ia.SCICallTipActive() + self.assertFalse(ia.SCICallTipActive()) ia.SendMessage(wc.WM_KEYDOWN, ss_vk & 0xFF) ia.SendMessage(wc.WM_CHAR, ord("(")) ia.SendMessage(wc.WM_KEYUP, ss_vk & 0xFF) - assert ia.SCICallTipActive() + self.assertTrue(ia.SCICallTipActive()) if ia.GetSel()[1] == ia.GetTextLength(): # no auto close bracket ia.SendMessage(wc.WM_CHAR, ord(")")) ia.GotoEndOfFileEvent(None) ia.SendMessage(wc.WM_KEYDOWN, wc.VK_RETURN) ia.SendMessage(wc.WM_KEYUP, wc.VK_RETURN) execd = ia.GetTextRange(ia.GetTextLength() - 20) - assert "\n132" in execd, execd # ff() == 132 + self.assertIn("\n132", execd) # ff() == 132 def test_docedit(self): import tempfile @@ -370,15 +380,15 @@ def test_docedit(self): ##doc = pywin.framework.editor.editorTemplate.OpenDocumentFile(None) def t_print(*args): - assert "ERROR" not in str(args) # XXX put asserts into that test() - assert 0, "should not print at all" + self.assertNotIn("ERROR", str(args)) # XXX put asserts into that test() + raise AssertionError("should not print at all") with mock.patch("builtins.print", t_print): pywin.scintilla.IDLEenvironment.test() ed = scriptutils.GetActiveEditControl() doc = ed.GetDocument() - assert "hi there" in ed.GetTextRange() - assert doc.IsModified() + self.assertIn("hi there", ed.GetTextRange()) + self.assertTrue(doc.IsModified()) # edit w auto-indent ed.SetWindowText("") @@ -389,7 +399,7 @@ def t_print(*args): ed.SendMessage(wc.WM_KEYDOWN, wc.VK_RETURN) ed.SendMessage(wc.WM_KEYUP, wc.VK_RETURN) s = ed.GetTextRange() - assert re.match(r"(?m)if 1:\r\n[ \t]+CC\r\n[ \t]+\r\n$", s), "no auto-indent" + self.assertRegex(s, r"(?m)if 1:\r\n[ \t]+CC\r\n[ \t]+\r\n$", "no auto-indent") # save doc to temp file fh, tfn = tempfile.mkstemp(suffix=".py", prefix="pywintest-") @@ -397,7 +407,7 @@ def t_print(*args): self.addCleanup(lambda: os.remove(tfn)) doc.OnSaveDocument(tfn) r = read_file(tfn, "rb").decode() - assert s == r + self.assertEqual(s, r) doc.OnCloseDocument() def test_debugger(self): @@ -413,7 +423,7 @@ def test_debugger(self): win32gui.PumpWaitingMessages() src = v.GetTextRange() - assert "aa = 33" in src + self.assertIn("aa = 33", src) def getlno(s): return src[: src.index(s)].count("\n") + 1 @@ -438,10 +448,10 @@ def t_brk(self): "pywin.debugger.debugger.Debugger.GUIAboutToBreak", t_brk ): mf.SendMessage(wc.WM_COMMAND, cmGo) # debh.OnGo(0, 0) - assert not cmds_brk_next, "break commands remaining" - assert obj.brk_linenos[0] == getlno("aa = 22") - assert obj.brk_linenos[1] == getlno("aa = 77") - assert dmod.aa == 22 # aa = 33 not executed / cmClose + self.assertFalse(cmds_brk_next, "break commands remaining") + self.assertEqual(obj.brk_linenos[0], getlno("aa = 22")) + self.assertEqual(obj.brk_linenos[1], getlno("aa = 77")) + self.assertEqual(dmod.aa, 22) # aa = 33 not executed / cmClose if __name__ == "__main__": @@ -451,7 +461,7 @@ def t_brk(self): ##ts = unittest.TestLoader().loadTestsFromTestCase(T) _tests = ts._tests[:] r = ts.debug() - assert teared_down + t.assertTrue(teared_down) print(_tests, "ok!") sys.exit() diff --git a/com/win32com/test/testConversionErrors.py b/com/win32com/test/testConversionErrors.py index 773b9b80f..43bf32666 100644 --- a/com/win32com/test/testConversionErrors.py +++ b/com/win32com/test/testConversionErrors.py @@ -28,11 +28,7 @@ def __float__(self): class TestCase(win32com.test.util.TestCase): def test_float(self): - try: - test_ob().TestValue(BadConversions()) - raise Exception("Should not have worked") - except Exception as e: - assert isinstance(e, TestException) + self.assertRaises(TestException, test_ob().TestValue, BadConversions()) if __name__ == "__main__": diff --git a/com/win32com/test/testall.py b/com/win32com/test/testall.py index e9abe1036..9667f2348 100644 --- a/com/win32com/test/testall.py +++ b/com/win32com/test/testall.py @@ -226,7 +226,7 @@ def make_test_suite(test_level=1): test = mod.suite() else: test = loader.loadTestsFromModule(mod) - assert test.countTestCases() > 0, "No tests loaded from %r" % mod + assert test.countTestCases() > 0, f"No tests loaded from {mod!r}" suite.addTest(test) for cmd, output in output_checked_programs[i]: suite.addTest(ShellTestCase(cmd, output)) @@ -247,7 +247,7 @@ def make_test_suite(test_level=1): test = mod.suite() else: test = loader.loadTestsFromModule(mod) - assert test.countTestCases() > 0, "No tests loaded from %r" % mod + assert test.countTestCases() > 0, f"No tests loaded from {mod!r}" suite.addTest(test) return suite, import_failures diff --git a/com/win32comext/axdebug/codecontainer.py b/com/win32comext/axdebug/codecontainer.py index 8d03747d9..ccfa2eba0 100644 --- a/com/win32comext/axdebug/codecontainer.py +++ b/com/win32comext/axdebug/codecontainer.py @@ -55,7 +55,7 @@ def GetText(self): return self.text def GetName(self, dnt): - assert 0, "You must subclass this" + raise NotImplementedError("You must subclass this") def GetFileName(self): return self.fileName diff --git a/com/win32comext/shell/demos/servers/folder_view.py b/com/win32comext/shell/demos/servers/folder_view.py index 163297d9b..f2d039a15 100644 --- a/com/win32comext/shell/demos/servers/folder_view.py +++ b/com/win32comext/shell/demos/servers/folder_view.py @@ -538,12 +538,12 @@ def InvokeCommand(self, ci): if matches: break else: - assert False, ci # failed to find our ID + raise AssertionError(ci, "failed to find our ID") if verb_id == MENUVERB_DISPLAY: sia = shell.SHCreateShellItemArrayFromDataObject(self.dataobj) DisplayItem(hwnd, sia) else: - assert False, ci # Got some verb we weren't expecting? + raise AssertionError(ci, "Got some verb we weren't expecting?") def GetCommandString(self, cmd, typ): raise COMException(hresult=winerror.E_NOTIMPL) diff --git a/win32/Lib/pywin32_testutil.py b/win32/Lib/pywin32_testutil.py index 4dc33d1ae..59e4b59f1 100644 --- a/win32/Lib/pywin32_testutil.py +++ b/win32/Lib/pywin32_testutil.py @@ -61,7 +61,7 @@ def __call__(self, result=None): result.addFailure(self.real_test, (exc.__class__, exc, None)) def runTest(self): - assert 0, "not used" + raise NotImplementedError("not used") def _do_leak_tests(self, result=None): try: diff --git a/win32/test/test_exceptions.py b/win32/test/test_exceptions.py index 984d7271b..c222f0ade 100644 --- a/win32/test/test_exceptions.py +++ b/win32/test/test_exceptions.py @@ -5,7 +5,6 @@ import pythoncom import pywintypes import win32api -import win32file import winerror @@ -100,7 +99,7 @@ def testStrangeArgsNotEnough(self): raise pywintypes.error("foo") self.fail("Expected exception") except pywintypes.error as exc: - assert exc.args[0] == "foo" + self.assertEqual(exc.args[0], "foo") # 'winerror' always args[0] self.assertEqual(exc.winerror, "foo") self.assertEqual(exc.funcname, None) diff --git a/win32/test/test_sspi.py b/win32/test/test_sspi.py index 17256b75b..6b113aeb0 100644 --- a/win32/test/test_sspi.py +++ b/win32/test/test_sspi.py @@ -1,7 +1,6 @@ # Some tests of the win32security sspi functions. # Stolen from Roger's original test_sspi.c, a version of which is in "Demos" # See also the other SSPI demos. -import re import unittest import sspi @@ -196,33 +195,33 @@ def testSequenceEncrypt(self): def testSecBufferRepr(self): desc = win32security.PySecBufferDescType() - assert re.match( - r"PySecBufferDesc\(ulVersion: 0 \| cBuffers: 0 \| pBuffers: 0x[\da-fA-F]{8,16}\)", + self.assertRegex( repr(desc), + r"PySecBufferDesc\(ulVersion: 0 \| cBuffers: 0 \| pBuffers: 0x[\da-fA-F]{8,16}\)", ) buffer1 = win32security.PySecBufferType(0, sspicon.SECBUFFER_TOKEN) - assert re.match( - r"PySecBuffer\(cbBuffer: 0 \| BufferType: 2 \| pvBuffer: 0x[\da-fA-F]{8,16}\)", + self.assertRegex( repr(buffer1), + r"PySecBuffer\(cbBuffer: 0 \| BufferType: 2 \| pvBuffer: 0x[\da-fA-F]{8,16}\)", ) desc.append(buffer1) - assert re.match( - r"PySecBufferDesc\(ulVersion: 0 \| cBuffers: 1 \| pBuffers: 0x[\da-fA-F]{8,16}\)", + self.assertRegex( repr(desc), + r"PySecBufferDesc\(ulVersion: 0 \| cBuffers: 1 \| pBuffers: 0x[\da-fA-F]{8,16}\)", ) buffer2 = win32security.PySecBufferType(4, sspicon.SECBUFFER_DATA) - assert re.match( - r"PySecBuffer\(cbBuffer: 4 \| BufferType: 1 \| pvBuffer: 0x[\da-fA-F]{8,16}\)", + self.assertRegex( repr(buffer2), + r"PySecBuffer\(cbBuffer: 4 \| BufferType: 1 \| pvBuffer: 0x[\da-fA-F]{8,16}\)", ) desc.append(buffer2) - assert re.match( - r"PySecBufferDesc\(ulVersion: 0 \| cBuffers: 2 \| pBuffers: 0x[\da-fA-F]{8,16}\)", + self.assertRegex( repr(desc), + r"PySecBufferDesc\(ulVersion: 0 \| cBuffers: 2 \| pBuffers: 0x[\da-fA-F]{8,16}\)", ) diff --git a/win32/test/test_win32file.py b/win32/test/test_win32file.py index ab5eac900..caa9c8fb5 100644 --- a/win32/test/test_win32file.py +++ b/win32/test/test_win32file.py @@ -351,7 +351,7 @@ def testCompletionPortsMultiple(self): sock.listen(1) socks.append(sock) new = win32file.CreateIoCompletionPort(sock.fileno(), ioport, PORT, 0) - assert new is ioport + self.assertIs(new, ioport) for s in socks: s.close() hv = int(ioport) @@ -552,7 +552,7 @@ def testIter(self): set2 = set() for file in win32file.FindFilesIterator(dir): set2.add(file) - assert len(set2) > 5, "This directory has less than 5 files!?" + self.assertGreater(len(set2), 5, "This directory has less than 5 files!?") self.assertEqual(set1, set2) def testBadDir(self): diff --git a/win32/test/test_win32inet.py b/win32/test/test_win32inet.py index bf4a9af3c..fe7de185c 100644 --- a/win32/test/test_win32inet.py +++ b/win32/test/test_win32inet.py @@ -53,9 +53,8 @@ def testPythonDotOrg(self): break chunks.append(chunk) data = b"".join(chunks) - assert data.find(b"Python") > 0, repr( - data - ) # This must appear somewhere on the main page! + # This must appear somewhere on the main page! + self.assertGreater(data.find(b"Python"), 0, repr(data)) def testFtpCommand(self): # ftp.python.org doesn't exist. ftp.gnu.org is what Python's urllib diff --git a/win32/test/test_win32profile.py b/win32/test/test_win32profile.py index 71432363f..4ddc8d382 100644 --- a/win32/test/test_win32profile.py +++ b/win32/test/test_win32profile.py @@ -10,9 +10,9 @@ class Tester(unittest.TestCase): def test_environment(self): os.environ["FOO"] = "bar=baz" env = win32profile.GetEnvironmentStrings() - assert "FOO" in env - assert env["FOO"] == "bar=baz" - assert os.environ["FOO"] == "bar=baz" + self.assertIn("FOO", env) + self.assertEqual(env["FOO"], "bar=baz") + self.assertEqual(os.environ["FOO"], "bar=baz") if __name__ == "__main__": diff --git a/win32/test/test_win32trace.py b/win32/test/test_win32trace.py index 01b18caf2..d16a02d39 100644 --- a/win32/test/test_win32trace.py +++ b/win32/test/test_win32trace.py @@ -152,7 +152,7 @@ def testFlush(self): def testIsatty(self): tracer = win32trace.GetTracer() - assert tracer.isatty() == False + self.assertFalse(tracer.isatty()) def testRoundTrip(self): traceObject = win32trace.GetTracer() @@ -195,7 +195,7 @@ def tearDown(self): def areBucketsFull(self): bucketsAreFull = True for each in self.buckets: - assert each <= self.FullBucket, each + self.assertLessEqual(each, self.FullBucket) if each != self.FullBucket: bucketsAreFull = False break @@ -207,7 +207,7 @@ def read(self): for ch in readString: integer = int(ch) count = self.buckets[integer] - assert count != -1 + self.assertNotEqual(count, -1) self.buckets[integer] = count + 1 if self.buckets[integer] == self.FullBucket: if self.areBucketsFull(): @@ -220,8 +220,8 @@ def testThreads(self): for each in self.threads: each.join() for each in self.threads: - assert each.verifyWritten() - assert self.areBucketsFull() + self.assertTrue(each.verifyWritten()) + self.assertTrue(self.areBucketsFull()) class TestHugeChunks(unittest.TestCase): @@ -307,7 +307,7 @@ def setUpWriters(self): def areBucketsFull(self): bucketsAreFull = True for each in self.buckets: - assert each <= self.FullBucket, each + self.assertLessEqual(each, self.FullBucket) if each != self.FullBucket: bucketsAreFull = False break @@ -319,7 +319,7 @@ def read(self): for ch in readString: integer = int(ch) count = self.buckets[integer] - assert count != -1 + self.assertNotEqual(count, -1) self.buckets[integer] = count + 1 if self.buckets[integer] == self.FullBucket: if self.areBucketsFull(): @@ -332,8 +332,8 @@ def testProcesses(self): for each in self.processes: each.join() for each in self.processes: - assert each.verifyWritten() - assert self.areBucketsFull() + self.assertTrue(each.verifyWritten()) + self.assertTrue(self.areBucketsFull()) def _RunAsTestProcess(): From 60d72363dacd12ed75df71625522a12cc168e390 Mon Sep 17 00:00:00 2001 From: Avasam Date: Tue, 4 Jun 2024 13:39:25 -0400 Subject: [PATCH 21/21] Using augmented assignements (in-place operators) where possible (#2274) --- AutoDuck/BuildHHP.py | 12 +-- AutoDuck/InsertExternalOverviews.py | 6 +- AutoDuck/makedfromi.py | 14 ++-- CHANGES.txt | 1 + Pythonwin/pywin/Demos/app/basictimerapp.py | 6 +- Pythonwin/pywin/Demos/app/customprint.py | 10 +-- Pythonwin/pywin/Demos/cmdserver.py | 2 +- Pythonwin/pywin/Demos/dlgtest.py | 2 +- Pythonwin/pywin/Demos/ocx/flash.py | 6 +- Pythonwin/pywin/Demos/openGLDemo.py | 14 ++-- Pythonwin/pywin/Demos/progressbar.py | 2 +- Pythonwin/pywin/Demos/threadedgui.py | 2 +- Pythonwin/pywin/debugger/debugger.py | 4 +- Pythonwin/pywin/dialogs/list.py | 2 +- Pythonwin/pywin/docking/DockingBar.py | 70 ++++++++--------- Pythonwin/pywin/framework/app.py | 4 +- Pythonwin/pywin/framework/cmdline.py | 6 +- .../framework/editor/color/coloreditor.py | 2 +- Pythonwin/pywin/framework/editor/configui.py | 2 +- Pythonwin/pywin/framework/editor/document.py | 4 +- Pythonwin/pywin/framework/editor/editor.py | 8 +- Pythonwin/pywin/framework/help.py | 4 +- Pythonwin/pywin/framework/interact.py | 22 +++--- Pythonwin/pywin/framework/intpyapp.py | 2 +- Pythonwin/pywin/framework/mdi_pychecker.py | 16 ++-- Pythonwin/pywin/framework/scriptutils.py | 4 +- Pythonwin/pywin/framework/sgrepmdi.py | 16 ++-- Pythonwin/pywin/framework/stdin.py | 2 +- Pythonwin/pywin/framework/toolmenu.py | 10 +-- Pythonwin/pywin/framework/winout.py | 4 +- Pythonwin/pywin/idle/AutoExpand.py | 2 +- Pythonwin/pywin/idle/AutoIndent.py | 14 ++-- Pythonwin/pywin/idle/CallTips.py | 6 +- Pythonwin/pywin/idle/FormatParagraph.py | 14 ++-- Pythonwin/pywin/idle/IdleHistory.py | 4 +- Pythonwin/pywin/idle/PyParse.py | 60 +++++++-------- Pythonwin/pywin/scintilla/IDLEenvironment.py | 30 ++++---- Pythonwin/pywin/scintilla/bindings.py | 10 +-- Pythonwin/pywin/scintilla/config.py | 10 +-- Pythonwin/pywin/scintilla/configui.py | 2 +- Pythonwin/pywin/scintilla/document.py | 2 +- Pythonwin/pywin/scintilla/find.py | 6 +- Pythonwin/pywin/scintilla/formatter.py | 22 +++--- Pythonwin/pywin/scintilla/keycodes.py | 4 +- Pythonwin/pywin/scintilla/view.py | 24 +++--- Pythonwin/pywin/tools/browseProjects.py | 4 +- Pythonwin/pywin/tools/browser.py | 6 +- Pythonwin/pywin/tools/hierlist.py | 2 +- Pythonwin/pywin/tools/regedit.py | 6 +- com/win32com/client/__init__.py | 2 +- com/win32com/client/build.py | 74 ++++++++---------- com/win32com/client/combrowse.py | 16 ++-- com/win32com/client/gencache.py | 4 +- com/win32com/client/genpy.py | 6 +- com/win32com/client/makepy.py | 4 +- com/win32com/client/selecttlb.py | 2 +- com/win32com/client/tlbrowse.py | 8 +- com/win32com/makegw/makegw.py | 77 ++++++++----------- com/win32com/makegw/makegwparse.py | 16 ++-- com/win32com/server/connect.py | 2 +- com/win32com/server/policy.py | 2 +- com/win32com/server/register.py | 10 +-- com/win32com/test/testGIT.py | 2 +- com/win32com/test/testGatewayAddresses.py | 2 +- com/win32com/test/testMarshal.py | 2 +- com/win32com/test/testPersist.py | 4 +- com/win32com/test/testPyComTest.py | 6 +- com/win32com/test/testStreams.py | 4 +- com/win32com/test/util.py | 2 +- com/win32com/universal.py | 2 +- com/win32comext/adsi/demos/test.py | 18 ++--- com/win32comext/axdebug/Test/host.py | 4 +- com/win32comext/axdebug/codecontainer.py | 8 +- com/win32comext/axdebug/gateways.py | 2 +- com/win32comext/axdebug/stackframe.py | 6 +- com/win32comext/axscript/client/framework.py | 6 +- com/win32comext/axscript/client/pyscript.py | 8 +- com/win32comext/mapi/mapiutil.py | 4 +- .../shell/demos/IFileOperationProgressSink.py | 2 +- .../shell/demos/ITransferAdviseSink.py | 2 +- isapi/install.py | 2 +- pywin32_testall.py | 2 +- setup.py | 4 +- win32/Demos/FileSecurityTest.py | 2 +- win32/Demos/desktopmanager.py | 6 +- win32/Demos/eventLogDemo.py | 4 +- win32/Demos/security/security_enums.py | 2 +- win32/Demos/service/pipeTestService.py | 4 +- win32/Demos/service/pipeTestServiceClient.py | 2 +- win32/Demos/timer_demo.py | 2 +- win32/Demos/win32gui_dialog.py | 2 +- win32/Demos/win32netdemo.py | 8 +- win32/Lib/pywin32_testutil.py | 2 +- win32/Lib/regcheck.py | 4 +- win32/Lib/regutil.py | 4 +- win32/Lib/sspi.py | 2 +- win32/Lib/win32gui_struct.py | 14 ++-- win32/Lib/win32pdhquery.py | 2 +- win32/Lib/win32pdhutil.py | 4 +- win32/Lib/win32serviceutil.py | 14 ++-- win32/Lib/win32verstamp.py | 16 ++-- win32/scripts/ControlService.py | 2 +- win32/scripts/VersionStamp/bulkstamp.py | 2 +- win32/scripts/VersionStamp/vssutil.py | 10 +-- win32/scripts/backupEventLog.py | 2 +- win32/scripts/rasutil.py | 2 +- win32/test/test_win32file.py | 4 +- win32/test/test_win32trace.py | 2 +- 108 files changed, 446 insertions(+), 474 deletions(-) diff --git a/AutoDuck/BuildHHP.py b/AutoDuck/BuildHHP.py index afe6f26bb..aacc62e37 100644 --- a/AutoDuck/BuildHHP.py +++ b/AutoDuck/BuildHHP.py @@ -41,7 +41,7 @@ def handle_globs(lGlobs): new = glob.glob(g) if len(new) == 0: print(f"The pattern '{g}' yielded no files!") - lFiles = lFiles + new + lFiles.extend(new) # lFiles is now the list of origin files. # Normalize all of the paths: cFiles = len(lFiles) @@ -52,9 +52,9 @@ def handle_globs(lGlobs): while i < cFiles: if not os.path.isfile(lFiles[i]): del lFiles[i] - cFiles = cFiles - 1 + cFiles -= 1 continue - i = i + 1 + i += 1 # Find the common prefix of all of the files sCommonPrefix = os.path.commonprefix(lFiles) # Damn - more commonprefix problems @@ -111,12 +111,12 @@ def main(): shutil.copyfile(lSrcFiles[i], file) for file in lDestFiles: - html_files = html_files + f"{html_dir}\\{file}\n" + html_files += f"{html_dir}\\{file}\n" for cat in doc: - html_files = html_files + f"{output_dir}\\{cat.id}.html\n" + html_files += f"{output_dir}\\{cat.id}.html\n" for suffix in "_overview _modules _objects _constants".split(): - html_files = html_files + f"{output_dir}\\{cat.id}{suffix}.html\n" + html_files += f"{output_dir}\\{cat.id}{suffix}.html\n" f.write(sHHPFormat % {"output": output, "target": target, "html_files": html_files}) f.close() diff --git a/AutoDuck/InsertExternalOverviews.py b/AutoDuck/InsertExternalOverviews.py index ea7c2c722..c0465e40b 100644 --- a/AutoDuck/InsertExternalOverviews.py +++ b/AutoDuck/InsertExternalOverviews.py @@ -25,21 +25,21 @@ def processFile(input, out, extLinksHTML, extTopicHTML, importantHTML): def genHTML(doc): s = "" for cat in doc: - s = s + f"

    {cat.label}

    \n" + s += f"

    {cat.label}

    \n" dict = {} for item in cat.overviewItems.items: dict[item.name] = item.href keys = list(dict.keys()) keys.sort() for k in keys: - s = s + f'
  • {k}\n' + s += f'
  • {k}\n' return s def genLinksHTML(links): s = "" for link in links: - s = s + f'
  • {link.name}\n' + s += f'
  • {link.name}\n' return s diff --git a/AutoDuck/makedfromi.py b/AutoDuck/makedfromi.py index a2d92c712..4fd2f44ac 100644 --- a/AutoDuck/makedfromi.py +++ b/AutoDuck/makedfromi.py @@ -13,7 +13,7 @@ def GetComments(line, lineNo, lines): doc = "" if len(data) == 2: doc = data[1].strip() - lineNo = lineNo + 1 + lineNo += 1 while lineNo < len(lines): line = lines[lineNo] data = line.split("//", 2) @@ -24,10 +24,10 @@ def GetComments(line, lineNo, lines): if data[1].strip().startswith("@"): # new command break - doc = doc + "\n// " + data[1].strip() - lineNo = lineNo + 1 + doc += "\n// " + data[1].strip() + lineNo += 1 # This line doesn't match - step back - lineNo = lineNo - 1 + lineNo -= 1 return doc, lineNo @@ -87,7 +87,7 @@ def make_doc_summary(inFile, outFile): _, msg, _ = sys.exc_info() print("Line %d is badly formed - %s" % (lineNo, msg)) - lineNo = lineNo + 1 + lineNo += 1 # autoduck seems to crash when > ~97 methods. Loop multiple times, # creating a synthetic module name when this happens. @@ -106,9 +106,9 @@ def make_doc_summary(inFile, outFile): if chunk_number == 0: pass elif chunk_number == 1: - thisModName = thisModName + " (more)" + thisModName += " (more)" else: - thisModName = thisModName + " (more %d)" % (chunk_number + 1,) + thisModName += " (more %d)" % (chunk_number + 1,) outFile.write("\n") for meth, extras in these_methods: diff --git a/CHANGES.txt b/CHANGES.txt index d427d2baa..66426f629 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -137,6 +137,7 @@ Coming in build 307, as yet unreleased * Use byte-string (`b""`) for constant bytes values instead of superfluous `.encode` calls (#2046, @Avasam) * Cleaned up unused imports (#1986, #2051, #1990, #2124, #2126, @Avasam) * Removed duplicated declarations, constants and definitions (#2050 , #1950, #1990, @Avasam) +* Small generalized optimization by using augmented assignements (in-place operators) where possible (#2274, @Avasam) * General speed and size improvements due to all the removed code. (#2046, #1986, #2050, #1950, #2085, #2087, #2051, #1990, #2106, #2127, #2124, #2126, #2177, #2218, #2202, #2205, #2217) ### adodbapi diff --git a/Pythonwin/pywin/Demos/app/basictimerapp.py b/Pythonwin/pywin/Demos/app/basictimerapp.py index a932ae060..c60271b95 100644 --- a/Pythonwin/pywin/Demos/app/basictimerapp.py +++ b/Pythonwin/pywin/Demos/app/basictimerapp.py @@ -144,9 +144,9 @@ def OnTimer(self, id, timeVal): if nextTime: timeDiffSeconds = nextTime - now timeDiffMinutes = int(timeDiffSeconds / 60) - timeDiffSeconds = timeDiffSeconds % 60 + timeDiffSeconds %= 60 timeDiffHours = int(timeDiffMinutes / 60) - timeDiffMinutes = timeDiffMinutes % 60 + timeDiffMinutes %= 60 self.dlg.prompt1.SetWindowText( "Next connection due in %02d:%02d:%02d" % (timeDiffHours, timeDiffMinutes, timeDiffSeconds) @@ -200,7 +200,7 @@ def SetFirstTime(self, now): lst[pos] = 0 ret = time.mktime(tuple(lst)) if bAdd: - ret = ret + self.timeAdd + ret += self.timeAdd return ret def SetNextTime(self, lastTime, now): diff --git a/Pythonwin/pywin/Demos/app/customprint.py b/Pythonwin/pywin/Demos/app/customprint.py index 442737b5b..4a666ca41 100644 --- a/Pythonwin/pywin/Demos/app/customprint.py +++ b/Pythonwin/pywin/Demos/app/customprint.py @@ -47,7 +47,7 @@ def OnDraw(self, dc): delta = 2 colors = list(self.colors.keys()) colors.sort() - colors = colors * 2 + colors *= 2 for color in colors: if oldPen is None: oldPen = dc.SelectObject(self.pens[color]) @@ -58,7 +58,7 @@ def OnDraw(self, dc): dc.LineTo((x - delta, y - delta)) dc.LineTo((delta, y - delta)) dc.LineTo((delta, delta)) - delta = delta + 4 + delta += 4 if x - delta <= 0 or y - delta <= 0: break dc.SelectObject(oldPen) @@ -108,10 +108,10 @@ def OnPrint(self, dc, pInfo): cyChar = metrics["tmHeight"] left, top, right, bottom = pInfo.GetDraw() dc.TextOut(0, 2 * cyChar, doc.GetTitle()) - top = top + (7 * cyChar) / 2 + top += 7 * cyChar / 2 dc.MoveTo(left, top) dc.LineTo(right, top) - top = top + cyChar + top += cyChar # this seems to have not effect... # get what I want with the dc.SetWindowOrg calls pInfo.SetDraw((left, top, right, bottom)) @@ -131,7 +131,7 @@ def OnPrint(self, dc, pInfo): y = (3 * cyChar) / 2 dc.TextOut(x, y, doc.GetTitle()) - y = y + cyChar + y += cyChar class PrintDemoApp(app.CApp): diff --git a/Pythonwin/pywin/Demos/cmdserver.py b/Pythonwin/pywin/Demos/cmdserver.py index 08a6e81e6..4ec6e49b3 100644 --- a/Pythonwin/pywin/Demos/cmdserver.py +++ b/Pythonwin/pywin/Demos/cmdserver.py @@ -52,7 +52,7 @@ def Test(): while num < 1000: print("Hello there no " + str(num)) win32api.Sleep(50) - num = num + 1 + num += 1 class flags: diff --git a/Pythonwin/pywin/Demos/dlgtest.py b/Pythonwin/pywin/Demos/dlgtest.py index acef88017..2fb0b60cd 100644 --- a/Pythonwin/pywin/Demos/dlgtest.py +++ b/Pythonwin/pywin/Demos/dlgtest.py @@ -50,7 +50,7 @@ def OnNotify(self, controlid, code): # kill focus for the edit box. # Simply increment the value in the text box. def KillFocus(self, msg): - self.counter = self.counter + 1 + self.counter += 1 if self.edit is not None: self.edit.SetWindowText(str(self.counter)) diff --git a/Pythonwin/pywin/Demos/ocx/flash.py b/Pythonwin/pywin/Demos/ocx/flash.py index 9aa32bfc7..f2994e50a 100644 --- a/Pythonwin/pywin/Demos/ocx/flash.py +++ b/Pythonwin/pywin/Demos/ocx/flash.py @@ -33,9 +33,9 @@ def __init__(self): def OnFSCommand(self, command, args): print("FSCommend", command, args) - self.x = self.x + 20 - self.y = self.y + 20 - self.angle = self.angle + 20 + self.x += 20 + self.y += 20 + self.angle += 20 if self.x > 200 or self.y > 200: self.x = 0 self.y = 0 diff --git a/Pythonwin/pywin/Demos/openGLDemo.py b/Pythonwin/pywin/Demos/openGLDemo.py index 4608281e4..f7449d1e0 100644 --- a/Pythonwin/pywin/Demos/openGLDemo.py +++ b/Pythonwin/pywin/Demos/openGLDemo.py @@ -50,13 +50,13 @@ def ComponentFromIndex(i, nbits, shift): # val = (unsigned char) (i >> shift); val = (i >> shift) & 0xF if nbits == 1: - val = val & 0x1 + val &= 0x1 return oneto8[val] elif nbits == 2: - val = val & 0x3 + val &= 0x3 return twoto8[val] elif nbits == 3: - val = val & 0x7 + val &= 0x7 return threeto8[val] else: return 0 @@ -72,7 +72,7 @@ def PreCreateWindow(self, cc): # include CS_PARENTDC for the class style. Refer to SetPixelFormat # documentation in the "Comments" section for further information. style = cc[5] - style = style | win32con.WS_CLIPSIBLINGS | win32con.WS_CLIPCHILDREN + style |= win32con.WS_CLIPSIBLINGS | win32con.WS_CLIPCHILDREN cc = cc[0], cc[1], cc[2], cc[3], cc[4], style, cc[6], cc[7], cc[8] cc = self._obj_.PreCreateWindow(cc) return cc @@ -287,9 +287,9 @@ def DrawScene(self): glRotatef(self.wAngleY, 0.0, 1.0, 0.0) glRotatef(self.wAngleZ, 0.0, 0.0, 1.0) - self.wAngleX = self.wAngleX + 1.0 - self.wAngleY = self.wAngleY + 10.0 - self.wAngleZ = self.wAngleZ + 5.0 + self.wAngleX += 1.0 + self.wAngleY += 10.0 + self.wAngleZ += 5.0 glBegin(GL_QUAD_STRIP) glColor3f(1.0, 0.0, 1.0) diff --git a/Pythonwin/pywin/Demos/progressbar.py b/Pythonwin/pywin/Demos/progressbar.py index 81cd7e381..e16a42cb4 100644 --- a/Pythonwin/pywin/Demos/progressbar.py +++ b/Pythonwin/pywin/Demos/progressbar.py @@ -86,7 +86,7 @@ def OnInitDialog(self): def OnOK(self): # NB: StepIt wraps at the end if you increment past the upper limit! # self.pbar.StepIt() - self.progress = self.progress + self.pincr + self.progress += self.pincr if self.progress > 100: self.progress = 100 if self.progress <= 100: diff --git a/Pythonwin/pywin/Demos/threadedgui.py b/Pythonwin/pywin/Demos/threadedgui.py index c5c0ba667..917b3ad64 100644 --- a/Pythonwin/pywin/Demos/threadedgui.py +++ b/Pythonwin/pywin/Demos/threadedgui.py @@ -51,7 +51,7 @@ def OnDestroy(self, msg): timer.kill_timer(self.timerid) def OnTimer(self, id, timeVal): - self.index = self.index + self.incr + self.index += self.incr if self.index > len(self.text): self.incr = -1 self.index = len(self.text) diff --git a/Pythonwin/pywin/debugger/debugger.py b/Pythonwin/pywin/debugger/debugger.py index a8531f879..2c2904391 100644 --- a/Pythonwin/pywin/debugger/debugger.py +++ b/Pythonwin/pywin/debugger/debugger.py @@ -289,7 +289,7 @@ def CreateWindow(self, parent): list.InsertColumn(0, itemDetails) col = 1 for title, width in self.columns[1:]: - col = col + 1 + col += 1 itemDetails = (commctrl.LVCFMT_LEFT, width, title, 0) list.InsertColumn(col, itemDetails) parent.HookNotify(self.OnListEndLabelEdit, LVN_ENDLABELEDIT) @@ -746,7 +746,7 @@ def run(self, cmd, globals=None, locals=None, start_stepping=1): self.prep_run(cmd) sys.settrace(self.trace_dispatch) if not isinstance(cmd, types.CodeType): - cmd = cmd + "\n" + cmd += "\n" try: try: if start_stepping: diff --git a/Pythonwin/pywin/dialogs/list.py b/Pythonwin/pywin/dialogs/list.py index b9934ce71..4e1877955 100644 --- a/Pythonwin/pywin/dialogs/list.py +++ b/Pythonwin/pywin/dialogs/list.py @@ -103,7 +103,7 @@ def FillList(self): for col in self.colHeadings: itemDetails = (commctrl.LVCFMT_LEFT, int(width / numCols), col, 0) self.itemsControl.InsertColumn(index, itemDetails) - index = index + 1 + index += 1 index = 0 for items in self.items: index = self.itemsControl.InsertItem(index + 1, str(items[0]), 0) diff --git a/Pythonwin/pywin/docking/DockingBar.py b/Pythonwin/pywin/docking/DockingBar.py index e73492ef8..55868b446 100644 --- a/Pythonwin/pywin/docking/DockingBar.py +++ b/Pythonwin/pywin/docking/DockingBar.py @@ -356,10 +356,10 @@ def OnMouseMove(self, msg): # Convert unsigned 16 bit to signed 32 bit. x = win32api.LOWORD(lparam) if x & 32768: - x = x | -65536 + x |= -65536 y = win32api.HIWORD(lparam) if y & 32768: - y = y | -65536 + y |= -65536 pt = x, y cpt = CenterPoint(self.rectTracker) pt = self.ClientToWnd(pt) @@ -388,11 +388,11 @@ def OnNcCalcSize(self, bCalcValid, size_info): dwBorderStyle = self._obj_.dwStyle | afxres.CBRS_BORDER_ANY if self.nDockBarID == afxres.AFX_IDW_DOCKBAR_TOP: - dwBorderStyle = dwBorderStyle & ~afxres.CBRS_BORDER_BOTTOM - rc0.left = rc0.left + self.cxGripper - rc0.bottom = rc0.bottom - self.cxEdge - rc0.top = rc0.top + self.cxBorder - rc0.right = rc0.right - self.cxBorder + dwBorderStyle &= ~afxres.CBRS_BORDER_BOTTOM + rc0.left += self.cxGripper + rc0.bottom -= self.cxEdge + rc0.top += self.cxBorder + rc0.right -= self.cxBorder self.rectBorder = ( self.rectBorder[0], self.rectBorder[3] - self.cxEdge, @@ -400,11 +400,11 @@ def OnNcCalcSize(self, bCalcValid, size_info): self.rectBorder[3], ) elif self.nDockBarID == afxres.AFX_IDW_DOCKBAR_BOTTOM: - dwBorderStyle = dwBorderStyle & ~afxres.CBRS_BORDER_TOP - rc0.left = rc0.left + self.cxGripper - rc0.top = rc0.top + self.cxEdge - rc0.bottom = rc0.bottom - self.cxBorder - rc0.right = rc0.right - self.cxBorder + dwBorderStyle &= ~afxres.CBRS_BORDER_TOP + rc0.left += self.cxGripper + rc0.top += self.cxEdge + rc0.bottom -= self.cxBorder + rc0.right -= self.cxBorder self.rectBorder = ( self.rectBorder[0], self.rectBorder[1], @@ -412,11 +412,11 @@ def OnNcCalcSize(self, bCalcValid, size_info): self.rectBorder[1] + self.cxEdge, ) elif self.nDockBarID == afxres.AFX_IDW_DOCKBAR_LEFT: - dwBorderStyle = dwBorderStyle & ~afxres.CBRS_BORDER_RIGHT - rc0.right = rc0.right - self.cxEdge - rc0.left = rc0.left + self.cxBorder - rc0.bottom = rc0.bottom - self.cxBorder - rc0.top = rc0.top + self.cxGripper + dwBorderStyle &= ~afxres.CBRS_BORDER_RIGHT + rc0.right -= self.cxEdge + rc0.left += self.cxBorder + rc0.bottom -= self.cxBorder + rc0.top += self.cxGripper self.rectBorder = ( self.rectBorder[2] - self.cxEdge, self.rectBorder[1], @@ -424,11 +424,11 @@ def OnNcCalcSize(self, bCalcValid, size_info): self.rectBorder[3], ) elif self.nDockBarID == afxres.AFX_IDW_DOCKBAR_RIGHT: - dwBorderStyle = dwBorderStyle & ~afxres.CBRS_BORDER_LEFT - rc0.left = rc0.left + self.cxEdge - rc0.right = rc0.right - self.cxBorder - rc0.bottom = rc0.bottom - self.cxBorder - rc0.top = rc0.top + self.cxGripper + dwBorderStyle &= ~afxres.CBRS_BORDER_LEFT + rc0.left += self.cxEdge + rc0.right -= self.cxBorder + rc0.bottom -= self.cxBorder + rc0.top += self.cxGripper self.rectBorder = ( self.rectBorder[0], self.rectBorder[1], @@ -486,7 +486,7 @@ def StartTracking(self): self.rectTracker = self.rectBorder if not self.IsHorz(): l, t, r, b = self.rectTracker - b = b - 4 + b -= 4 self.rectTracker = l, t, r, b self.OnInvertTracker(self.rectTracker) @@ -517,13 +517,13 @@ def StopTracking(self, bAccept): pt = CenterPoint(self.rectTracker) if self.nDockBarID == afxres.AFX_IDW_DOCKBAR_TOP: - newsize = newsize + (pt[1] - self.ptOld[1]) + newsize += pt[1] - self.ptOld[1] elif self.nDockBarID == afxres.AFX_IDW_DOCKBAR_BOTTOM: - newsize = newsize + (-pt[1] + self.ptOld[1]) + newsize += -pt[1] + self.ptOld[1] elif self.nDockBarID == afxres.AFX_IDW_DOCKBAR_LEFT: - newsize = newsize + (pt[0] - self.ptOld[0]) + newsize += pt[0] - self.ptOld[0] elif self.nDockBarID == afxres.AFX_IDW_DOCKBAR_RIGHT: - newsize = newsize + (-pt[0] + self.ptOld[0]) + newsize += -pt[0] + self.ptOld[0] newsize = max(minsize, min(maxsize, newsize)) if self.IsHorz(): self.sizeHorz = self.sizeHorz[0], newsize @@ -565,9 +565,9 @@ def IsHorz(self): def ClientToWnd(self, pt): x, y = pt if self.nDockBarID == afxres.AFX_IDW_DOCKBAR_BOTTOM: - y = y + self.cxEdge + y += self.cxEdge elif self.nDockBarID == afxres.AFX_IDW_DOCKBAR_RIGHT: - x = x + self.cxEdge + x += self.cxEdge return x, y def DrawGripper(self, dc): @@ -600,9 +600,9 @@ def DrawGripper(self, dc): self.rectUndock, win32con.DFC_CAPTION, win32con.DFCS_CAPTIONMAX ) - gt = gt + 38 - gb = gb - 10 - gl = gl + 10 + gt += 38 + gb -= 10 + gl += 10 gr = gl + 3 gripper = gl, gt, gr, gb dc.Draw3dRect(gripper, clrBtnHilight, clrBtnShadow) @@ -620,9 +620,9 @@ def DrawGripper(self, dc): dc.DrawFrameControl( self.rectUndock, win32con.DFC_CAPTION, win32con.DFCS_CAPTIONMAX ) - gr = gr - 38 - gl = gl + 10 - gt = gt + 10 + gr -= 38 + gl += 10 + gt += 10 gb = gt + 3 gripper = gl, gt, gr, gb diff --git a/Pythonwin/pywin/framework/app.py b/Pythonwin/pywin/framework/app.py index de63703a4..f0c4d6d3e 100644 --- a/Pythonwin/pywin/framework/app.py +++ b/Pythonwin/pywin/framework/app.py @@ -25,7 +25,7 @@ def SaveWindowSize(section, rect, state=""): (same format as CREATESTRUCT position tuples).""" left, top, right, bottom = rect if state: - state = state + " " + state += " " win32ui.WriteProfileVal(section, state + "left", left) win32ui.WriteProfileVal(section, state + "top", top) win32ui.WriteProfileVal(section, state + "right", right) @@ -35,7 +35,7 @@ def SaveWindowSize(section, rect, state=""): def LoadWindowSize(section, state=""): """Loads a section from an INI file, and returns a rect in a tuple (see SaveWindowSize)""" if state: - state = state + " " + state += " " left = win32ui.GetProfileVal(section, state + "left", 0) top = win32ui.GetProfileVal(section, state + "top", 0) right = win32ui.GetProfileVal(section, state + "right", 0) diff --git a/Pythonwin/pywin/framework/cmdline.py b/Pythonwin/pywin/framework/cmdline.py index a6b3f91cb..b4bb84685 100644 --- a/Pythonwin/pywin/framework/cmdline.py +++ b/Pythonwin/pywin/framework/cmdline.py @@ -12,13 +12,13 @@ def ParseArgs(str): while pos < length: try: while str[pos] in string.whitespace: - pos = pos + 1 + pos += 1 except IndexError: break if pos >= length: break if str[pos] == '"': - pos = pos + 1 + pos += 1 try: endPos = str.index('"', pos) - 1 nextPos = endPos + 2 @@ -28,7 +28,7 @@ def ParseArgs(str): else: endPos = pos while endPos < length and not str[endPos] in string.whitespace: - endPos = endPos + 1 + endPos += 1 nextPos = endPos + 1 ret.append(str[pos : endPos + 1].strip()) pos = nextPos diff --git a/Pythonwin/pywin/framework/editor/color/coloreditor.py b/Pythonwin/pywin/framework/editor/color/coloreditor.py index b78103c5d..ffc1cb35e 100644 --- a/Pythonwin/pywin/framework/editor/color/coloreditor.py +++ b/Pythonwin/pywin/framework/editor/color/coloreditor.py @@ -609,7 +609,7 @@ def CheckIDLEMenus(self, idle): event, ["editor"] ) if keyname is not None: - text = text + "\t" + keyname + text += "\t" + keyname submenu.AppendMenu(flags, id, text) mainMenu = self.GetSharedMenu() diff --git a/Pythonwin/pywin/framework/editor/configui.py b/Pythonwin/pywin/framework/editor/configui.py index 174cb907b..96d8e560a 100644 --- a/Pythonwin/pywin/framework/editor/configui.py +++ b/Pythonwin/pywin/framework/editor/configui.py @@ -253,7 +253,7 @@ def OnInitDialog(self): for c in paletteVGA: if tt_color == win32api.RGB(c[1], c[2], c[3]): break - sel = sel + 1 + sel += 1 else: sel = -1 self.cbo.SetCurSel(sel) diff --git a/Pythonwin/pywin/framework/editor/document.py b/Pythonwin/pywin/framework/editor/document.py index 234716bd8..a78cb3eea 100644 --- a/Pythonwin/pywin/framework/editor/document.py +++ b/Pythonwin/pywin/framework/editor/document.py @@ -245,7 +245,7 @@ def _UpdateUIForState(self): except win32ui.error: title = filename if self._IsReadOnly(): - title = title + " (read-only)" + title += " (read-only)" self.SetTitle(title) def MakeDocumentWritable(self): @@ -261,7 +261,7 @@ def MakeDocumentWritable(self): msg = "Would you like to check this file out?" defButton = win32con.MB_YESNO if self.IsModified(): - msg = msg + "\r\n\r\nALL CHANGES IN THE EDITOR WILL BE LOST" + msg += "\r\n\r\nALL CHANGES IN THE EDITOR WILL BE LOST" defButton = win32con.MB_YESNO if win32ui.MessageBox(msg, None, defButton) != win32con.IDYES: return 0 diff --git a/Pythonwin/pywin/framework/editor/editor.py b/Pythonwin/pywin/framework/editor/editor.py index 58c2b76fb..facb5b23f 100644 --- a/Pythonwin/pywin/framework/editor/editor.py +++ b/Pythonwin/pywin/framework/editor/editor.py @@ -236,7 +236,7 @@ def SetLineColor(self, lineNo, color): try: if color is None: color = self.defCharFormat[4] - lineNo = lineNo - 1 + lineNo -= 1 startIndex = self.LineIndex(lineNo) if startIndex != -1: self.SetSel(startIndex, self.LineIndex(lineNo + 1)) @@ -261,7 +261,7 @@ def Indent(self): if ch == "\t": curCol = ((curCol / self.tabSize) + 1) * self.tabSize else: - curCol = curCol + 1 + curCol += 1 nextColumn = ((curCol / self.indentSize) + 1) * self.indentSize # print("curCol is", curCol, "nextColumn is", nextColumn) ins = None @@ -274,7 +274,7 @@ def Indent(self): if check in ("\t", " "): ins = check break - lookLine = lookLine - 1 + lookLine -= 1 else: # See if the previous char can tell us check = line[realCol - 1] if check in ("\t", " "): @@ -290,7 +290,7 @@ def Indent(self): if ins == " ": # Calc the number of spaces to take us to the next stop - ins = ins * (nextColumn - curCol) + ins *= nextColumn - curCol self._obj_.ReplaceSel(ins) diff --git a/Pythonwin/pywin/framework/help.py b/Pythonwin/pywin/framework/help.py index c986acabb..a042b1865 100644 --- a/Pythonwin/pywin/framework/help.py +++ b/Pythonwin/pywin/framework/help.py @@ -97,7 +97,7 @@ def _ListAllHelpFilesInRoot(root): helpDesc = win32api.RegEnumKey(key, keyNo) helpFile = win32api.RegQueryValue(key, helpDesc) retList.append((helpDesc, helpFile)) - keyNo = keyNo + 1 + keyNo += 1 except win32api.error as exc: import winerror @@ -149,7 +149,7 @@ def SetHelpMenuOtherHelp(mainMenu): if fname not in excludeFnames: helpIDMap[cmdID] = (desc, fname) win32ui.GetMainFrame().HookCommand(HandleHelpOtherCommand, cmdID) - cmdID = cmdID + 1 + cmdID += 1 helpMenu = mainMenu.GetSubMenu( mainMenu.GetMenuItemCount() - 1 diff --git a/Pythonwin/pywin/framework/interact.py b/Pythonwin/pywin/framework/interact.py index c4021ebf7..d93934e0e 100644 --- a/Pythonwin/pywin/framework/interact.py +++ b/Pythonwin/pywin/framework/interact.py @@ -211,7 +211,7 @@ def ColorizeInteractiveCode(self, cdoc, styleStart, stylePyStart): # and ask the Python colorizer to color that. end = startSeg while end < lengthDoc and cdoc[end] not in b"\r\n": - end = end + 1 + end += 1 self.ColorizePythonCode(cdoc[:end], startSeg, state) stylePyStart = self.GetStringStyle(end - 1) if stylePyStart is None: @@ -224,7 +224,7 @@ def ColorizeInteractiveCode(self, cdoc, styleStart, stylePyStart): state = STYLE_INTERACTIVE_EOL if lastState != state: lastState = state - i = i + 1 + i += 1 # and the rest if startSeg < i: self.ColorSeg(startSeg, i - 1, state) @@ -243,7 +243,7 @@ def Colorize(self, start=0, end=-1): # If TQString, we continue it. Otherwise, we reset. look = start - 1 while look and self.scintilla.SCIGetCharAt(look) in "\n\r": - look = look - 1 + look -= 1 if look and look < start - 1: # Did we find a char before the \n\r sets? strstyle = self.GetStringStyle(look) quote_char = None @@ -454,12 +454,12 @@ def GetBlockBoundary(self, lineNo): while startLineNo > 0: if GetPromptPrefix(self.DoGetLine(startLineNo - 1)) is not None: break # there _is_ a prompt - startLineNo = startLineNo - 1 + startLineNo -= 1 endLineNo = lineNo while endLineNo < maxLineNo: if GetPromptPrefix(self.DoGetLine(endLineNo + 1)) is not None: break # there _is_ a prompt - endLineNo = endLineNo + 1 + endLineNo += 1 else: # Code block flag = 1 startLineNo = lineNo @@ -468,7 +468,7 @@ def GetBlockBoundary(self, lineNo): if prefix is None: break # there is no prompt. - startLineNo = startLineNo - 1 + startLineNo -= 1 endLineNo = lineNo while endLineNo < maxLineNo: prefix = GetPromptPrefix(self.DoGetLine(endLineNo + 1)) @@ -476,7 +476,7 @@ def GetBlockBoundary(self, lineNo): break # there is no prompt if prefix == str(sys.ps1): break # this is another command - endLineNo = endLineNo + 1 + endLineNo += 1 # continue until end of buffer, or no prompt return (startLineNo, endLineNo, flag) @@ -487,7 +487,7 @@ def ExtractCommand(self, lines): thisLine = self.DoGetLine(end) promptLen = len(GetPromptPrefix(thisLine)) retList = [thisLine[promptLen:]] + retList - end = end - 1 + end -= 1 return retList def OutputGrab(self): @@ -584,10 +584,10 @@ def ProcessEnterEvent(self, event): pos = 0 indent = "" while len(curLine) > pos and curLine[pos] in string.whitespace: - indent = indent + curLine[pos] - pos = pos + 1 + indent += curLine[pos] + pos += 1 if _is_block_opener(curLine): - indent = indent + "\t" + indent += "\t" elif _is_block_closer(curLine): indent = indent[:-1] # use ReplaceSel to ensure it goes at the cursor rather than end of buffer. diff --git a/Pythonwin/pywin/framework/intpyapp.py b/Pythonwin/pywin/framework/intpyapp.py index 3f0133be6..acbd34cc1 100644 --- a/Pythonwin/pywin/framework/intpyapp.py +++ b/Pythonwin/pywin/framework/intpyapp.py @@ -489,7 +489,7 @@ def OnViewOptions(self, id, code): except AttributeError: # Template does not provide property pages! continue - pages = pages + getter() + pages.extend(getter()) # Debugger template goes at the end try: diff --git a/Pythonwin/pywin/framework/mdi_pychecker.py b/Pythonwin/pywin/framework/mdi_pychecker.py index 2acb2f8ea..03e5e220f 100644 --- a/Pythonwin/pywin/framework/mdi_pychecker.py +++ b/Pythonwin/pywin/framework/mdi_pychecker.py @@ -54,7 +54,7 @@ def getsubdirs(d): for f in flist: if os.path.isdir(f): dlist.append(f) - dlist = dlist + getsubdirs(f) + dlist.extend(getsubdirs(f)) return dlist @@ -234,9 +234,9 @@ def setInitParams(self, paramstr): paramstr = win32ui.GetProfileVal("Pychecker", "Params", "\t\t\t1\t0\t0") params = paramstr.split("\t") if len(params) < 3: - params = params + [""] * (3 - len(params)) + params.extend([""] * (3 - len(params))) if len(params) < 6: - params = params + [0] * (6 - len(params)) + params.extend([0] * (6 - len(params))) self.dirpattern = params[0] self.filpattern = params[1] self.greppattern = params[2] or "-#1000 --only" @@ -381,7 +381,7 @@ def threadPycheckerRun(self): self.SetModifiedFlag(0) def _inactive_idleHandler(self, handler, count): - self.fndx = self.fndx + 1 + self.fndx += 1 if self.fndx < len(self.flist): f = self.flist[self.fndx] if self.verbose: @@ -394,14 +394,14 @@ def _inactive_idleHandler(self, handler, count): self.GetFirstView().Append(f + "(" + repr(i + 1) + ") " + line) else: self.fndx = -1 - self.fpndx = self.fpndx + 1 + self.fpndx += 1 if self.fpndx < len(self.fplist): self.flist = glob.glob( self.dp[self.dpndx] + "\\" + self.fplist[self.fpndx] ) else: self.fpndx = 0 - self.dpndx = self.dpndx + 1 + self.dpndx += 1 if self.dpndx < len(self.dp): self.flist = glob.glob( self.dp[self.dpndx] + "\\" + self.fplist[self.fpndx] @@ -712,10 +712,10 @@ def getMore(self, section, key): i = 0 newitems = dlg.getNew() if newitems: - items = items + newitems + items.extend(newitems) for item in items: win32api.WriteProfileVal(section, repr(i), item, ini) - i = i + 1 + i += 1 self.UpdateData(0) def OnOK(self): diff --git a/Pythonwin/pywin/framework/scriptutils.py b/Pythonwin/pywin/framework/scriptutils.py index 9813cc364..98c34b477 100644 --- a/Pythonwin/pywin/framework/scriptutils.py +++ b/Pythonwin/pywin/framework/scriptutils.py @@ -282,7 +282,7 @@ def RunScript(defName=None, defArgs=None, bShowDialog=1, debuggingType=None): if ( len(os.path.splitext(script)[1]) == 0 ): # check if no extension supplied, and give one. - script = script + ".py" + script += ".py" # If no path specified, try and locate the file path, fnameonly = os.path.split(script) if len(path) == 0: @@ -677,7 +677,7 @@ def LocatePythonFile(fileName, bBrowseIfDir=1): else: return None else: - fileName = fileName + ".py" + fileName += ".py" if os.path.isfile(fileName): break # Found it! diff --git a/Pythonwin/pywin/framework/sgrepmdi.py b/Pythonwin/pywin/framework/sgrepmdi.py index f75dbfa0a..539fe6d12 100644 --- a/Pythonwin/pywin/framework/sgrepmdi.py +++ b/Pythonwin/pywin/framework/sgrepmdi.py @@ -36,7 +36,7 @@ def getsubdirs(d): for f in flist: if os.path.isdir(f): dlist.append(f) - dlist = dlist + getsubdirs(f) + dlist += getsubdirs(f) return dlist @@ -218,9 +218,9 @@ def setInitParams(self, paramstr): paramstr = win32ui.GetProfileVal("Grep", "Params", "\t\t\t1\t0\t0") params = paramstr.split("\t") if len(params) < 3: - params = params + [""] * (3 - len(params)) + params.extend([""] * (3 - len(params))) if len(params) < 6: - params = params + [0] * (6 - len(params)) + params.extend([0] * (6 - len(params))) self.dirpattern = params[0] self.filpattern = params[1] self.greppattern = params[2] @@ -290,7 +290,7 @@ def doSearch(self): win32ui.GetApp().AddIdleHandler(self.SearchFile) def SearchFile(self, handler, count): - self.fndx = self.fndx + 1 + self.fndx += 1 if self.fndx < len(self.flist): f = self.flist[self.fndx] if self.verbose: @@ -306,14 +306,14 @@ def SearchFile(self, handler, count): self.GetFirstView().Append(f + "(" + repr(i + 1) + ") " + line) else: self.fndx = -1 - self.fpndx = self.fpndx + 1 + self.fpndx += 1 if self.fpndx < len(self.fplist): self.flist = glob.glob( self.dp[self.dpndx] + "\\" + self.fplist[self.fpndx] ) else: self.fpndx = 0 - self.dpndx = self.dpndx + 1 + self.dpndx += 1 if self.dpndx < len(self.dp): self.flist = glob.glob( self.dp[self.dpndx] + "\\" + self.fplist[self.fpndx] @@ -624,10 +624,10 @@ def getMore(self, section, key): i = 0 newitems = dlg.getNew() if newitems: - items = items + newitems + items.extend(newitems) for item in items: win32api.WriteProfileVal(section, repr(i), item, ini) - i = i + 1 + i += 1 self.UpdateData(0) def OnOK(self): diff --git a/Pythonwin/pywin/framework/stdin.py b/Pythonwin/pywin/framework/stdin.py index 91fe7ef3e..5fe7bffc3 100644 --- a/Pythonwin/pywin/framework/stdin.py +++ b/Pythonwin/pywin/framework/stdin.py @@ -119,7 +119,7 @@ def readlines(self, *sizehint): line = self.readline() if line == "": break - total_read = total_read + len(line) + total_read += len(line) result.append(line) return result diff --git a/Pythonwin/pywin/framework/toolmenu.py b/Pythonwin/pywin/framework/toolmenu.py index 6b2076dcd..d1b7e80bb 100644 --- a/Pythonwin/pywin/framework/toolmenu.py +++ b/Pythonwin/pywin/framework/toolmenu.py @@ -41,7 +41,7 @@ def LoadToolMenuItems(): break cmd = win32ui.GetProfileVal("Tools Menu\\%s" % lookNo, "Command", "") items.append((menu, cmd)) - lookNo = lookNo + 1 + lookNo += 1 if len(items) == 0: items = defaultToolMenuItems @@ -71,7 +71,7 @@ def WriteToolMenuItems(items): for menu, cmd in items: win32ui.WriteProfileVal("Tools Menu\\%s" % itemNo, "", menu) win32ui.WriteProfileVal("Tools Menu\\%s" % itemNo, "Command", cmd) - itemNo = itemNo + 1 + itemNo += 1 def SetToolsMenu(menu, menuPos=None): @@ -90,7 +90,7 @@ def SetToolsMenu(menu, menuPos=None): win32con.MF_ENABLED | win32con.MF_STRING, idPos, menuString ) win32ui.GetMainFrame().HookCommand(HandleToolCommand, idPos) - idPos = idPos + 1 + idPos += 1 # Find the correct spot to insert the new tools menu. if menuPos is None: @@ -191,7 +191,7 @@ def OnInitDialog(self): for desc, cmd in LoadToolMenuItems(): lc.InsertItem(itemNo, desc) lc.SetItemText(itemNo, 1, cmd) - itemNo = itemNo + 1 + itemNo += 1 self.listControl = lc return dialog.PropertyPage.OnInitDialog(self) @@ -209,7 +209,7 @@ def OnOK(self): except win32ui.error: # no more items! break - itemLook = itemLook + 1 + itemLook += 1 WriteToolMenuItems(items) return self._obj_.OnOK() diff --git a/Pythonwin/pywin/framework/winout.py b/Pythonwin/pywin/framework/winout.py index 91c7d4fde..c98c98ff8 100644 --- a/Pythonwin/pywin/framework/winout.py +++ b/Pythonwin/pywin/framework/winout.py @@ -463,7 +463,7 @@ def QueueIdleHandler(self, handler, count): except KeyboardInterrupt: # First interrupt since idle we just pass on. # later ones we dump the queue and give up. - self.interruptCount = self.interruptCount + 1 + self.interruptCount += 1 if self.interruptCount > 1: # Drop the queue quickly as the user is already annoyed :-) self.outputQueue = queue.Queue(-1) @@ -511,7 +511,7 @@ def QueueFlush(self, max=None): rc = 1 break if max is not None: - max = max - 1 + max -= 1 if len(items) != 0: if not self.CheckRecreateWindow(): debug(":Recreate failed!\n") diff --git a/Pythonwin/pywin/idle/AutoExpand.py b/Pythonwin/pywin/idle/AutoExpand.py index 3b302ee93..37fb81152 100644 --- a/Pythonwin/pywin/idle/AutoExpand.py +++ b/Pythonwin/pywin/idle/AutoExpand.py @@ -91,5 +91,5 @@ def getprevword(self): line = self.text.get("insert linestart", "insert") i = len(line) while i > 0 and line[i - 1] in self.wordchars: - i = i - 1 + i -= 1 return line[i:] diff --git a/Pythonwin/pywin/idle/AutoIndent.py b/Pythonwin/pywin/idle/AutoIndent.py index c21fa2622..e433097e9 100644 --- a/Pythonwin/pywin/idle/AutoIndent.py +++ b/Pythonwin/pywin/idle/AutoIndent.py @@ -148,7 +148,7 @@ def smart_backspace_event(self, event): ncharsdeleted = 0 while 1: chars = chars[:-1] - ncharsdeleted = ncharsdeleted + 1 + ncharsdeleted += 1 have = len(chars.expandtabs(self.tabwidth)) if have <= want or chars[-1] not in " \t": break @@ -203,7 +203,7 @@ def newline_and_indent_event(self, event): line = text.get("insert linestart", "insert") i, n = 0, len(line) while i < n and line[i] in " \t": - i = i + 1 + i += 1 if i == n: # the cursor is in or at leading indentation; just inject # an empty line at the start and strip space from current line @@ -215,7 +215,7 @@ def newline_and_indent_event(self, event): i = 0 while line and line[-1] in " \t": line = line[:-1] - i = i + 1 + i += 1 if i: text.delete("insert - %d chars" % i, "insert") # strip whitespace after insert point @@ -298,7 +298,7 @@ def indent_region_event(self, event): line = lines[pos] if line: raw, effective = classifyws(line, self.tabwidth) - effective = effective + self.indentwidth + effective += self.indentwidth lines[pos] = self._make_blanks(effective) + line[raw:] self.set_region(head, tail, chars, lines) return "break" @@ -473,10 +473,10 @@ def classifyws(s, tabwidth): raw = effective = 0 for ch in s: if ch == " ": - raw = raw + 1 - effective = effective + 1 + raw += 1 + effective += 1 elif ch == "\t": - raw = raw + 1 + raw += 1 effective = (effective // tabwidth + 1) * tabwidth else: break diff --git a/Pythonwin/pywin/idle/CallTips.py b/Pythonwin/pywin/idle/CallTips.py index 810d8c881..c15847955 100644 --- a/Pythonwin/pywin/idle/CallTips.py +++ b/Pythonwin/pywin/idle/CallTips.py @@ -88,7 +88,7 @@ def get_object_at_cursor( chars = text.get("insert linestart", "insert") i = len(chars) while i and chars[i - 1] in wordchars: - i = i - 1 + i -= 1 word = chars[i:] if word: # How is this for a hack! @@ -147,8 +147,8 @@ def get_arg_text(ob): if pos < 0 or pos > 70: pos = 70 if argText: - argText = argText + "\n" - argText = argText + doc[:pos] + argText += "\n" + argText += doc[:pos] return argText diff --git a/Pythonwin/pywin/idle/FormatParagraph.py b/Pythonwin/pywin/idle/FormatParagraph.py index 1a0e14560..caecb0f1f 100644 --- a/Pythonwin/pywin/idle/FormatParagraph.py +++ b/Pythonwin/pywin/idle/FormatParagraph.py @@ -91,7 +91,7 @@ def find_paragraph(text, mark): lineno, col = list(map(int, mark.split("."))) line = text.get("%d.0" % lineno, "%d.0 lineend" % lineno) while text.compare("%d.0" % lineno, "<", "end") and is_all_white(line): - lineno = lineno + 1 + lineno += 1 line = text.get("%d.0" % lineno, "%d.0 lineend" % lineno) first_lineno = lineno comment_header = get_comment_header(line) @@ -99,7 +99,7 @@ def find_paragraph(text, mark): while get_comment_header(line) == comment_header and not is_all_white( line[comment_header_len:] ): - lineno = lineno + 1 + lineno += 1 line = text.get("%d.0" % lineno, "%d.0 lineend" % lineno) last = "%d.0" % lineno # Search back to beginning of paragraph @@ -110,7 +110,7 @@ def find_paragraph(text, mark): and get_comment_header(line) == comment_header and not is_all_white(line[comment_header_len:]) ): - lineno = lineno - 1 + lineno -= 1 line = text.get("%d.0" % lineno, "%d.0 lineend" % lineno) first = "%d.0" % (lineno + 1) return first, last, comment_header, text.get(first, last) @@ -121,7 +121,7 @@ def reformat_paragraph(data, limit=70): i = 0 n = len(lines) while i < n and is_all_white(lines[i]): - i = i + 1 + i += 1 if i >= n: return data indent1 = get_indent(lines[i]) @@ -141,10 +141,10 @@ def reformat_paragraph(data, limit=70): if len((partial + word).expandtabs()) > limit and partial != indent1: new.append(partial.rstrip()) partial = indent2 - partial = partial + word + " " + partial += word + " " if j + 1 < len(words) and words[j + 1] != " ": - partial = partial + " " - i = i + 1 + partial += " " + i += 1 new.append(partial.rstrip()) # XXX Should reformat remaining paragraphs as well new.extend(lines[i:]) diff --git a/Pythonwin/pywin/idle/IdleHistory.py b/Pythonwin/pywin/idle/IdleHistory.py index 24e692400..11b5158f0 100644 --- a/Pythonwin/pywin/idle/IdleHistory.py +++ b/Pythonwin/pywin/idle/IdleHistory.py @@ -45,9 +45,9 @@ def history_do(self, reverse): nprefix = len(prefix) while 1: if reverse: - pointer = pointer - 1 + pointer -= 1 else: - pointer = pointer + 1 + pointer += 1 if pointer < 0 or pointer >= nhist: self.text.bell() if self._get_source("iomark", "end-1c") != prefix: diff --git a/Pythonwin/pywin/idle/PyParse.py b/Pythonwin/pywin/idle/PyParse.py index 8a994254e..f817fb1ce 100644 --- a/Pythonwin/pywin/idle/PyParse.py +++ b/Pythonwin/pywin/idle/PyParse.py @@ -252,26 +252,26 @@ def _study1(self): i, n = 0, len(str) while i < n: ch = str[i] - i = i + 1 + i += 1 # cases are checked in decreasing order of frequency if ch == "x": continue if ch == "\n": - lno = lno + 1 + lno += 1 if level == 0: push_good(lno) # else we're in an unclosed bracket structure continue if ch == "(": - level = level + 1 + level += 1 continue if ch == ")": if level: - level = level - 1 + level -= 1 # else the program is invalid, but we can't complain continue @@ -279,22 +279,22 @@ def _study1(self): # consume the string quote = ch if str[i - 1 : i + 2] == quote * 3: - quote = quote * 3 + quote *= 3 w = len(quote) - 1 - i = i + w + i += w while i < n: ch = str[i] - i = i + 1 + i += 1 if ch == "x": continue if str[i - 1 : i + w] == quote: - i = i + w + i += w break if ch == "\n": - lno = lno + 1 + lno += 1 if w == 0: # unterminated single-quoted string if level == 0: @@ -305,8 +305,8 @@ def _study1(self): if ch == "\\": assert i < n if str[i] == "\n": - lno = lno + 1 - i = i + 1 + lno += 1 + i += 1 continue # else comment char or paren inside string @@ -326,10 +326,10 @@ def _study1(self): assert ch == "\\" assert i < n if str[i] == "\n": - lno = lno + 1 + lno += 1 if i + 1 == n: continuation = C_BACKSLASH - i = i + 1 + i += 1 # The last stmt may be continued for all 3 reasons. # String continuation takes precedence over bracket @@ -381,7 +381,7 @@ def _study2(self): # The stmt str[p:q] isn't a continuation, but may be blank # or a non-indenting comment line. if _junkre(str, p): - i = i - 1 + i -= 1 else: break if i == 0: @@ -404,7 +404,7 @@ def _study2(self): # back up over totally boring whitespace i = newp - 1 # index of last boring char while i >= p and str[i] in " \t\n": - i = i - 1 + i -= 1 if i >= p: lastch = str[i] p = newp @@ -416,14 +416,14 @@ def _study2(self): if ch in "([{": push_stack(p) lastch = ch - p = p + 1 + p += 1 continue if ch in ")]}": if stack: del stack[-1] lastch = ch - p = p + 1 + p += 1 continue if ch == '"' or ch == "'": @@ -445,12 +445,12 @@ def _study2(self): continue assert ch == "\\" - p = p + 1 # beyond backslash + p += 1 # beyond backslash assert p < q if str[p] != "\n": # the program is invalid, but can't complain lastch = ch + str[p] - p = p + 1 # beyond escaped char + p += 1 # beyond escaped char # end while p < q: @@ -468,7 +468,7 @@ def compute_bracket_indent(self): str = self.str n = len(str) origi = i = str.rfind("\n", 0, j) + 1 - j = j + 1 # one beyond open bracket + j += 1 # one beyond open bracket # find first list item; set i to start of its line while j < n: m = _itemre(str, j) @@ -484,7 +484,7 @@ def compute_bracket_indent(self): # reproduce the bracket line's indentation + a level j = i = origi while str[j] in " \t": - j = j + 1 + j += 1 extra = self.indentwidth return len(str[i:j].expandtabs(self.tabwidth)) + extra @@ -507,7 +507,7 @@ def compute_backslash_indent(self): str = self.str i = self.stmt_start while str[i] in " \t": - i = i + 1 + i += 1 startpos = i # See whether the initial line starts an assignment stmt; i.e., @@ -517,12 +517,12 @@ def compute_backslash_indent(self): while i < endpos: ch = str[i] if ch in "([{": - level = level + 1 - i = i + 1 + level += 1 + i += 1 elif ch in ")]}": if level: - level = level - 1 - i = i + 1 + level -= 1 + i += 1 elif ch == '"' or ch == "'": i = _match_stringre(str, i, endpos).end() elif ch == "#": @@ -536,12 +536,12 @@ def compute_backslash_indent(self): found = 1 break else: - i = i + 1 + i += 1 if found: # found a legit =, but it may be the last interesting # thing on the line - i = i + 1 # move beyond the = + i += 1 # move beyond the = found = re.match(r"\s*\\", str[i:endpos]) is None if not found: @@ -549,7 +549,7 @@ def compute_backslash_indent(self): # of non-whitespace chars i = startpos while str[i] not in " \t\n": - i = i + 1 + i += 1 return len(str[self.stmt_start : i].expandtabs(self.tabwidth)) + 1 @@ -562,7 +562,7 @@ def get_base_indent_string(self): j = i str = self.str while j < n and str[j] in " \t": - j = j + 1 + j += 1 return str[i:j] # Did the last interesting stmt open a block? diff --git a/Pythonwin/pywin/scintilla/IDLEenvironment.py b/Pythonwin/pywin/scintilla/IDLEenvironment.py index 8e0fa20ea..773abdc13 100644 --- a/Pythonwin/pywin/scintilla/IDLEenvironment.py +++ b/Pythonwin/pywin/scintilla/IDLEenvironment.py @@ -208,19 +208,19 @@ def _NextTok(str, pos): if pos >= end: return None, 0 while pos < end and str[pos] in string.whitespace: - pos = pos + 1 + pos += 1 # Special case for +- if str[pos] in "+-": return str[pos], pos + 1 # Digits also a special case. endPos = pos while endPos < end and str[endPos] in string.digits + ".": - endPos = endPos + 1 + endPos += 1 if pos != endPos: return str[pos:endPos], endPos endPos = pos while endPos < end and str[endPos] not in string.whitespace + string.digits + "+-": - endPos = endPos + 1 + endPos += 1 if pos != endPos: return str[pos:endPos], endPos return None, 0 @@ -253,7 +253,7 @@ def TkIndexToOffset(bm, edit, marks): pos = edit.LineIndex(line) if pos == -1: pos = edit.GetTextLength() - pos = pos + int(col) + pos += int(col) except (ValueError, IndexError): raise ValueError("Unexpected literal in '%s'" % base) elif base == "insert": @@ -262,7 +262,7 @@ def TkIndexToOffset(bm, edit, marks): pos = edit.GetTextLength() # Pretend there is a trailing '\n' if necessary if pos and edit.SCIGetCharAt(pos - 1) != "\n": - pos = pos + 1 + pos += 1 else: try: pos = marks[base] @@ -283,23 +283,23 @@ def TkIndexToOffset(bm, edit, marks): if what[0] != "c": raise ValueError("+/- only supports chars") if word == "+": - pos = pos + int(num) + pos += int(num) else: - pos = pos - int(num) + pos -= int(num) elif word == "wordstart": while pos > 0 and edit.SCIGetCharAt(pos - 1) in wordchars: - pos = pos - 1 + pos -= 1 elif word == "wordend": end = edit.GetTextLength() while pos < end and edit.SCIGetCharAt(pos) in wordchars: - pos = pos + 1 + pos += 1 elif word == "linestart": while pos > 0 and edit.SCIGetCharAt(pos - 1) not in "\n\r": - pos = pos - 1 + pos -= 1 elif word == "lineend": end = edit.GetTextLength() while pos < end and edit.SCIGetCharAt(pos) not in "\n\r": - pos = pos + 1 + pos += 1 else: raise ValueError("Unsupported relative offset '%s'" % word) return max(pos, 0) # Tkinter is tollerant of -ve indexes - we aren't @@ -351,13 +351,13 @@ def _fix_indexes(self, start, end): and self.edit.SCIGetCharAt(start) == "\n" and self.edit.SCIGetCharAt(start - 1) == "\r" ): - start = start - 1 + start -= 1 if ( end < self.edit.GetTextLength() and self.edit.SCIGetCharAt(end - 1) == "\r" and self.edit.SCIGetCharAt(end) == "\n" ): - end = end + 1 + end += 1 return start, end ## def get_tab_width(self): @@ -397,7 +397,7 @@ def get(self, start, end=None): ret = self.edit.GetTextRange(start, end) # pretend a trailing '\n' exists if necessary. if checkEnd and (not ret or ret[-1] != "\n"): - ret = ret + "\n" + ret += "\n" return ret.replace("\r", "") def index(self, spec): @@ -447,7 +447,7 @@ def delete(self, start, end=None): if old >= start and old < end: old = start elif old >= end: - old = old - (end - start) + old -= end - start self.edit.SetSel(old) def bell(self): diff --git a/Pythonwin/pywin/scintilla/bindings.py b/Pythonwin/pywin/scintilla/bindings.py index 16ed461a8..60001c749 100644 --- a/Pythonwin/pywin/scintilla/bindings.py +++ b/Pythonwin/pywin/scintilla/bindings.py @@ -25,7 +25,7 @@ def assign_command_id(event, id=0): id = event_to_commands.get(event, 0) if id == 0: id = next_id - next_id = next_id + 1 + next_id += 1 # Only map the ones we allocated - specified ones are assumed to have a handler command_to_events[id] = event event_to_commands[event] = id @@ -164,13 +164,11 @@ def fire_key_event(self, msg): key = msg[2] keyState = 0 if win32api.GetKeyState(win32con.VK_CONTROL) & 0x8000: - keyState = ( - keyState | win32con.RIGHT_CTRL_PRESSED | win32con.LEFT_CTRL_PRESSED - ) + keyState |= win32con.RIGHT_CTRL_PRESSED | win32con.LEFT_CTRL_PRESSED if win32api.GetKeyState(win32con.VK_SHIFT) & 0x8000: - keyState = keyState | win32con.SHIFT_PRESSED + keyState |= win32con.SHIFT_PRESSED if win32api.GetKeyState(win32con.VK_MENU) & 0x8000: - keyState = keyState | win32con.LEFT_ALT_PRESSED | win32con.RIGHT_ALT_PRESSED + keyState |= win32con.LEFT_ALT_PRESSED | win32con.RIGHT_ALT_PRESSED keyinfo = key, keyState # Special hacks for the dead-char key on non-US keyboards. # (XXX - which do not work :-( diff --git a/Pythonwin/pywin/scintilla/config.py b/Pythonwin/pywin/scintilla/config.py index 8113a0a89..6f5a6396f 100644 --- a/Pythonwin/pywin/scintilla/config.py +++ b/Pythonwin/pywin/scintilla/config.py @@ -133,7 +133,7 @@ def __init__(self, f): line = fp.readline() if not line: break - lineno = lineno + 1 + lineno += 1 section, subsection = get_section_header(line) if not line: break @@ -151,7 +151,7 @@ def __init__(self, f): f"Unrecognised section header '{section}:{subsection}'" ) line = fp.readline() - lineno = lineno + 1 + lineno += 1 if b_close: fp.close() # Check critical data. @@ -201,7 +201,7 @@ def configure(self, editor, subsections=None): for name, func in list(ns.items()): if isinstance(func, types.FunctionType) and name[:1] != "_": bindings.bind(name, func) - num = num + 1 + num += 1 trace("Configuration Extension code loaded", num, "events") # Load the idle extensions for subsection in subsections: @@ -218,7 +218,7 @@ def configure(self, editor, subsections=None): for subsection in subsections: keymap = subsection_keymap.get(subsection, {}) bindings.update_keymap(keymap) - num_bound = num_bound + len(keymap) + num_bound += len(keymap) trace("Configuration bound", num_bound, "keys") def get_key_binding(self, event, subsections=None): @@ -250,7 +250,7 @@ def report_warning(self, msg): def _readline(self, fp, lineno, bStripComments=1): line = fp.readline() - lineno = lineno + 1 + lineno += 1 if line: bBreak = ( get_section_header(line)[0] is not None diff --git a/Pythonwin/pywin/scintilla/configui.py b/Pythonwin/pywin/scintilla/configui.py index 2a47a0e0d..9da2fbf75 100644 --- a/Pythonwin/pywin/scintilla/configui.py +++ b/Pythonwin/pywin/scintilla/configui.py @@ -230,7 +230,7 @@ def UpdateUIForStyle(self, style): if format[4] == c[1]: # print("Style", style.name, "is", c[0]) break - sel = sel + 1 + sel += 1 else: sel = -1 self.cbo.SetCurSel(sel) diff --git a/Pythonwin/pywin/scintilla/document.py b/Pythonwin/pywin/scintilla/document.py index 6cc367804..fca20f060 100644 --- a/Pythonwin/pywin/scintilla/document.py +++ b/Pythonwin/pywin/scintilla/document.py @@ -240,7 +240,7 @@ def MarkerAdd(self, lineNo, marker): def MarkerCheck(self, lineNo, marker): v = self.GetEditorView() - lineNo = lineNo - 1 # Make 0 based + lineNo -= 1 # Make 0 based markerState = v.SCIMarkerGet(lineNo) return markerState & (1 << marker) != 0 diff --git a/Pythonwin/pywin/scintilla/find.py b/Pythonwin/pywin/scintilla/find.py index 612661ad3..796fd291c 100644 --- a/Pythonwin/pywin/scintilla/find.py +++ b/Pythonwin/pywin/scintilla/find.py @@ -84,9 +84,9 @@ def _FindIt(control, searchParams): # Move to the next char, so we find the next one. flags = 0 if searchParams.matchWords: - flags = flags | win32con.FR_WHOLEWORD + flags |= win32con.FR_WHOLEWORD if searchParams.matchCase: - flags = flags | win32con.FR_MATCHCASE + flags |= win32con.FR_MATCHCASE if searchParams.sel == (-1, -1): sel = control.GetSel() # If the position is the same as we found last time, @@ -500,7 +500,7 @@ def OnReplaceAll(self, id, code): num = 1 lastSearch.replaceText = self.editReplaceText.GetWindowText() while _ReplaceIt(control) == FOUND_NORMAL: - num = num + 1 + num += 1 win32ui.SetStatusText("Replaced %d occurrences" % num) if num > 0 and not self.butKeepDialogOpen.GetCheck(): diff --git a/Pythonwin/pywin/scintilla/formatter.py b/Pythonwin/pywin/scintilla/formatter.py index b91b93b87..6e3459dcc 100644 --- a/Pythonwin/pywin/scintilla/formatter.py +++ b/Pythonwin/pywin/scintilla/formatter.py @@ -265,18 +265,18 @@ def OnStyleNeeded(self, std, extra): self.Colorize(endStyled, notify.position) def ColorSeg(self, start, end, styleName): - end = end + 1 + end += 1 # assert end-start>=0, "Can't have negative styling" stylenum = self.styles[styleName].stylenum while start < end: self.style_buffer[start] = stylenum - start = start + 1 + start += 1 # self.scintilla.SCISetStyling(end - start + 1, stylenum) def RegisterStyle(self, style, stylenum=None): if stylenum is None: stylenum = self.nextstylenum - self.nextstylenum = self.nextstylenum + 1 + self.nextstylenum += 1 FormatterBase.RegisterStyle(self, style, stylenum) def ColorizeString(self, str, styleStart): @@ -519,7 +519,7 @@ def ColorizePythonCode(self, cdoc, charStart, styleStart): startSeg = i state = STYLE_COMMENT if chNext == '"' and chNext2 == '"': - i = i + 2 + i += 2 state = STYLE_TQDSTRING ch = " " chPrev = " " @@ -533,7 +533,7 @@ def ColorizePythonCode(self, cdoc, charStart, styleStart): startSeg = i state = STYLE_COMMENT if chNext == "'" and chNext2 == "'": - i = i + 2 + i += 2 state = STYLE_TQSSTRING ch = " " chPrev = " " @@ -558,7 +558,7 @@ def ColorizePythonCode(self, cdoc, charStart, styleStart): state = STYLE_COMMENT elif ch == '"': if chNext == '"' and chNext2 == '"': - i = i + 2 + i += 2 state = STYLE_TQDSTRING ch = " " chPrev = " " @@ -569,7 +569,7 @@ def ColorizePythonCode(self, cdoc, charStart, styleStart): state = STYLE_STRING elif ch == "'": if chNext == "'" and chNext2 == "'": - i = i + 2 + i += 2 state = STYLE_TQSSTRING ch = " " chPrev = " " @@ -589,7 +589,7 @@ def ColorizePythonCode(self, cdoc, charStart, styleStart): elif state == STYLE_STRING: if ch == "\\": if chNext == '"' or chNext == "'" or chNext == "\\": - i = i + 1 + i += 1 ch = chNext chNext = " " if i + 1 < lengthDoc: @@ -601,7 +601,7 @@ def ColorizePythonCode(self, cdoc, charStart, styleStart): elif state == STYLE_SQSTRING: if ch == "\\": if chNext == '"' or chNext == "'" or chNext == "\\": - i = i + 1 + i += 1 ch = chNext chNext = " " if i + 1 < lengthDoc: @@ -628,7 +628,7 @@ def ColorizePythonCode(self, cdoc, charStart, styleStart): chPrev3 = chPrev2 chPrev2 = chPrev chPrev = ch - i = i + 1 + i += 1 if startSeg < lengthDoc: if state == STYLE_KEYWORD: self.ClassifyWord(cdoc, startSeg, lengthDoc - 1, prevWord) @@ -668,7 +668,7 @@ def RegisterStyle(self, style, stylenum=None): assert style.stylenum is None, "Style has already been registered" if stylenum is None: stylenum = self.nextstylenum - self.nextstylenum = self.nextstylenum + 1 + self.nextstylenum += 1 assert self.styles.get(stylenum) is None, "We are reusing a style number!" style.stylenum = stylenum self.styles[style.name] = style diff --git a/Pythonwin/pywin/scintilla/keycodes.py b/Pythonwin/pywin/scintilla/keycodes.py index fa896991a..d94ccda47 100644 --- a/Pythonwin/pywin/scintilla/keycodes.py +++ b/Pythonwin/pywin/scintilla/keycodes.py @@ -70,7 +70,7 @@ def get_vk(chardesc): def parse_key_name(name): - name = name + "-" # Add a sentinal + name += "-" # Add a sentinal start = pos = 0 max = len(name) toks = [] @@ -121,7 +121,7 @@ def make_key_name(vk, flags): for name, checkflag in moddata: if flags & checkflag: parts.append(name) - flags_done = flags_done & checkflag + flags_done &= checkflag break if flags_done & flags: parts.append(hex(flags & ~flags_done)) diff --git a/Pythonwin/pywin/scintilla/view.py b/Pythonwin/pywin/scintilla/view.py index b6d971e94..e94148750 100644 --- a/Pythonwin/pywin/scintilla/view.py +++ b/Pythonwin/pywin/scintilla/view.py @@ -130,7 +130,7 @@ def _get_class_attributes(ob): # Recurse into base classes looking for attributes items = [] try: - items = items + dir(ob) + items.extend(dir(ob)) for i in ob.__bases__: for item in _get_class_attributes(i): if item not in items: @@ -295,7 +295,7 @@ def OnDestroy(self, msg): def OnMouseWheel(self, msg): zDelta = msg[2] >> 16 vpos = self.GetScrollPos(win32con.SB_VERT) - vpos = vpos - zDelta / 40 # 3 lines per notch + vpos -= zDelta / 40 # 3 lines per notch self.SetScrollPos(win32con.SB_VERT, vpos) self.SendScintilla( win32con.WM_VSCROLL, (vpos << 16) | win32con.SB_THUMBPOSITION, 0 @@ -322,7 +322,7 @@ def EnsureCharsVisible(self, start, end=None): lineEnd = self.LineFromChar(max(start, end)) while lineStart <= lineEnd: self.SCIEnsureVisible(lineStart) - lineStart = lineStart + 1 + lineStart += 1 # Helper to add an event to a menu. def AppendMenu(self, menu, text="", event=None, flags=None, checked=0): @@ -341,11 +341,11 @@ def AppendMenu(self, menu, text="", event=None, flags=None, checked=0): return keyname = configManager.get_key_binding(event, self._GetSubConfigNames()) if keyname is not None: - text = text + "\t" + keyname + text += "\t" + keyname if flags is None: flags = win32con.MF_STRING | win32con.MF_ENABLED if checked: - flags = flags | win32con.MF_CHECKED + flags |= win32con.MF_CHECKED menu.AppendMenu(flags, cmdid, text) def OnKeyDown(self, msg): @@ -677,20 +677,20 @@ def _GetWordSplit(self, pos=-1, bAllowCalls=0): index = pos - 1 wordbreaks_use = wordbreaks if bAllowCalls: - wordbreaks_use = wordbreaks_use + "()[]" + wordbreaks_use += "()[]" while index >= 0: char = self.SCIGetCharAt(index) if char not in wordbreaks_use: break before.insert(0, char) - index = index - 1 + index -= 1 index = pos while index <= limit: char = self.SCIGetCharAt(index) if char not in wordbreaks_use: break after.append(char) - index = index + 1 + index += 1 return "".join(before), "".join(after) def OnPrepareDC(self, dc, pInfo): @@ -745,7 +745,7 @@ def CalculatePageRanges(self, dc, pInfo): textLen = self.GetTextLength() while pageStart < textLen: pageStart = self.FormatRange(dc, pageStart, textLen, rc, 0) - maxPage = maxPage + 1 + maxPage += 1 self.starts[maxPage] = pageStart # And a sentinal for one page past the end self.starts[maxPage + 1] = textLen @@ -805,10 +805,10 @@ def OnPrint(self, dc, pInfo): dc.SetTextAlign(win32con.TA_RIGHT) dc.TextOut(right, 2 * cyChar, pagenum_str) dc.SetTextAlign(win32con.TA_LEFT) - top = top + int((7 * cyChar) / 2) + top += int(7 * cyChar / 2) dc.MoveTo(left, top) dc.LineTo(right, top) - top = top + cyChar + top += cyChar rc = (left, top, right, bottom) nextPageStart = self.FormatRange( dc, self.starts[pageNum], self.starts[pageNum + 1], rc, 1 @@ -829,7 +829,7 @@ def LoadConfiguration(): configManager.last_error, ) if configName != "default": - msg = msg + "\n\nThe default configuration will be loaded." + msg += "\n\nThe default configuration will be loaded." bTryDefault = 1 win32ui.MessageBox(msg) if bTryDefault: diff --git a/Pythonwin/pywin/tools/browseProjects.py b/Pythonwin/pywin/tools/browseProjects.py index 14abcee94..e246387b1 100644 --- a/Pythonwin/pywin/tools/browseProjects.py +++ b/Pythonwin/pywin/tools/browseProjects.py @@ -188,7 +188,7 @@ def GetSubList(self): path = win32api.GetFullPathName( os.path.join(self.path, "..\\win32comext") ) - ret = ret + MakePathSubList(path) + ret.extend(MakePathSubList(path)) except win32ui.error: pass return ret @@ -233,7 +233,7 @@ def GetSubList(self): while 1: try: ret.append(HLIProjectRoot(win32api.RegEnumKey(hKey, index))) - index = index + 1 + index += 1 except win32api.error: break return ret diff --git a/Pythonwin/pywin/tools/browser.py b/Pythonwin/pywin/tools/browser.py index 9dcb5a3a0..b0fd7cab1 100644 --- a/Pythonwin/pywin/tools/browser.py +++ b/Pythonwin/pywin/tools/browser.py @@ -175,7 +175,7 @@ def GetSubList(self): ret = [] for base in self.myobject.__bases__: ret.append(MakeHLI(base, "Base class: " + base.__name__)) - ret = ret + HLIPythonObject.GetSubList(self) + ret.extend(HLIPythonObject.GetSubList(self)) return ret @@ -224,7 +224,7 @@ def IsExpandable(self): def GetSubList(self): ret = [] ret.append(MakeHLI(self.myobject.__class__)) - ret = ret + HLIPythonObject.GetSubList(self) + ret.extend(HLIPythonObject.GetSubList(self)) return ret @@ -261,7 +261,7 @@ def GetSubList(self): pos = 0 for item in self.myobject: ret.append(MakeHLI(item, "[" + str(pos) + "]")) - pos = pos + 1 + pos += 1 self.InsertDocString(ret) return ret diff --git a/Pythonwin/pywin/tools/hierlist.py b/Pythonwin/pywin/tools/hierlist.py index 9c0a78dd5..7ec29563a 100644 --- a/Pythonwin/pywin/tools/hierlist.py +++ b/Pythonwin/pywin/tools/hierlist.py @@ -217,7 +217,7 @@ def Refresh(self, hparent=None): if old_items[iold] == new_items[inewlook]: matched = 1 break - inewlook = inewlook + 1 + inewlook += 1 if matched: # Insert the new items. # print("Inserting after", old_items[iold], old_handles[iold]) diff --git a/Pythonwin/pywin/tools/regedit.py b/Pythonwin/pywin/tools/regedit.py index 1f83213ec..d8f854ff4 100644 --- a/Pythonwin/pywin/tools/regedit.py +++ b/Pythonwin/pywin/tools/regedit.py @@ -197,7 +197,7 @@ def UpdateForRegItem(self, item): name = "(Default)" self.InsertItem(valNum, name) self.SetItemText(valNum, 1, str(res[1])) - valNum = valNum + 1 + valNum += 1 finally: win32api.RegCloseKey(hkey) @@ -216,7 +216,7 @@ def OnInitDialog(self): style = win32api.GetWindowLong( self.edit.GetSafeHwnd(), win32con.GWL_STYLE ) - style = style & (~win32con.ES_WANTRETURN) + style &= ~win32con.ES_WANTRETURN win32api.SetWindowLong( self.edit.GetSafeHwnd(), win32con.GWL_STYLE, style ) @@ -364,7 +364,7 @@ def GetSubList(self): except win32api.error: break ret.append(HLIRegistryKey(self.keyRoot, self.keyName + "\\" + key, key)) - keyNum = keyNum + 1 + keyNum += 1 finally: win32api.RegCloseKey(hkey) win32ui.DoWaitCursor(0) diff --git a/com/win32com/client/__init__.py b/com/win32com/client/__init__.py index e8a4b6e99..c0b1a8761 100644 --- a/com/win32com/client/__init__.py +++ b/com/win32com/client/__init__.py @@ -130,7 +130,7 @@ def DispatchEx( if clsctx is None: clsctx = pythoncom.CLSCTX_SERVER if machine is not None: - clsctx = clsctx & ~pythoncom.CLSCTX_INPROC + clsctx &= ~pythoncom.CLSCTX_INPROC if machine is None: serverInfo = None else: diff --git a/com/win32com/client/build.py b/com/win32com/client/build.py index 342f60a39..7428c1369 100644 --- a/com/win32com/client/build.py +++ b/com/win32com/client/build.py @@ -328,15 +328,15 @@ def CountInOutOptArgs(self, argTuple): for argCheck in argTuple: inOut = argCheck[1] if inOut == 0: - ins = ins + 1 - out = out + 1 + ins += 1 + out += 1 else: if inOut & pythoncom.PARAMFLAG_FIN: - ins = ins + 1 + ins += 1 if inOut & pythoncom.PARAMFLAG_FOPT: - opts = opts + 1 + opts += 1 if inOut & pythoncom.PARAMFLAG_FOUT: - out = out + 1 + out += 1 return ins, out, opts def MakeFuncMethod(self, entry, name, bMakeClass=1): @@ -422,42 +422,30 @@ def MakeDispatchFuncMethod(self, entry, name, bMakeClass=1): repr(argsDesc), _BuildArgList(fdesc, names), ) - s = s + f"{linePrefix}\tif ret is not None:\n" + s += f"{linePrefix}\tif ret is not None:\n" if rd == pythoncom.VT_UNKNOWN: - s = ( - s - + "{}\t\t# See if this IUnknown is really an IDispatch\n".format( - linePrefix, - ) + s += "{}\t\t# See if this IUnknown is really an IDispatch\n".format( + linePrefix ) - s = s + f"{linePrefix}\t\ttry:\n" - s = ( - s - + "{}\t\t\tret = ret.QueryInterface(pythoncom.IID_IDispatch)\n".format( - linePrefix - ) + s += f"{linePrefix}\t\ttry:\n" + s += "{}\t\t\tret = ret.QueryInterface(pythoncom.IID_IDispatch)\n".format( + linePrefix ) - s = s + f"{linePrefix}\t\texcept pythoncom.error:\n" - s = s + f"{linePrefix}\t\t\treturn ret\n" - s = s + "{}\t\tret = Dispatch(ret, {}, {})\n".format( - linePrefix, - repr(name), - resclsid, + s += f"{linePrefix}\t\texcept pythoncom.error:\n" + s += f"{linePrefix}\t\t\treturn ret\n" + s += "{}\t\tret = Dispatch(ret, {}, {})\n".format( + linePrefix, repr(name), resclsid ) - s = s + "%s\treturn ret" % (linePrefix) + s += "%s\treturn ret" % linePrefix elif rd == pythoncom.VT_BSTR: s = f"{linePrefix}\t# Result is a Unicode object\n" - s = ( - s - + "%s\treturn self._oleobj_.InvokeTypes(%d, LCID, %s, %s, %s%s)" - % ( - linePrefix, - id, - fdesc[4], - retDesc, - repr(argsDesc), - _BuildArgList(fdesc, names), - ) + s += "%s\treturn self._oleobj_.InvokeTypes(%d, LCID, %s, %s, %s%s)" % ( + linePrefix, + id, + fdesc[4], + retDesc, + repr(argsDesc), + _BuildArgList(fdesc, names), ) # else s remains None if s is None: @@ -629,7 +617,7 @@ def _BuildArgList(fdesc, names): # As per BuildCallList(), avoid huge lines. # Hack a "\n" at the end of every 5th name for i in range(0, len(names), 5): - names[i] = names[i] + "\n\t\t\t" + names[i] += "\n\t\t\t" return "," + ", ".join(names) @@ -731,7 +719,7 @@ def BuildCallList( strval = "" if numOptArgs == -1: # Special value that says "var args after here" firstOptArg = numArgs - numArgs = numArgs - 1 + numArgs -= 1 else: firstOptArg = numArgs - numOptArgs for arg in range(numArgs): @@ -768,15 +756,15 @@ def BuildCallList( # This may still fail if the arg names are insane, but that seems # unlikely. See also _BuildArgList() if (arg + 1) % 5 == 0: - strval = strval + "\n" + strval += "\n" if is_comment: - strval = strval + "#" - strval = strval + "\t\t\t" - strval = strval + ", " + argName + strval += "#" + strval += "\t\t\t" + strval += ", " + argName if defArgVal: - strval = strval + "=" + defArgVal + strval += "=" + defArgVal if numOptArgs == -1: - strval = strval + ", *" + names[-1] + strval += ", *" + names[-1] return strval diff --git a/com/win32com/client/combrowse.py b/com/win32com/client/combrowse.py index a5e76a85b..2f7dc4004 100644 --- a/com/win32com/client/combrowse.py +++ b/com/win32com/client/combrowse.py @@ -235,11 +235,11 @@ def GetSubList(self): except win32api.error: fname = "" collected.append((lcid, platform, fname)) - lcidnum = lcidnum + 1 + lcidnum += 1 win32api.RegCloseKey(lcidkey) except ValueError: pass - num = num + 1 + num += 1 finally: win32ui.DoWaitCursor(0) win32api.RegCloseKey(key) @@ -462,7 +462,7 @@ def MakeReturnType(self, returnTypeDesc): first = returnTypeDesc[0] result = self.MakeReturnType(first) if first != pythoncom.VT_USERDEFINED: - result = result + " " + self.MakeReturnType(returnTypeDesc[1]) + result += " " + self.MakeReturnType(returnTypeDesc[1]) return result else: return self.MakeReturnTypeName(returnTypeDesc) @@ -481,16 +481,16 @@ def GetSubList(self): typ, flags, default = fd[8] val = self.MakeReturnType(typ) if flags: - val = "%s (Flags=%d, default=%s)" % (val, flags, default) + val += f" (Flags={flags}, default={default})" ret.append(browser.MakeHLI(val, "Return Type")) for argDesc in fd[2]: typ, flags, default = argDesc val = self.MakeReturnType(typ) if flags: - val = "%s (Flags=%d)" % (val, flags) + val += f" (Flags={flags})" if default is not None: - val = f"{val} (Default={default})" + val += f" (Default={default})" ret.append(browser.MakeHLI(val, "Argument")) try: @@ -581,12 +581,12 @@ def GetSubList(self): if versionFlt > bestVersion: bestVersion = versionFlt name = win32api.RegQueryValue(subKey, versionStr) - subNum = subNum + 1 + subNum += 1 finally: win32api.RegCloseKey(subKey) if name is not None: ret.append(HLIRegisteredTypeLibrary((keyName, versionStr), name)) - num = num + 1 + num += 1 finally: win32api.RegCloseKey(key) win32ui.DoWaitCursor(0) diff --git a/com/win32com/client/gencache.py b/com/win32com/client/gencache.py index e71869503..385478561 100644 --- a/com/win32com/client/gencache.py +++ b/com/win32com/client/gencache.py @@ -520,9 +520,9 @@ def EnsureModule( filePath = filePathPrefix + ".py" filePathPyc = filePathPrefix + ".py" if __debug__: - filePathPyc = filePathPyc + "c" + filePathPyc += "c" else: - filePathPyc = filePathPyc + "o" + filePathPyc += "o" # Verify that type library is up to date. # If we have a differing MinorVersion or genpy has bumped versions, update the file from . import genpy diff --git a/com/win32com/client/genpy.py b/com/win32com/client/genpy.py index a7c4857f9..7a4d061f6 100644 --- a/com/win32com/client/genpy.py +++ b/com/win32com/client/genpy.py @@ -272,7 +272,7 @@ def WriteVTableMap(self, generator): print("\t((", end=" ", file=stream) for name in names: print(repr(name), ",", end=" ", file=stream) - item_num = item_num + 1 + item_num += 1 if item_num % 5 == 0: print("\n\t\t\t", end=" ", file=stream) print( @@ -281,7 +281,7 @@ def WriteVTableMap(self, generator): file=stream, ) for arg in desc.args: - item_num = item_num + 1 + item_num += 1 if item_num % 5 == 0: print("\n\t\t\t", end=" ", file=stream) defval = build.MakeDefaultArgRepr(arg) @@ -610,7 +610,7 @@ def WriteClassBody(self, generator): if defArgDesc is None: defArgDesc = "" else: - defArgDesc = defArgDesc + "," + defArgDesc += "," print( '\t\t"%s" : ((%s, LCID, %d, 0),(%s)),' % ( diff --git a/com/win32com/client/makepy.py b/com/win32com/client/makepy.py index 05091bfe8..9f05ab5b5 100644 --- a/com/win32com/client/makepy.py +++ b/com/win32com/client/makepy.py @@ -391,9 +391,9 @@ def main(): elif o == "-o": outputName = v elif o == "-v": - verboseLevel = verboseLevel + 1 + verboseLevel += 1 elif o == "-q": - verboseLevel = verboseLevel - 1 + verboseLevel -= 1 elif o == "-i": if len(args) == 0: ShowInfo(None) diff --git a/com/win32com/client/selecttlb.py b/com/win32com/client/selecttlb.py index ee2c7bd23..bf8627f5f 100644 --- a/com/win32com/client/selecttlb.py +++ b/com/win32com/client/selecttlb.py @@ -83,7 +83,7 @@ def EnumKeys(root): val = "" # code using this assumes a string. ret.append((item, val)) - index = index + 1 + index += 1 return ret diff --git a/com/win32com/client/tlbrowse.py b/com/win32com/client/tlbrowse.py index 11673d5af..1a8d64909 100644 --- a/com/win32com/client/tlbrowse.py +++ b/com/win32com/client/tlbrowse.py @@ -155,13 +155,11 @@ def _GetMainInfoTypes(self): typeFlags = attr[11] desc = doc[0] - desc = desc + ", Flags=0x{:x}, typeKind=0x{:x}, typeFlags=0x{:x}".format( - flags, - typeKind, - typeFlags, + desc += ", Flags=0x{:x}, typeKind=0x{:x}, typeFlags=0x{:x}".format( + flags, typeKind, typeFlags ) if flags & pythoncom.IMPLTYPEFLAG_FSOURCE: - desc = desc + "(Source)" + desc += "(Source)" infos.append(("Implements", desc)) return infos diff --git a/com/win32com/makegw/makegw.py b/com/win32com/makegw/makegw.py index 8e72da871..61e48ab37 100644 --- a/com/win32com/makegw/makegw.py +++ b/com/win32com/makegw/makegw.py @@ -235,21 +235,17 @@ def _write_ifc_cpp(f, interface): val = argCvt.GetFormatChar() if val: f.write("\t" + argCvt.GetAutoduckString() + "\n") - formatChars = formatChars + val - argsParseTuple = ( - argsParseTuple + ", " + argCvt.GetParseTupleArg() - ) - codePobjects = ( - codePobjects + argCvt.DeclareParseArgTupleInputConverter() - ) - codePost = codePost + argCvt.GetParsePostCode() + formatChars += val + argsParseTuple += ", " + argCvt.GetParseTupleArg() + codePobjects += argCvt.DeclareParseArgTupleInputConverter() + codePost += argCvt.GetParsePostCode() needConversion = needConversion or argCvt.NeedUSES_CONVERSION() - cleanup = cleanup + argCvt.GetInterfaceArgCleanup() - cleanup_gil = cleanup_gil + argCvt.GetInterfaceArgCleanupGIL() + cleanup += argCvt.GetInterfaceArgCleanup() + cleanup_gil += argCvt.GetInterfaceArgCleanupGIL() comArgName, comArgDeclString = argCvt.GetInterfaceCppObjectInfo() if comArgDeclString: # If we should declare a variable - codeCobjects = codeCobjects + "\t%s;\n" % (comArgDeclString) - argsCOM = argsCOM + ", " + comArgName + codeCobjects += "\t%s;\n" % comArgDeclString + argsCOM += ", " + comArgName except makegwparse.error_not_supported as why: f.write( '// *** The input argument {} of type "{}" was not processed ***\n// Please check the conversion function is appropriate and exists!\n'.format( @@ -263,18 +259,15 @@ def _write_ifc_cpp(f, interface): arg.type, arg.name, arg.name ) ) - codePost = ( - codePost - + "\tif (bPythonIsHappy && !PyObject_As{}( ob{}, &{} )) bPythonIsHappy = FALSE;\n".format( - arg.type, arg.name, arg.name - ) + codePost += "\tif (bPythonIsHappy && !PyObject_As{}( ob{}, &{} )) bPythonIsHappy = FALSE;\n".format( + arg.type, arg.name, arg.name ) - formatChars = formatChars + "O" - argsParseTuple = argsParseTuple + ", &ob%s" % (arg.name) + formatChars += "O" + argsParseTuple += ", &ob%s" % arg.name - argsCOM = argsCOM + ", " + arg.name - cleanup = cleanup + f"\tPyObject_Free{arg.type}({arg.name});\n" + argsCOM += ", " + arg.name + cleanup += f"\tPyObject_Free{arg.type}({arg.name});\n" if needConversion: f.write("\tUSES_CONVERSION;\n") @@ -313,11 +306,11 @@ def _write_ifc_cpp(f, interface): argCvt = makegwparse.make_arg_converter(arg) formatChar = argCvt.GetFormatChar() if formatChar: - formatChars = formatChars + formatChar - codePre = codePre + argCvt.GetBuildForInterfacePreCode() - codePost = codePost + argCvt.GetBuildForInterfacePostCode() - codeVarsPass = codeVarsPass + ", " + argCvt.GetBuildValueArg() - codeDecl = codeDecl + argCvt.DeclareParseArgTupleInputConverter() + formatChars += formatChar + codePre += argCvt.GetBuildForInterfacePreCode() + codePost += argCvt.GetBuildForInterfacePostCode() + codeVarsPass += ", " + argCvt.GetBuildValueArg() + codeDecl += argCvt.DeclareParseArgTupleInputConverter() except makegwparse.error_not_supported as why: f.write( '// *** The output argument {} of type "{}" was not processed ***\n// {}\n'.format( @@ -461,7 +454,7 @@ def _write_gw_cpp(f, interface): if method.args: for arg in method.args: if arg.HasAttribute("out"): - cout = cout + 1 + cout += 1 if arg.indirectionLevel == 2: f.write("\tif (%s==NULL) return E_POINTER;\n" % arg.name) if arg.HasAttribute("in"): @@ -472,13 +465,11 @@ def _write_gw_cpp(f, interface): needConversion = needConversion or argCvt.NeedUSES_CONVERSION() if formatchar: - formatChars = formatChars + formatchar - codeVars = ( - codeVars + argCvt.DeclareParseArgTupleInputConverter() - ) - argStr = argStr + ", " + argCvt.GetBuildValueArg() - codePre = codePre + argCvt.GetBuildForGatewayPreCode() - codePost = codePost + argCvt.GetBuildForGatewayPostCode() + formatChars += formatchar + codeVars += argCvt.DeclareParseArgTupleInputConverter() + argStr += ", " + argCvt.GetBuildValueArg() + codePre += argCvt.GetBuildForGatewayPreCode() + codePost += argCvt.GetBuildForGatewayPostCode() except makegwparse.error_not_supported as why: f.write( '// *** The input argument {} of type "{}" was not processed ***\n// - Please ensure this conversion function exists, and is appropriate\n// - {}\n'.format( @@ -495,9 +486,9 @@ def _write_gw_cpp(f, interface): arg.name, method.name ) ) - codePost = codePost + "\tPy_DECREF(ob%s);\n" % arg.name - formatChars = formatChars + "O" - argStr = argStr + ", ob%s" % (arg.name) + codePost += "\tPy_DECREF(ob%s);\n" % arg.name + formatChars += "O" + argStr += ", ob%s" % arg.name if needConversion: f.write("\tUSES_CONVERSION;\n") @@ -532,14 +523,10 @@ def _write_gw_cpp(f, interface): argCvt.SetGatewayMode() val = argCvt.GetFormatChar() if val: - formatChars = formatChars + val - argsParseTuple = ( - argsParseTuple + ", " + argCvt.GetParseTupleArg() - ) - codePobjects = ( - codePobjects + argCvt.DeclareParseArgTupleInputConverter() - ) - codePost = codePost + argCvt.GetParsePostCode() + formatChars += val + argsParseTuple += ", " + argCvt.GetParseTupleArg() + codePobjects += argCvt.DeclareParseArgTupleInputConverter() + codePost += argCvt.GetParsePostCode() needConversion = needConversion or argCvt.NeedUSES_CONVERSION() except makegwparse.error_not_supported as why: f.write( diff --git a/com/win32com/makegw/makegwparse.py b/com/win32com/makegw/makegwparse.py index 8086eee65..308b0766d 100644 --- a/com/win32com/makegw/makegwparse.py +++ b/com/win32com/makegw/makegwparse.py @@ -254,9 +254,9 @@ def GetBuildForGatewayPreCode(self): def GetParsePostCode(self): s = "\t" if self.gatewayMode: - s = s + self._IndirectPrefix(self._GetDeclaredIndirection(), 0) - s = s + self.arg.name - s = s + " = (float)dbl%s;\n" % self.arg.name + s += self._IndirectPrefix(self._GetDeclaredIndirection(), 0) + s += self.arg.name + s += " = (float)dbl%s;\n" % self.arg.name return s @@ -293,9 +293,9 @@ def GetBuildForGatewayPreCode(self): def GetParsePostCode(self): s = "\t" if self.gatewayMode: - s = s + self._IndirectPrefix(self._GetDeclaredIndirection(), 0) - s = s + self.arg.name - s = s + " = i%s;\n" % self.arg.name + s += self._IndirectPrefix(self._GetDeclaredIndirection(), 0) + s += self.arg.name + s += " = i%s;\n" % self.arg.name return s @@ -471,7 +471,7 @@ def __init__(self, arg, builtinIndirection, declaredIndirection=0): if arg.indirectionLevel == 0 and arg.unc_type[:2] == "LP": arg.unc_type = arg.unc_type[2:] # reduce the builtin and increment the declaration - arg.indirectionLevel = arg.indirectionLevel + 1 + arg.indirectionLevel += 1 builtinIndirection = 0 ArgFormatterPythonCOM.__init__( self, arg, builtinIndirection, declaredIndirection @@ -873,7 +873,7 @@ def HasAttribute(self, typ): def GetRawDeclaration(self): ret = f"{self.raw_type} {self.name}" if self.arrayDecl: - ret = ret + "[]" + ret += "[]" return ret diff --git a/com/win32com/server/connect.py b/com/win32com/server/connect.py index 6efe4f711..e99555a04 100644 --- a/com/win32com/server/connect.py +++ b/com/win32com/server/connect.py @@ -52,7 +52,7 @@ def Advise(self, pUnk): ) except pythoncom.com_error: raise COMException(scode=olectl.CONNECT_E_NOCONNECTION) - self.cookieNo = self.cookieNo + 1 + self.cookieNo += 1 self.connections[self.cookieNo] = interface return self.cookieNo diff --git a/com/win32com/server/policy.py b/com/win32com/server/policy.py index e99b48216..47f5dd641 100644 --- a/com/win32com/server/policy.py +++ b/com/win32com/server/policy.py @@ -608,7 +608,7 @@ def _GetTypeInfo_(self, index, lcid): def _allocnextdispid(self, last_dispid): while 1: - last_dispid = last_dispid + 1 + last_dispid += 1 if ( last_dispid not in self._dispid_to_func_ and last_dispid not in self._dispid_to_get_ diff --git a/com/win32com/server/register.py b/com/win32com/server/register.py index 9f1e3ce49..04ffdca37 100644 --- a/com/win32com/server/register.py +++ b/com/win32com/server/register.py @@ -214,9 +214,9 @@ def RegisterServer( sys.frozen ), "pythoncom is frozen, but sys.frozen is not set - don't know the context!" if sys.frozen == "dll": - clsctx = clsctx & pythoncom.CLSCTX_INPROC_SERVER + clsctx &= pythoncom.CLSCTX_INPROC_SERVER else: - clsctx = clsctx & pythoncom.CLSCTX_LOCAL_SERVER + clsctx &= pythoncom.CLSCTX_LOCAL_SERVER # Now setup based on the clsctx left over. if clsctx & pythoncom.CLSCTX_INPROC_SERVER: # get the module to use for registration. @@ -304,7 +304,7 @@ def RegisterServer( if addPyComCat is None: addPyComCat = pythoncom.frozen == 0 if addPyComCat: - catids = catids + [CATID_PythonCOMServer] + catids.append(CATID_PythonCOMServer) # Set up the implemented categories if catids: @@ -360,7 +360,7 @@ def GetUnregisterServerKeys(clsid, progID=None, verProgID=None, customKeys=None) ret.append(("AppID\\%s" % str(clsid), win32con.HKEY_CLASSES_ROOT)) # Any custom keys? if customKeys: - ret = ret + customKeys + ret.extend(customKeys) return ret @@ -536,7 +536,7 @@ def UnregisterInfoClasses(*classes, **flags): verProgID = _get(cls, "_reg_verprogid_") customKeys = _get(cls, "_reg_remove_keys_") - ret = ret + GetUnregisterServerKeys(clsid, progID, verProgID, customKeys) + ret.extend(GetUnregisterServerKeys(clsid, progID, verProgID, customKeys)) return ret diff --git a/com/win32com/test/testGIT.py b/com/win32com/test/testGIT.py index b290792eb..611cba2d6 100644 --- a/com/win32com/test/testGIT.py +++ b/com/win32com/test/testGIT.py @@ -110,7 +110,7 @@ def test(fn): if rc >= win32event.WAIT_OBJECT_0 and rc < win32event.WAIT_OBJECT_0 + len( events ): - numFinished = numFinished + 1 + numFinished += 1 if numFinished >= len(events): break elif rc == win32event.WAIT_OBJECT_0 + len(events): # a message diff --git a/com/win32com/test/testGatewayAddresses.py b/com/win32com/test/testGatewayAddresses.py index ed78d37e7..aeafbec75 100644 --- a/com/win32com/test/testGatewayAddresses.py +++ b/com/win32com/test/testGatewayAddresses.py @@ -59,7 +59,7 @@ def CheckObjectIdentity(ob1, ob2): def FailObjectIdentity(ob1, ob2, when): if not CheckObjectIdentity(ob1, ob2): global numErrors - numErrors = numErrors + 1 + numErrors += 1 print(when, f"are not identical ({repr(ob1)}, {repr(ob2)})") diff --git a/com/win32com/test/testMarshal.py b/com/win32com/test/testMarshal.py index d5b931c8c..f17cd29d5 100644 --- a/com/win32com/test/testMarshal.py +++ b/com/win32com/test/testMarshal.py @@ -125,7 +125,7 @@ def _DoTestMarshal(self, fn, bCoWait=0): rc >= win32event.WAIT_OBJECT_0 and rc < win32event.WAIT_OBJECT_0 + len(events) ): - numFinished = numFinished + 1 + numFinished += 1 if numFinished >= len(events): break elif rc == win32event.WAIT_OBJECT_0 + len(events): # a message diff --git a/com/win32com/test/testPersist.py b/com/win32com/test/testPersist.py index b2379cc85..aecdd27fb 100644 --- a/com/win32com/test/testPersist.py +++ b/com/win32com/test/testPersist.py @@ -50,7 +50,7 @@ def WriteAt(self, offset, data): newdata = self.data[0:offset] + data print(len(newdata)) if len(self.data) >= offset + len(data): - newdata = newdata + self.data[offset + len(data) :] + newdata += self.data[offset + len(data) :] print(len(newdata)) self.data = newdata return len(data) @@ -64,7 +64,7 @@ def Flush(self, whatsthis=0): def SetSize(self, size): print("Set Size" + str(size)) if size > len(self.data): - self.data = self.data + b"\000" * (size - len(self.data)) + self.data += b"\000" * (size - len(self.data)) else: self.data = self.data[0:size] return S_OK diff --git a/com/win32com/test/testPyComTest.py b/com/win32com/test/testPyComTest.py index d355098a8..4964d0a51 100644 --- a/com/win32com/test/testPyComTest.py +++ b/com/win32com/test/testPyComTest.py @@ -96,7 +96,7 @@ def _Init(self): def OnFire(self, no): try: - self.fireds[no] = self.fireds[no] + 1 + self.fireds[no] += 1 except KeyError: self.fireds[no] = 0 @@ -625,7 +625,7 @@ def TestCounter(counter, bIsGenerated): counter.SetBounds(bounds[0], bounds[1]) for item in counter: - num = num + 1 + num += 1 assert num == len( counter ), "*** Length of counter and loop iterations don't match ***" @@ -640,7 +640,7 @@ def TestCounter(counter, bIsGenerated): counter.Reset() num = 0 for item in counter: - num = num + 1 + num += 1 assert num == 10, f"*** Unexpected number of loop iterations - got {num} ***" progress("Finished testing counter") diff --git a/com/win32com/test/testStreams.py b/com/win32com/test/testStreams.py index b43da524f..9e905ce8b 100644 --- a/com/win32com/test/testStreams.py +++ b/com/win32com/test/testStreams.py @@ -51,7 +51,7 @@ def __init__(self, data): def Read(self, amount): result = self.data[self.index : self.index + amount] - self.index = self.index + amount + self.index += amount return result def Write(self, data): @@ -63,7 +63,7 @@ def Seek(self, dist, origin): if origin == pythoncom.STREAM_SEEK_SET: self.index = dist elif origin == pythoncom.STREAM_SEEK_CUR: - self.index = self.index + dist + self.index += dist elif origin == pythoncom.STREAM_SEEK_END: self.index = len(self.data) + dist else: diff --git a/com/win32com/test/util.py b/com/win32com/test/util.py index d649b7fcb..fd3820a38 100644 --- a/com/win32com/test/util.py +++ b/com/win32com/test/util.py @@ -105,7 +105,7 @@ def ExecuteShellCommand( tracebacks_ok=0, # OK if the output contains a t/b? ): output_name = tempfile.mktemp("win32com_test") - cmd = cmd + ' > "%s" 2>&1' % output_name + cmd += ' > "%s" 2>&1' % output_name rc = os.system(cmd) output = open(output_name, "r").read().strip() os.remove(output_name) diff --git a/com/win32com/universal.py b/com/win32com/universal.py index 345160963..14e0aa088 100644 --- a/com/win32com/universal.py +++ b/com/win32com/universal.py @@ -141,7 +141,7 @@ def __init__(self, method_info, isEventSink=0): for argDesc in arg_defs: arg = Arg(argDesc) arg.offset = cbArgs - cbArgs = cbArgs + arg.size + cbArgs += arg.size self.args.append(arg) self.cbArgs = cbArgs self._gw_in_args = self._GenerateInArgTuple() diff --git a/com/win32comext/adsi/demos/test.py b/com/win32comext/adsi/demos/test.py index 3d6b47d56..5e7467c22 100644 --- a/com/win32comext/adsi/demos/test.py +++ b/com/win32comext/adsi/demos/test.py @@ -73,15 +73,15 @@ def DumpSchema(): class_name = child.Class if class_name == "classSchema": _DumpClass(child) - nclasses = nclasses + 1 + nclasses += 1 elif class_name == "attributeSchema": _DumpAttribute(child) - nattr = nattr + 1 + nattr += 1 elif class_name == "subSchema": - nsub = nsub + 1 + nsub += 1 else: print("Unknown class:", class_name) - nunk = nunk + 1 + nunk += 1 if verbose_level: print("Processed", nclasses, "classes") print("Processed", nattr, "attributes") @@ -162,7 +162,7 @@ def DumpSchema2(): item.Name, desc, iid_name ) ) - nclass = nclass + 1 + nclass += 1 elif item_class == "property": if item.MultiValued: val_type = "Multi-Valued" @@ -170,12 +170,12 @@ def DumpSchema2(): val_type = "Single-Valued" if verbose_level >= 2: print(f"Property: Name={item.Name}, {val_type}") - nprop = nprop + 1 + nprop += 1 elif item_class == "syntax": data_type = vt_map.get(item.OleAutoDataType, "") if verbose_level >= 2: print(f"Syntax: Name={item.Name}, Datatype = {data_type}") - nsyntax = nsyntax + 1 + nsyntax += 1 if verbose_level >= 1: print("Processed", nclass, "classes") print("Processed", nprop, "properties") @@ -238,14 +238,14 @@ def main(): for opt, val in opts: if opt == "-s": if val[-1] not in "\\/": - val = val + "/" + val += "/" global server server = val if opt == "-h": usage(tests) if opt == "-v": global verbose_level - verbose_level = verbose_level + 1 + verbose_level += 1 if len(args) == 0: print("Running all tests - use '-h' to see command-line options...") diff --git a/com/win32comext/axdebug/Test/host.py b/com/win32comext/axdebug/Test/host.py index 44b6f9a7c..e9e95df54 100644 --- a/com/win32comext/axdebug/Test/host.py +++ b/com/win32comext/axdebug/Test/host.py @@ -15,11 +15,11 @@ class ExternalConnection: numExtRefs = 0 def AddConnection(self, extconn, reserved): - self.numExtRefs = self.numExtRefs + 1 + self.numExtRefs += 1 return self.numExtRefs def ReleaseConnection(self, extconn, reserved, fLastReleaseCloses): - self.numExtRefs = self.numExtRefs - 1 + self.numExtRefs -= 1 return self.numExtRefs diff --git a/com/win32comext/axdebug/codecontainer.py b/com/win32comext/axdebug/codecontainer.py index ccfa2eba0..d82ee0008 100644 --- a/com/win32comext/axdebug/codecontainer.py +++ b/com/win32comext/axdebug/codecontainer.py @@ -75,7 +75,7 @@ def GetLineOfPosition(self, charPos): if lineOffset > charPos: break lastOffset = lineOffset - lineNo = lineNo + 1 + lineNo += 1 else: # for not broken. # print("Can't find", charPos, "in", self.lineOffsets) raise COMException(scode=winerror.S_FALSE) @@ -87,7 +87,7 @@ def GetNextLine(self): self.nextLineNo = 0 # auto-reset. return "" rc = self.lines[self.nextLineNo] - self.nextLineNo = self.nextLineNo + 1 + self.nextLineNo += 1 return rc def GetLine(self, num): @@ -261,9 +261,9 @@ def GetName(self, dnt): attrlen = 0 for attr in attrs: if isinstance(attr, tuple): - attrlen = attrlen + attr[1] + attrlen += attr[1] else: - attrlen = attrlen + 1 + attrlen += 1 text = sc.GetText() if attrlen != len(text): print(f"Lengths don't match!!! ({attrlen}/{len(text)})") diff --git a/com/win32comext/axdebug/gateways.py b/com/win32comext/axdebug/gateways.py index 19f803eaf..beefab2e6 100644 --- a/com/win32comext/axdebug/gateways.py +++ b/com/win32comext/axdebug/gateways.py @@ -440,7 +440,7 @@ def Advise(self, pUnk): # Creates a connection to the client. Simply allocate a new cookie, # find the clients interface, and store it in a dictionary. interface = pUnk.QueryInterface(axdebug.IID_IDebugDocumentTextEvents, 1) - self.cookieNo = self.cookieNo + 1 + self.cookieNo += 1 self.connections[self.cookieNo] = interface return self.cookieNo diff --git a/com/win32comext/axdebug/stackframe.py b/com/win32comext/axdebug/stackframe.py index 08fa09ed7..16994715c 100644 --- a/com/win32comext/axdebug/stackframe.py +++ b/com/win32comext/axdebug/stackframe.py @@ -107,11 +107,11 @@ def GetDescriptionString(self, fLong): filename = self.frame.f_code.co_filename s = "" if 0: # fLong: - s = s + filename + s += filename if self.frame.f_code.co_name: - s = s + self.frame.f_code.co_name + s += self.frame.f_code.co_name else: - s = s + "" + s += "" return s def GetLanguageString(self, fLong): diff --git a/com/win32comext/axscript/client/framework.py b/com/win32comext/axscript/client/framework.py index 37ca3787c..e4c69f7ba 100644 --- a/com/win32comext/axscript/client/framework.py +++ b/com/win32comext/axscript/client/framework.py @@ -487,7 +487,7 @@ def FindBuildSubItemEvents(self): fdesc = defaultType.GetFuncDesc(index) except pythoncom.com_error: break # No more funcs - index = index + 1 + index += 1 dispid = fdesc[0] funckind = fdesc[3] invkind = fdesc[4] @@ -690,9 +690,9 @@ def ParseScriptText( or self.scriptState == axscript.SCRIPTSTATE_CONNECTED or self.scriptState == axscript.SCRIPTSTATE_DISCONNECTED ): - flags = flags | SCRIPTTEXT_FORCEEXECUTION + flags |= SCRIPTTEXT_FORCEEXECUTION else: - flags = flags & (~SCRIPTTEXT_FORCEEXECUTION) + flags &= ~SCRIPTTEXT_FORCEEXECUTION if flags & SCRIPTTEXT_FORCEEXECUTION: # About to execute the code. diff --git a/com/win32comext/axscript/client/pyscript.py b/com/win32comext/axscript/client/pyscript.py index d53559e30..5bf46eb80 100644 --- a/com/win32comext/axscript/client/pyscript.py +++ b/com/win32comext/axscript/client/pyscript.py @@ -238,7 +238,7 @@ def Reset(self): return framework.COMScript.Reset(self) def _GetNextCodeBlockNumber(self): - self.codeBlockCounter = self.codeBlockCounter + 1 + self.codeBlockCounter += 1 return self.codeBlockCounter def RegisterNamedItem(self, item): @@ -341,8 +341,8 @@ def DoProcessScriptItemEvent(self, item, event, lcid, wFlags, args): if codeBlock is not None: realCode = "def %s():\n" % funcName for line in framework.RemoveCR(codeBlock.codeText).split("\n"): - realCode = realCode + "\t" + line + "\n" - realCode = realCode + "\n" + realCode += "\t" + line + "\n" + realCode += "\n" if not self.CompileInScriptedSection(codeBlock, "exec", realCode): return dict = {} @@ -382,7 +382,7 @@ def DoParseScriptText( num = self._GetNextCodeBlockNumber() if num == 1: num = "" - name = f"{name} {num}" + name += f" {num}" codeBlock = AXScriptCodeBlock( name, code, sourceContextCookie, startLineNumber, flags ) diff --git a/com/win32comext/mapi/mapiutil.py b/com/win32comext/mapi/mapiutil.py index 8716a650a..896a8b0d0 100644 --- a/com/win32comext/mapi/mapiutil.py +++ b/com/win32comext/mapi/mapiutil.py @@ -86,7 +86,7 @@ def GetMapiTypeName(propType, rawType=True): ptTable[value] = name if rawType: - propType = propType & ~mapitags.MV_FLAG + propType &= ~mapitags.MV_FLAG return ptTable.get(propType, str(hex(propType))) @@ -206,6 +206,6 @@ def SetProperties(msg, propDict): f"The type of object {repr(val)}({type(val)}) can not be written" ) key = mapitags.PROP_TAG(tagType, mapitags.PROP_ID(newIds[newIdNo])) - newIdNo = newIdNo + 1 + newIdNo += 1 newProps.append((key, val)) msg.SetProps(newProps) diff --git a/com/win32comext/shell/demos/IFileOperationProgressSink.py b/com/win32comext/shell/demos/IFileOperationProgressSink.py index b32770740..9c73f544a 100644 --- a/com/win32comext/shell/demos/IFileOperationProgressSink.py +++ b/com/win32comext/shell/demos/IFileOperationProgressSink.py @@ -15,7 +15,7 @@ def decode_flags(flags): for k, v in tsf_flags: if flags & v: if flag_txt: - flag_txt = flag_txt + "|" + k + flag_txt += "|" + k else: flag_txt = k return flag_txt diff --git a/com/win32comext/shell/demos/ITransferAdviseSink.py b/com/win32comext/shell/demos/ITransferAdviseSink.py index ae4a7dea7..a0a696e2f 100644 --- a/com/win32comext/shell/demos/ITransferAdviseSink.py +++ b/com/win32comext/shell/demos/ITransferAdviseSink.py @@ -19,7 +19,7 @@ def decode_flags(flags): for k, v in tsf_flags: if flags & v: if flag_txt: - flag_txt = flag_txt + "|" + k + flag_txt += "|" + k else: flag_txt = k return flag_txt diff --git a/isapi/install.py b/isapi/install.py index 3a2828ee0..61462f4f6 100644 --- a/isapi/install.py +++ b/isapi/install.py @@ -364,7 +364,7 @@ def _AssignScriptMapsReplace(target, script_maps): def _AssignScriptMapsEnd(target, script_maps): unique_new_maps = get_unique_items(script_maps, target.ScriptMaps) - target.ScriptMaps = target.ScriptMaps + unique_new_maps + target.ScriptMaps += unique_new_maps def _AssignScriptMapsStart(target, script_maps): diff --git a/pywin32_testall.py b/pywin32_testall.py index 907154917..2aa92098c 100644 --- a/pywin32_testall.py +++ b/pywin32_testall.py @@ -76,7 +76,7 @@ def main(): extras = [] if args.user_interaction: - extras += ["-user-interaction"] + extras.append("-user-interaction") extras.extend(remains) scripts = [ "win32/test/testall.py", diff --git a/setup.py b/setup.py index 4723757c5..a55cbef77 100644 --- a/setup.py +++ b/setup.py @@ -54,7 +54,7 @@ build_id_patch = build_id if not "." in build_id_patch: - build_id_patch = build_id_patch + ".0" + build_id_patch += ".0" pywin32_version = "%d.%d.%s" % ( sys.version_info.major, sys.version_info.minor, @@ -1043,7 +1043,7 @@ def spawn(self, cmd): # We want mt.exe run with the original manifest for i in range(len(cmd)): if cmd[i] == "-manifest": - cmd[i + 1] = cmd[i + 1] + ".orig" + cmd[i + 1] += ".orig" break super().spawn(cmd) if is_link: diff --git a/win32/Demos/FileSecurityTest.py b/win32/Demos/FileSecurityTest.py index 3b8940b64..4cb1aea2d 100644 --- a/win32/Demos/FileSecurityTest.py +++ b/win32/Demos/FileSecurityTest.py @@ -131,7 +131,7 @@ calc_mask = 0 # calculate the mask so we can see if we are printing all of the permissions for i in permissions: if getattr(ntsecuritycon, i) & ace[1] == getattr(ntsecuritycon, i): - calc_mask = calc_mask | getattr(ntsecuritycon, i) + calc_mask |= getattr(ntsecuritycon, i) print(" ", i) print(" ", "Calculated Check Mask=", hex(calc_mask)) print(" -SID\n ", win32security.LookupAccountSid(None, ace[2])) diff --git a/win32/Demos/desktopmanager.py b/win32/Demos/desktopmanager.py index 6ffaf2a94..ff2441e06 100644 --- a/win32/Demos/desktopmanager.py +++ b/win32/Demos/desktopmanager.py @@ -81,7 +81,7 @@ def get_new_desktop_name(parent_hwnd): def new_icon(hdesk, desktop_name): """Runs as a thread on each desktop to create a new tray icon and handle its messages""" global id - id = id + 1 + id += 1 hdesk.SetThreadDesktop() ## apparently the threads can't use same hinst, so each needs its own window class windowclassname = "PythonDesktopManager" + desktop_name @@ -185,9 +185,9 @@ def icon_wndproc(hwnd, msg, wp, lp): mf_flags = win32con.MF_STRING ## if you switch to winlogon yourself, there's nothing there and you're stuck if desktops[d - 1].lower() in ("winlogon", "disconnect"): - mf_flags = mf_flags | win32con.MF_GRAYED | win32con.MF_DISABLED + mf_flags |= win32con.MF_GRAYED | win32con.MF_DISABLED if desktops[d - 1] == curr_desktop_name: - mf_flags = mf_flags | win32con.MF_CHECKED + mf_flags |= win32con.MF_CHECKED win32gui.AppendMenu(m, mf_flags, d, desktops[d - 1]) win32gui.AppendMenu(m, win32con.MF_STRING, desktop_cnt + 1, "Create new ...") win32gui.AppendMenu(m, win32con.MF_STRING, desktop_cnt + 2, "Exit") diff --git a/win32/Demos/eventLogDemo.py b/win32/Demos/eventLogDemo.py index 8c9a17efb..918e4e081 100644 --- a/win32/Demos/eventLogDemo.py +++ b/win32/Demos/eventLogDemo.py @@ -48,7 +48,7 @@ def ReadLog(computer, logType="Application", dumpEachRecord=0): print("(unicode error printing message: repr() follows...)") print(repr(msg)) - num = num + len(objects) + num += len(objects) if numRecords == num: print("Successfully read all", numRecords, "records") @@ -104,7 +104,7 @@ def test(): if opt == "-w": do_write = 0 if opt == "-v": - verbose = verbose + 1 + verbose += 1 if do_write: ph = win32api.GetCurrentProcess() th = win32security.OpenProcessToken(ph, win32con.TOKEN_READ) diff --git a/win32/Demos/security/security_enums.py b/win32/Demos/security/security_enums.py index ab3cc6d36..8850b442c 100644 --- a/win32/Demos/security/security_enums.py +++ b/win32/Demos/security/security_enums.py @@ -37,7 +37,7 @@ def lookup_flags(self, flags): for k, v in self.__dict__.items(): if flags & v == v: flag_names.append(k) - unknown_flags = unknown_flags & ~v + unknown_flags &= ~v return flag_names, unknown_flags diff --git a/win32/Demos/service/pipeTestService.py b/win32/Demos/service/pipeTestService.py index 484cec987..f062fcd2c 100644 --- a/win32/Demos/service/pipeTestService.py +++ b/win32/Demos/service/pipeTestService.py @@ -77,7 +77,7 @@ def DoProcessClient(self, pipeHandle, tid): hr = winerror.ERROR_MORE_DATA while hr == winerror.ERROR_MORE_DATA: hr, thisd = ReadFile(pipeHandle, 256) - d = d + thisd + d += thisd print("Read", d) ok = 1 except error: @@ -162,7 +162,7 @@ def SvcDoRun(self): else: # Pipe event - spawn thread to deal with it. _thread.start_new_thread(self.ProcessClient, (pipeHandle,)) - num_connections = num_connections + 1 + num_connections += 1 # Sleep to ensure that any new threads are in the list, and then # wait for all current threads to finish. diff --git a/win32/Demos/service/pipeTestServiceClient.py b/win32/Demos/service/pipeTestServiceClient.py index cc12dc66a..507219c09 100644 --- a/win32/Demos/service/pipeTestServiceClient.py +++ b/win32/Demos/service/pipeTestServiceClient.py @@ -38,7 +38,7 @@ def CallPipe(fn, args): ret = None retryCount = 0 while retryCount < 8: # Keep looping until user cancels. - retryCount = retryCount + 1 + retryCount += 1 try: return fn(*args) except win32api.error as exc: diff --git a/win32/Demos/timer_demo.py b/win32/Demos/timer_demo.py index 61115f065..0ce1d0210 100644 --- a/win32/Demos/timer_demo.py +++ b/win32/Demos/timer_demo.py @@ -26,7 +26,7 @@ def __init__(self, delay=1000, max=10): def increment(self, id, time): print("x = %d" % self.x) - self.x = self.x + 1 + self.x += 1 # if we've reached the max count, # kill off the timer. if self.x > self.max: diff --git a/win32/Demos/win32gui_dialog.py b/win32/Demos/win32gui_dialog.py index 40ff8bbbe..956265a25 100644 --- a/win32/Demos/win32gui_dialog.py +++ b/win32/Demos/win32gui_dialog.py @@ -69,7 +69,7 @@ def toparam(self): # alternate strategy would be to use unicode natively # and use the 'W' version of the messages - eg, # LVM_SETITEMW etc. - val = val + "\0" + val += "\x00" if isinstance(val, str): val = val.encode("mbcs") str_buf = array.array("b", val) diff --git a/win32/Demos/win32netdemo.py b/win32/Demos/win32netdemo.py index 7900a81a3..ac5f305db 100644 --- a/win32/Demos/win32netdemo.py +++ b/win32/Demos/win32netdemo.py @@ -59,7 +59,7 @@ def UserEnum(): ) for user in data: verbose("Found user %s" % user["name"]) - nuser = nuser + 1 + nuser += 1 if not resume: break assert nuser, "Could not find any users!" @@ -82,7 +82,7 @@ def GroupEnum(): ) for member in memberdata: verbose(" Member {name}".format(**member)) - nmembers = nmembers + 1 + nmembers += 1 if memberresume == 0: break if not resume: @@ -109,7 +109,7 @@ def LocalGroupEnum(): username, domain, type = win32security.LookupAccountSid( server, member["sid"] ) - nmembers = nmembers + 1 + nmembers += 1 verbose(" Member {} ({})".format(username, member["domainandname"])) if memberresume == 0: break @@ -242,7 +242,7 @@ def main(): usage(tests) if opt == "-v": global verbose_level - verbose_level = verbose_level + 1 + verbose_level += 1 if opt == "-c": create_user = True diff --git a/win32/Lib/pywin32_testutil.py b/win32/Lib/pywin32_testutil.py index 59e4b59f1..d9e517913 100644 --- a/win32/Lib/pywin32_testutil.py +++ b/win32/Lib/pywin32_testutil.py @@ -31,7 +31,7 @@ def __init__(self, real_test): self.num_test_cases = 1 self.num_leak_iters = 2 # seems to be enough! if hasattr(sys, "gettotalrefcount"): - self.num_test_cases = self.num_test_cases + self.num_leak_iters + self.num_test_cases += self.num_leak_iters def countTestCases(self): return self.num_test_cases diff --git a/win32/Lib/regcheck.py b/win32/Lib/regcheck.py index 4bb2419aa..27aab3e5d 100644 --- a/win32/Lib/regcheck.py +++ b/win32/Lib/regcheck.py @@ -77,7 +77,7 @@ def CheckPythonPaths(verbose): else: if verbose: print("(empty)") - keyNo = keyNo + 1 + keyNo += 1 except win32api.error: break finally: @@ -116,7 +116,7 @@ def CheckHelpFiles(verbose): print(helpFile) except OSError: print("** Help file %s does not exist" % helpFile) - keyNo = keyNo + 1 + keyNo += 1 except win32api.error as exc: import winerror diff --git a/win32/Lib/regutil.py b/win32/Lib/regutil.py index 2b55e043f..f85b06b22 100644 --- a/win32/Lib/regutil.py +++ b/win32/Lib/regutil.py @@ -107,7 +107,7 @@ def RegisterNamedPath(name, path): """Register a named path - ie, a named PythonPath entry.""" keyStr = BuildDefaultPythonKey() + "\\PythonPath" if name: - keyStr = keyStr + "\\" + name + keyStr += "\\" + name win32api.RegSetValue(GetRootKey(), keyStr, win32con.REG_SZ, path) @@ -128,7 +128,7 @@ def GetRegisteredNamedPath(name): """Get a registered named path, or None if it doesn't exist.""" keyStr = BuildDefaultPythonKey() + "\\PythonPath" if name: - keyStr = keyStr + "\\" + name + keyStr += "\\" + name try: return win32api.RegQueryValue(GetRootKey(), keyStr) except win32api.error as exc: diff --git a/win32/Lib/sspi.py b/win32/Lib/sspi.py index 79afa5839..803559fba 100644 --- a/win32/Lib/sspi.py +++ b/win32/Lib/sspi.py @@ -39,7 +39,7 @@ def _get_next_seq_num(self): implementation is to increment a counter """ ret = self.next_seq_num - self.next_seq_num = self.next_seq_num + 1 + self.next_seq_num += 1 return ret def encrypt(self, data): diff --git a/win32/Lib/win32gui_struct.py b/win32/Lib/win32gui_struct.py index 62e52648c..945ededc9 100644 --- a/win32/Lib/win32gui_struct.py +++ b/win32/Lib/win32gui_struct.py @@ -80,9 +80,9 @@ def UnpackNMITEMACTIVATE(lparam): if is64bit: # the struct module doesn't handle this correctly as some of the items # are actually structs in structs, which get individually aligned. - format = format + "iiiiiiixxxxP" + format += "iiiiiiixxxxP" else: - format = format + "iiiiiiiP" + format += "iiiiiiiP" buf = win32gui.PyMakeBuffer(struct.calcsize(format), lparam) return _MakeResult( "NMITEMACTIVATE hwndFrom idFrom code iItem iSubItem uNewState uOldState uChanged actionx actiony lParam", @@ -522,10 +522,10 @@ def UnpackTVNOTIFY(lparam): item_size = struct.calcsize(_tvitem_fmt) format = _nmhdr_fmt + _nmhdr_align_padding if is64bit: - format = format + "ixxxx" + format += "ixxxx" else: - format = format + "i" - format = format + "%ds%ds" % (item_size, item_size) + format += "i" + format += "%ds%ds" % (item_size, item_size) buf = win32gui.PyGetMemory(lparam, struct.calcsize(format)) hwndFrom, id, code, action, buf_old, buf_new = struct.unpack(format, buf) item_old = UnpackTVITEM(buf_old) @@ -670,8 +670,8 @@ def UnpackLVDISPINFO(lparam): def UnpackLVNOTIFY(lparam): format = _nmhdr_fmt + _nmhdr_align_padding + "7i" if is64bit: - format = format + "xxxx" # point needs padding. - format = format + "P" + format += "xxxx" # point needs padding. + format += "P" buf = win32gui.PyGetMemory(lparam, struct.calcsize(format)) ( hwndFrom, diff --git a/win32/Lib/win32pdhquery.py b/win32/Lib/win32pdhquery.py index 71d77e03a..3f458e0a8 100644 --- a/win32/Lib/win32pdhquery.py +++ b/win32/Lib/win32pdhquery.py @@ -443,7 +443,7 @@ def getinstpaths( try: while instances[cur + 1] == object: temp.append(object) - cur = cur + 1 + cur += 1 except IndexError: # if we went over the end pass paths = [] diff --git a/win32/Lib/win32pdhutil.py b/win32/Lib/win32pdhutil.py index 850e0ab89..4b733ac3f 100644 --- a/win32/Lib/win32pdhutil.py +++ b/win32/Lib/win32pdhutil.py @@ -103,7 +103,7 @@ def FindPerformanceAttributesByName( instance_dict = {} for instance in instances: try: - instance_dict[instance] = instance_dict[instance] + 1 + instance_dict[instance] += 1 except KeyError: instance_dict[instance] = 0 @@ -128,7 +128,7 @@ def ShowAllProcesses(): instance_dict = {} for instance in instances: try: - instance_dict[instance] = instance_dict[instance] + 1 + instance_dict[instance] += 1 except KeyError: instance_dict[instance] = 0 diff --git a/win32/Lib/win32serviceutil.py b/win32/Lib/win32serviceutil.py index 98bc9735a..2284536c3 100644 --- a/win32/Lib/win32serviceutil.py +++ b/win32/Lib/win32serviceutil.py @@ -218,7 +218,7 @@ def InstallService( startType = win32service.SERVICE_DEMAND_START serviceType = win32service.SERVICE_WIN32_OWN_PROCESS if bRunInteractive: - serviceType = serviceType | win32service.SERVICE_INTERACTIVE_PROCESS + serviceType |= win32service.SERVICE_INTERACTIVE_PROCESS if errorControl is None: errorControl = win32service.SERVICE_ERROR_NORMAL @@ -304,7 +304,7 @@ def ChangeServiceConfig( hscm = win32service.OpenSCManager(None, None, win32service.SC_MANAGER_ALL_ACCESS) serviceType = win32service.SERVICE_WIN32_OWN_PROCESS if bRunInteractive: - serviceType = serviceType | win32service.SERVICE_INTERACTIVE_PROCESS + serviceType |= win32service.SERVICE_INTERACTIVE_PROCESS commandLine = _GetCommandLine(exeName, exeArgs) try: hs = SmartOpenService(hscm, serviceName, win32service.SERVICE_ALL_ACCESS) @@ -452,7 +452,7 @@ def __FindSvcDeps(findName): svc = win32api.RegEnumKey(k, num) except win32api.error: break - num = num + 1 + num += 1 sk = win32api.RegOpenKey(k, svc) try: deps, typ = win32api.RegQueryValueEx(sk, "DependOnService") @@ -981,11 +981,11 @@ def GetAcceptedControls(self): # override this. accepted = 0 if hasattr(self, "SvcStop"): - accepted = accepted | win32service.SERVICE_ACCEPT_STOP + accepted |= win32service.SERVICE_ACCEPT_STOP if hasattr(self, "SvcPause") and hasattr(self, "SvcContinue"): - accepted = accepted | win32service.SERVICE_ACCEPT_PAUSE_CONTINUE + accepted |= win32service.SERVICE_ACCEPT_PAUSE_CONTINUE if hasattr(self, "SvcShutdown"): - accepted = accepted | win32service.SERVICE_ACCEPT_SHUTDOWN + accepted |= win32service.SERVICE_ACCEPT_SHUTDOWN return accepted def ReportServiceStatus( @@ -1004,7 +1004,7 @@ def ReportServiceStatus( ]: checkPoint = 0 else: - self.checkPoint = self.checkPoint + 1 + self.checkPoint += 1 checkPoint = self.checkPoint # Now report the status to the control manager diff --git a/win32/Lib/win32verstamp.py b/win32/Lib/win32verstamp.py index 1fe0a6b7f..e9f8c5e45 100644 --- a/win32/Lib/win32verstamp.py +++ b/win32/Lib/win32verstamp.py @@ -71,7 +71,7 @@ def String(key, value): key = nullterm(key) value = nullterm(value) result = struct.pack("hh", len(value) // 2, 1) # wValueLength, wType - result = result + key + result += key result = pad32(result) + value return addlen(result) @@ -79,16 +79,16 @@ def String(key, value): def StringTable(key, data): key = nullterm(key) result = struct.pack("hh", 0, 1) # wValueLength, wType - result = result + key + result += key for k, v in data.items(): - result = result + String(k, v) + result += String(k, v) result = pad32(result) return addlen(result) def StringFileInfo(data): result = struct.pack("hh", 0, 1) # wValueLength, wType - result = result + nullterm("StringFileInfo") + result += nullterm("StringFileInfo") # result = pad32(result) + StringTable('040904b0', data) result = pad32(result) + StringTable("040904E4", data) return addlen(result) @@ -96,24 +96,24 @@ def StringFileInfo(data): def Var(key, value): result = struct.pack("hh", len(value), 0) # wValueLength, wType - result = result + nullterm(key) + result += nullterm(key) result = pad32(result) + value return addlen(result) def VarFileInfo(data): result = struct.pack("hh", 0, 1) # wValueLength, wType - result = result + nullterm("VarFileInfo") + result += nullterm("VarFileInfo") result = pad32(result) for k, v in data.items(): - result = result + Var(k, v) + result += Var(k, v) return addlen(result) def VS_VERSION_INFO(maj, min, sub, build, sdata, vdata, debug=0, is_dll=1): ffi = VS_FIXEDFILEINFO(maj, min, sub, build, debug, is_dll) result = struct.pack("hh", len(ffi), 0) # wValueLength, wType - result = result + nullterm("VS_VERSION_INFO") + result += nullterm("VS_VERSION_INFO") result = pad32(result) + ffi result = pad32(result) + StringFileInfo(sdata) + VarFileInfo(vdata) return addlen(result) diff --git a/win32/scripts/ControlService.py b/win32/scripts/ControlService.py index d2281add2..b4d35685c 100644 --- a/win32/scripts/ControlService.py +++ b/win32/scripts/ControlService.py @@ -315,7 +315,7 @@ def ReloadData(self): svc[0], ) ) - i = i + 1 + i += 1 if service and service[1] == svc[0]: self.listCtrl.SetCurSel(pos) diff --git a/win32/scripts/VersionStamp/bulkstamp.py b/win32/scripts/VersionStamp/bulkstamp.py index 81f7cbcd5..3a039ebb8 100644 --- a/win32/scripts/VersionStamp/bulkstamp.py +++ b/win32/scripts/VersionStamp/bulkstamp.py @@ -63,7 +63,7 @@ def walk(arg, dirname, names): desc = descriptions[os.path.normcase(name)] try: verstamp.stamp(vars, pathname, desc, is_dll=is_dll) - numStamped = numStamped + 1 + numStamped += 1 except win32api.error as exc: print( "Could not stamp", diff --git a/win32/scripts/VersionStamp/vssutil.py b/win32/scripts/VersionStamp/vssutil.py index 1e8da2bbc..ee715757c 100644 --- a/win32/scripts/VersionStamp/vssutil.py +++ b/win32/scripts/VersionStamp/vssutil.py @@ -74,14 +74,14 @@ def VssLog(project, linePrefix="", noLabels=5, maxItems=150): num = 0 labelNum = 0 for i in project.GetVersions(constants.VSSFLAG_RECURSYES): - num = num + 1 + num += 1 if num > maxItems: break commentDesc = itemDesc = "" if i.Action[:5] == "Added": continue if len(i.Label): - labelNum = labelNum + 1 + labelNum += 1 itemDesc = i.Action else: itemDesc = i.VSSItem.Name @@ -128,10 +128,10 @@ def CountCheckouts(item): num = 0 if item.Type == constants.VSSITEM_PROJECT: for sub in item.Items: - num = num + CountCheckouts(sub) + num += CountCheckouts(sub) else: if item.IsCheckedOut: - num = num + 1 + num += 1 return num @@ -170,7 +170,7 @@ def MakeNewBuildNo(project, buildDesc=None, auto=0, bRebrand=0): try: buildNo = int(buildNo) if not bRebrand: - buildNo = buildNo + 1 + buildNo += 1 buildNo = str(buildNo) except ValueError: raise error("The previous label could not be incremented: %s" % (oldBuild)) diff --git a/win32/scripts/backupEventLog.py b/win32/scripts/backupEventLog.py index 325da9da5..2a4ea5024 100644 --- a/win32/scripts/backupEventLog.py +++ b/win32/scripts/backupEventLog.py @@ -23,7 +23,7 @@ def BackupClearLog(logType): os.stat(fname) except OSError: fileExists = 0 - retry = retry + 1 + retry += 1 # OK - have unique file name. try: hlog = win32evtlog.OpenEventLog(None, logType) diff --git a/win32/scripts/rasutil.py b/win32/scripts/rasutil.py index 75426341f..6eaa31887 100644 --- a/win32/scripts/rasutil.py +++ b/win32/scripts/rasutil.py @@ -42,7 +42,7 @@ def Connect(rasEntryName, numRetries=5): break print("Retrying...") win32api.Sleep(5000) - retryCount = retryCount - 1 + retryCount -= 1 if errCode: raise ConnectionError(errCode, win32ras.GetErrorString(errCode)) diff --git a/win32/test/test_win32file.py b/win32/test/test_win32file.py index caa9c8fb5..fd72c614d 100644 --- a/win32/test/test_win32file.py +++ b/win32/test/test_win32file.py @@ -313,7 +313,7 @@ def testSimpleOverlapped(self): for i in range(num_loops): win32file.WriteFile(h, chunk_data, overlapped) win32event.WaitForSingleObject(overlapped.hEvent, win32event.INFINITE) - overlapped.Offset = overlapped.Offset + len(chunk_data) + overlapped.Offset += len(chunk_data) h.Close() # Now read the data back overlapped overlapped = pywintypes.OVERLAPPED() @@ -328,7 +328,7 @@ def testSimpleOverlapped(self): try: hr, data = win32file.ReadFile(h, buffer, overlapped) win32event.WaitForSingleObject(overlapped.hEvent, win32event.INFINITE) - overlapped.Offset = overlapped.Offset + len(data) + overlapped.Offset += len(data) if not data is buffer: self.fail( "Unexpected result from ReadFile - should be the same buffer we passed it" diff --git a/win32/test/test_win32trace.py b/win32/test/test_win32trace.py index d16a02d39..8cd79dbf3 100644 --- a/win32/test/test_win32trace.py +++ b/win32/test/test_win32trace.py @@ -238,7 +238,7 @@ def testHugeChunks(self): data = "*" * 1023 + "\n" while len(data) <= self.BiggestChunk: win32trace.write(data) - data = data + data + data += data # If we made it here, we passed. def tearDown(self):