py2docfx 0.1.15.dev2025736__py3-none-any.whl → 0.1.15.dev2038852__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- py2docfx/docfx_yaml/process_doctree.py +34 -21
- py2docfx/docfx_yaml/tests/test_method_arguments.py +7 -1
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/_core_metadata.py +21 -5
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/_distutils/_msvccompiler.py +2 -0
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/_distutils/ccompiler.py +5 -2
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/_distutils/command/__init__.py +27 -8
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/_distutils/command/build.py +1 -6
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/_distutils/command/build_clib.py +1 -9
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/_distutils/command/build_ext.py +1 -8
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/_distutils/command/check.py +1 -1
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/_distutils/command/config.py +0 -2
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/_distutils/command/install.py +8 -17
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/_distutils/compat/numpy.py +2 -0
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/_distutils/compilers/C/base.py +8 -5
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/_distutils/compilers/C/msvc.py +1 -1
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/_distutils/compilers/C/unix.py +15 -1
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/_distutils/dist.py +2 -1
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/_distutils/sysconfig.py +0 -10
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/_distutils/tests/test_build_ext.py +60 -5
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/_distutils/unixccompiler.py +6 -0
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/_distutils/util.py +7 -6
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/_normalization.py +29 -0
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/_vendor/wheel/__init__.py +1 -1
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/_vendor/wheel/_bdist_wheel.py +613 -0
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/_vendor/wheel/_setuptools_logging.py +2 -2
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/_vendor/wheel/bdist_wheel.py +25 -594
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/_vendor/wheel/cli/__init__.py +6 -6
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/_vendor/wheel/cli/convert.py +282 -223
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/_vendor/wheel/macosx_libfile.py +22 -9
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/_vendor/wheel/metadata.py +16 -13
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/_vendor/wheel/util.py +0 -9
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/_vendor/wheel/wheelfile.py +40 -9
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/command/bdist_wheel.py +6 -2
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/config/_apply_pyprojecttoml.py +48 -11
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/config/_validate_pyproject/extra_validations.py +31 -1
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/config/_validate_pyproject/fastjsonschema_validations.py +222 -129
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/config/_validate_pyproject/formats.py +30 -3
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/dist.py +115 -9
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/msvc.py +12 -3
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/tests/config/test_apply_pyprojecttoml.py +246 -13
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/tests/test_bdist_wheel.py +93 -8
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/tests/test_build_meta.py +17 -4
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/tests/test_core_metadata.py +45 -0
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/tests/test_egg_info.py +24 -4
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/tests/test_sdist.py +13 -1
- py2docfx/venv/venv1/Lib/site-packages/google/protobuf/__init__.py +1 -1
- py2docfx/venv/venv1/Lib/site-packages/google/protobuf/any_pb2.py +4 -4
- py2docfx/venv/venv1/Lib/site-packages/google/protobuf/api_pb2.py +4 -4
- py2docfx/venv/venv1/Lib/site-packages/google/protobuf/compiler/plugin_pb2.py +4 -4
- py2docfx/venv/venv1/Lib/site-packages/google/protobuf/descriptor_database.py +22 -4
- py2docfx/venv/venv1/Lib/site-packages/google/protobuf/descriptor_pb2.py +82 -35
- py2docfx/venv/venv1/Lib/site-packages/google/protobuf/duration_pb2.py +4 -4
- py2docfx/venv/venv1/Lib/site-packages/google/protobuf/empty_pb2.py +4 -4
- py2docfx/venv/venv1/Lib/site-packages/google/protobuf/field_mask_pb2.py +4 -4
- py2docfx/venv/venv1/Lib/site-packages/google/protobuf/internal/builder.py +4 -3
- py2docfx/venv/venv1/Lib/site-packages/google/protobuf/internal/containers.py +13 -0
- py2docfx/venv/venv1/Lib/site-packages/google/protobuf/internal/decoder.py +62 -115
- py2docfx/venv/venv1/Lib/site-packages/google/protobuf/internal/python_edition_defaults.py +1 -1
- py2docfx/venv/venv1/Lib/site-packages/google/protobuf/internal/python_message.py +15 -18
- py2docfx/venv/venv1/Lib/site-packages/google/protobuf/internal/testing_refleaks.py +4 -1
- py2docfx/venv/venv1/Lib/site-packages/google/protobuf/internal/type_checkers.py +5 -0
- py2docfx/venv/venv1/Lib/site-packages/google/protobuf/internal/well_known_types.py +3 -3
- py2docfx/venv/venv1/Lib/site-packages/google/protobuf/json_format.py +25 -9
- py2docfx/venv/venv1/Lib/site-packages/google/protobuf/message.py +26 -0
- py2docfx/venv/venv1/Lib/site-packages/google/protobuf/message_factory.py +0 -63
- py2docfx/venv/venv1/Lib/site-packages/google/protobuf/proto.py +38 -1
- py2docfx/venv/venv1/Lib/site-packages/google/protobuf/proto_text.py +129 -0
- py2docfx/venv/venv1/Lib/site-packages/google/protobuf/reflection.py +0 -49
- py2docfx/venv/venv1/Lib/site-packages/google/protobuf/runtime_version.py +3 -3
- py2docfx/venv/venv1/Lib/site-packages/google/protobuf/source_context_pb2.py +4 -4
- py2docfx/venv/venv1/Lib/site-packages/google/protobuf/struct_pb2.py +4 -4
- py2docfx/venv/venv1/Lib/site-packages/google/protobuf/symbol_database.py +0 -18
- py2docfx/venv/venv1/Lib/site-packages/google/protobuf/text_format.py +8 -3
- py2docfx/venv/venv1/Lib/site-packages/google/protobuf/timestamp_pb2.py +4 -4
- py2docfx/venv/venv1/Lib/site-packages/google/protobuf/type_pb2.py +4 -4
- py2docfx/venv/venv1/Lib/site-packages/google/protobuf/unknown_fields.py +3 -4
- py2docfx/venv/venv1/Lib/site-packages/google/protobuf/wrappers_pb2.py +4 -4
- py2docfx/venv/venv1/Lib/site-packages/msal/__init__.py +1 -1
- py2docfx/venv/venv1/Lib/site-packages/msal/application.py +51 -17
- py2docfx/venv/venv1/Lib/site-packages/msal/broker.py +18 -4
- py2docfx/venv/venv1/Lib/site-packages/msal/cloudshell.py +5 -1
- py2docfx/venv/venv1/Lib/site-packages/msal/managed_identity.py +5 -4
- py2docfx/venv/venv1/Lib/site-packages/msal/sku.py +6 -0
- py2docfx/venv/venv1/Lib/site-packages/msal/token_cache.py +31 -10
- py2docfx/venv/venv1/Lib/site-packages/msal_extensions/__init__.py +2 -3
- py2docfx/venv/venv1/Lib/site-packages/msal_extensions/cache_lock.py +4 -1
- py2docfx/venv/venv1/Lib/site-packages/msal_extensions/filelock.py +62 -0
- py2docfx/venv/venv1/Lib/site-packages/msal_extensions/libsecret.py +1 -1
- py2docfx/venv/venv1/Lib/site-packages/msal_extensions/token_cache.py +7 -1
- py2docfx/venv/venv1/Lib/site-packages/setuptools/_core_metadata.py +21 -5
- py2docfx/venv/venv1/Lib/site-packages/setuptools/_distutils/_msvccompiler.py +2 -0
- py2docfx/venv/venv1/Lib/site-packages/setuptools/_distutils/ccompiler.py +5 -2
- py2docfx/venv/venv1/Lib/site-packages/setuptools/_distutils/command/__init__.py +27 -8
- py2docfx/venv/venv1/Lib/site-packages/setuptools/_distutils/command/build.py +1 -6
- py2docfx/venv/venv1/Lib/site-packages/setuptools/_distutils/command/build_clib.py +1 -9
- py2docfx/venv/venv1/Lib/site-packages/setuptools/_distutils/command/build_ext.py +1 -8
- py2docfx/venv/venv1/Lib/site-packages/setuptools/_distutils/command/check.py +1 -1
- py2docfx/venv/venv1/Lib/site-packages/setuptools/_distutils/command/config.py +0 -2
- py2docfx/venv/venv1/Lib/site-packages/setuptools/_distutils/command/install.py +8 -17
- py2docfx/venv/venv1/Lib/site-packages/setuptools/_distutils/compat/numpy.py +2 -0
- py2docfx/venv/venv1/Lib/site-packages/setuptools/_distutils/compilers/C/base.py +8 -5
- py2docfx/venv/venv1/Lib/site-packages/setuptools/_distutils/compilers/C/msvc.py +1 -1
- py2docfx/venv/venv1/Lib/site-packages/setuptools/_distutils/compilers/C/unix.py +15 -1
- py2docfx/venv/venv1/Lib/site-packages/setuptools/_distutils/dist.py +2 -1
- py2docfx/venv/venv1/Lib/site-packages/setuptools/_distutils/sysconfig.py +0 -10
- py2docfx/venv/venv1/Lib/site-packages/setuptools/_distutils/tests/test_build_ext.py +60 -5
- py2docfx/venv/venv1/Lib/site-packages/setuptools/_distutils/unixccompiler.py +6 -0
- py2docfx/venv/venv1/Lib/site-packages/setuptools/_distutils/util.py +7 -6
- py2docfx/venv/venv1/Lib/site-packages/setuptools/_normalization.py +29 -0
- py2docfx/venv/venv1/Lib/site-packages/setuptools/_vendor/wheel/__init__.py +1 -1
- py2docfx/venv/venv1/Lib/site-packages/setuptools/_vendor/wheel/_bdist_wheel.py +613 -0
- py2docfx/venv/venv1/Lib/site-packages/setuptools/_vendor/wheel/_setuptools_logging.py +2 -2
- py2docfx/venv/venv1/Lib/site-packages/setuptools/_vendor/wheel/bdist_wheel.py +25 -594
- py2docfx/venv/venv1/Lib/site-packages/setuptools/_vendor/wheel/cli/__init__.py +6 -6
- py2docfx/venv/venv1/Lib/site-packages/setuptools/_vendor/wheel/cli/convert.py +282 -223
- py2docfx/venv/venv1/Lib/site-packages/setuptools/_vendor/wheel/macosx_libfile.py +22 -9
- py2docfx/venv/venv1/Lib/site-packages/setuptools/_vendor/wheel/metadata.py +16 -13
- py2docfx/venv/venv1/Lib/site-packages/setuptools/_vendor/wheel/util.py +0 -9
- py2docfx/venv/venv1/Lib/site-packages/setuptools/_vendor/wheel/wheelfile.py +40 -9
- py2docfx/venv/venv1/Lib/site-packages/setuptools/command/bdist_wheel.py +6 -2
- py2docfx/venv/venv1/Lib/site-packages/setuptools/config/_apply_pyprojecttoml.py +48 -11
- py2docfx/venv/venv1/Lib/site-packages/setuptools/config/_validate_pyproject/extra_validations.py +31 -1
- py2docfx/venv/venv1/Lib/site-packages/setuptools/config/_validate_pyproject/fastjsonschema_validations.py +222 -129
- py2docfx/venv/venv1/Lib/site-packages/setuptools/config/_validate_pyproject/formats.py +30 -3
- py2docfx/venv/venv1/Lib/site-packages/setuptools/dist.py +115 -9
- py2docfx/venv/venv1/Lib/site-packages/setuptools/msvc.py +12 -3
- py2docfx/venv/venv1/Lib/site-packages/setuptools/tests/config/test_apply_pyprojecttoml.py +246 -13
- py2docfx/venv/venv1/Lib/site-packages/setuptools/tests/test_bdist_wheel.py +93 -8
- py2docfx/venv/venv1/Lib/site-packages/setuptools/tests/test_build_meta.py +17 -4
- py2docfx/venv/venv1/Lib/site-packages/setuptools/tests/test_core_metadata.py +45 -0
- py2docfx/venv/venv1/Lib/site-packages/setuptools/tests/test_egg_info.py +24 -4
- py2docfx/venv/venv1/Lib/site-packages/setuptools/tests/test_sdist.py +13 -1
- {py2docfx-0.1.15.dev2025736.dist-info → py2docfx-0.1.15.dev2038852.dist-info}/METADATA +1 -1
- {py2docfx-0.1.15.dev2025736.dist-info → py2docfx-0.1.15.dev2038852.dist-info}/RECORD +136 -593
- py2docfx/docfx_yaml/tests/test_process_doctree.py +0 -120
- py2docfx/venv/venv1/Lib/site-packages/adodbapi/__init__.py +0 -82
- py2docfx/venv/venv1/Lib/site-packages/adodbapi/ado_consts.py +0 -283
- py2docfx/venv/venv1/Lib/site-packages/adodbapi/adodbapi.py +0 -1153
- py2docfx/venv/venv1/Lib/site-packages/adodbapi/apibase.py +0 -723
- py2docfx/venv/venv1/Lib/site-packages/adodbapi/examples/db_print.py +0 -72
- py2docfx/venv/venv1/Lib/site-packages/adodbapi/examples/db_table_names.py +0 -21
- py2docfx/venv/venv1/Lib/site-packages/adodbapi/examples/xls_read.py +0 -41
- py2docfx/venv/venv1/Lib/site-packages/adodbapi/examples/xls_write.py +0 -41
- py2docfx/venv/venv1/Lib/site-packages/adodbapi/is64bit.py +0 -34
- py2docfx/venv/venv1/Lib/site-packages/adodbapi/process_connect_string.py +0 -137
- py2docfx/venv/venv1/Lib/site-packages/adodbapi/schema_table.py +0 -16
- py2docfx/venv/venv1/Lib/site-packages/adodbapi/setup.py +0 -68
- py2docfx/venv/venv1/Lib/site-packages/adodbapi/test/adodbapitest.py +0 -1547
- py2docfx/venv/venv1/Lib/site-packages/adodbapi/test/adodbapitestconfig.py +0 -184
- py2docfx/venv/venv1/Lib/site-packages/adodbapi/test/dbapi20.py +0 -879
- py2docfx/venv/venv1/Lib/site-packages/adodbapi/test/is64bit.py +0 -34
- py2docfx/venv/venv1/Lib/site-packages/adodbapi/test/setuptestframework.py +0 -98
- py2docfx/venv/venv1/Lib/site-packages/adodbapi/test/test_adodbapi_dbapi20.py +0 -195
- py2docfx/venv/venv1/Lib/site-packages/adodbapi/test/tryconnection.py +0 -30
- py2docfx/venv/venv1/Lib/site-packages/google/protobuf/internal/_parameterized.py +0 -420
- py2docfx/venv/venv1/Lib/site-packages/google/protobuf/service.py +0 -213
- py2docfx/venv/venv1/Lib/site-packages/isapi/__init__.py +0 -39
- py2docfx/venv/venv1/Lib/site-packages/isapi/install.py +0 -809
- py2docfx/venv/venv1/Lib/site-packages/isapi/isapicon.py +0 -121
- py2docfx/venv/venv1/Lib/site-packages/isapi/samples/advanced.py +0 -218
- py2docfx/venv/venv1/Lib/site-packages/isapi/samples/redirector.py +0 -116
- py2docfx/venv/venv1/Lib/site-packages/isapi/samples/redirector_asynch.py +0 -85
- py2docfx/venv/venv1/Lib/site-packages/isapi/samples/redirector_with_filter.py +0 -162
- py2docfx/venv/venv1/Lib/site-packages/isapi/samples/test.py +0 -195
- py2docfx/venv/venv1/Lib/site-packages/isapi/simple.py +0 -73
- py2docfx/venv/venv1/Lib/site-packages/isapi/test/extension_simple.py +0 -114
- py2docfx/venv/venv1/Lib/site-packages/isapi/threaded_extension.py +0 -191
- py2docfx/venv/venv1/Lib/site-packages/portalocker/__about__.py +0 -6
- py2docfx/venv/venv1/Lib/site-packages/portalocker/__init__.py +0 -79
- py2docfx/venv/venv1/Lib/site-packages/portalocker/__main__.py +0 -122
- py2docfx/venv/venv1/Lib/site-packages/portalocker/constants.py +0 -59
- py2docfx/venv/venv1/Lib/site-packages/portalocker/exceptions.py +0 -27
- py2docfx/venv/venv1/Lib/site-packages/portalocker/portalocker.py +0 -154
- py2docfx/venv/venv1/Lib/site-packages/portalocker/redis.py +0 -236
- py2docfx/venv/venv1/Lib/site-packages/portalocker/utils.py +0 -569
- py2docfx/venv/venv1/Lib/site-packages/pythoncom.py +0 -4
- py2docfx/venv/venv1/Lib/site-packages/pythonwin/pywin/Demos/app/basictimerapp.py +0 -258
- py2docfx/venv/venv1/Lib/site-packages/pythonwin/pywin/Demos/app/customprint.py +0 -183
- py2docfx/venv/venv1/Lib/site-packages/pythonwin/pywin/Demos/app/demoutils.py +0 -63
- py2docfx/venv/venv1/Lib/site-packages/pythonwin/pywin/Demos/app/dlgappdemo.py +0 -51
- py2docfx/venv/venv1/Lib/site-packages/pythonwin/pywin/Demos/app/dojobapp.py +0 -71
- py2docfx/venv/venv1/Lib/site-packages/pythonwin/pywin/Demos/app/helloapp.py +0 -53
- py2docfx/venv/venv1/Lib/site-packages/pythonwin/pywin/Demos/cmdserver.py +0 -113
- py2docfx/venv/venv1/Lib/site-packages/pythonwin/pywin/Demos/createwin.py +0 -114
- py2docfx/venv/venv1/Lib/site-packages/pythonwin/pywin/Demos/demoutils.py +0 -65
- py2docfx/venv/venv1/Lib/site-packages/pythonwin/pywin/Demos/dibdemo.py +0 -73
- py2docfx/venv/venv1/Lib/site-packages/pythonwin/pywin/Demos/dlgtest.py +0 -145
- py2docfx/venv/venv1/Lib/site-packages/pythonwin/pywin/Demos/dyndlg.py +0 -104
- py2docfx/venv/venv1/Lib/site-packages/pythonwin/pywin/Demos/fontdemo.py +0 -85
- py2docfx/venv/venv1/Lib/site-packages/pythonwin/pywin/Demos/guidemo.py +0 -53
- py2docfx/venv/venv1/Lib/site-packages/pythonwin/pywin/Demos/hiertest.py +0 -138
- py2docfx/venv/venv1/Lib/site-packages/pythonwin/pywin/Demos/menutest.py +0 -13
- py2docfx/venv/venv1/Lib/site-packages/pythonwin/pywin/Demos/objdoc.py +0 -57
- py2docfx/venv/venv1/Lib/site-packages/pythonwin/pywin/Demos/ocx/demoutils.py +0 -63
- py2docfx/venv/venv1/Lib/site-packages/pythonwin/pywin/Demos/ocx/flash.py +0 -95
- py2docfx/venv/venv1/Lib/site-packages/pythonwin/pywin/Demos/ocx/msoffice.py +0 -159
- py2docfx/venv/venv1/Lib/site-packages/pythonwin/pywin/Demos/ocx/ocxserialtest.py +0 -132
- py2docfx/venv/venv1/Lib/site-packages/pythonwin/pywin/Demos/ocx/ocxtest.py +0 -243
- py2docfx/venv/venv1/Lib/site-packages/pythonwin/pywin/Demos/ocx/webbrowser.py +0 -72
- py2docfx/venv/venv1/Lib/site-packages/pythonwin/pywin/Demos/openGLDemo.py +0 -415
- py2docfx/venv/venv1/Lib/site-packages/pythonwin/pywin/Demos/progressbar.py +0 -105
- py2docfx/venv/venv1/Lib/site-packages/pythonwin/pywin/Demos/sliderdemo.py +0 -76
- py2docfx/venv/venv1/Lib/site-packages/pythonwin/pywin/Demos/splittst.py +0 -79
- py2docfx/venv/venv1/Lib/site-packages/pythonwin/pywin/Demos/threadedgui.py +0 -189
- py2docfx/venv/venv1/Lib/site-packages/pythonwin/pywin/Demos/toolbar.py +0 -105
- py2docfx/venv/venv1/Lib/site-packages/pythonwin/pywin/__init__.py +0 -3
- py2docfx/venv/venv1/Lib/site-packages/pythonwin/pywin/debugger/__init__.py +0 -133
- py2docfx/venv/venv1/Lib/site-packages/pythonwin/pywin/debugger/configui.py +0 -34
- py2docfx/venv/venv1/Lib/site-packages/pythonwin/pywin/debugger/dbgcon.py +0 -31
- py2docfx/venv/venv1/Lib/site-packages/pythonwin/pywin/debugger/dbgpyapp.py +0 -48
- py2docfx/venv/venv1/Lib/site-packages/pythonwin/pywin/debugger/debugger.py +0 -1097
- py2docfx/venv/venv1/Lib/site-packages/pythonwin/pywin/debugger/fail.py +0 -54
- py2docfx/venv/venv1/Lib/site-packages/pythonwin/pywin/dialogs/__init__.py +0 -0
- py2docfx/venv/venv1/Lib/site-packages/pythonwin/pywin/dialogs/ideoptions.py +0 -136
- py2docfx/venv/venv1/Lib/site-packages/pythonwin/pywin/dialogs/list.py +0 -146
- py2docfx/venv/venv1/Lib/site-packages/pythonwin/pywin/dialogs/login.py +0 -155
- py2docfx/venv/venv1/Lib/site-packages/pythonwin/pywin/dialogs/status.py +0 -242
- py2docfx/venv/venv1/Lib/site-packages/pythonwin/pywin/docking/DockingBar.py +0 -676
- py2docfx/venv/venv1/Lib/site-packages/pythonwin/pywin/docking/__init__.py +0 -0
- py2docfx/venv/venv1/Lib/site-packages/pythonwin/pywin/framework/__init__.py +0 -0
- py2docfx/venv/venv1/Lib/site-packages/pythonwin/pywin/framework/app.py +0 -411
- py2docfx/venv/venv1/Lib/site-packages/pythonwin/pywin/framework/bitmap.py +0 -168
- py2docfx/venv/venv1/Lib/site-packages/pythonwin/pywin/framework/cmdline.py +0 -54
- py2docfx/venv/venv1/Lib/site-packages/pythonwin/pywin/framework/dbgcommands.py +0 -188
- py2docfx/venv/venv1/Lib/site-packages/pythonwin/pywin/framework/dlgappcore.py +0 -76
- py2docfx/venv/venv1/Lib/site-packages/pythonwin/pywin/framework/editor/ModuleBrowser.py +0 -235
- py2docfx/venv/venv1/Lib/site-packages/pythonwin/pywin/framework/editor/__init__.py +0 -105
- py2docfx/venv/venv1/Lib/site-packages/pythonwin/pywin/framework/editor/color/__init__.py +0 -0
- py2docfx/venv/venv1/Lib/site-packages/pythonwin/pywin/framework/editor/color/coloreditor.py +0 -646
- py2docfx/venv/venv1/Lib/site-packages/pythonwin/pywin/framework/editor/configui.py +0 -299
- py2docfx/venv/venv1/Lib/site-packages/pythonwin/pywin/framework/editor/document.py +0 -379
- py2docfx/venv/venv1/Lib/site-packages/pythonwin/pywin/framework/editor/editor.py +0 -511
- py2docfx/venv/venv1/Lib/site-packages/pythonwin/pywin/framework/editor/frame.py +0 -74
- py2docfx/venv/venv1/Lib/site-packages/pythonwin/pywin/framework/editor/template.py +0 -59
- py2docfx/venv/venv1/Lib/site-packages/pythonwin/pywin/framework/editor/vss.py +0 -104
- py2docfx/venv/venv1/Lib/site-packages/pythonwin/pywin/framework/help.py +0 -173
- py2docfx/venv/venv1/Lib/site-packages/pythonwin/pywin/framework/interact.py +0 -995
- py2docfx/venv/venv1/Lib/site-packages/pythonwin/pywin/framework/intpyapp.py +0 -552
- py2docfx/venv/venv1/Lib/site-packages/pythonwin/pywin/framework/intpydde.py +0 -65
- py2docfx/venv/venv1/Lib/site-packages/pythonwin/pywin/framework/scriptutils.py +0 -684
- py2docfx/venv/venv1/Lib/site-packages/pythonwin/pywin/framework/sgrepmdi.py +0 -749
- py2docfx/venv/venv1/Lib/site-packages/pythonwin/pywin/framework/startup.py +0 -70
- py2docfx/venv/venv1/Lib/site-packages/pythonwin/pywin/framework/stdin.py +0 -172
- py2docfx/venv/venv1/Lib/site-packages/pythonwin/pywin/framework/toolmenu.py +0 -279
- py2docfx/venv/venv1/Lib/site-packages/pythonwin/pywin/framework/window.py +0 -14
- py2docfx/venv/venv1/Lib/site-packages/pythonwin/pywin/framework/winout.py +0 -589
- py2docfx/venv/venv1/Lib/site-packages/pythonwin/pywin/idle/AutoExpand.py +0 -95
- py2docfx/venv/venv1/Lib/site-packages/pythonwin/pywin/idle/AutoIndent.py +0 -536
- py2docfx/venv/venv1/Lib/site-packages/pythonwin/pywin/idle/CallTips.py +0 -216
- py2docfx/venv/venv1/Lib/site-packages/pythonwin/pywin/idle/FormatParagraph.py +0 -166
- py2docfx/venv/venv1/Lib/site-packages/pythonwin/pywin/idle/IdleHistory.py +0 -87
- py2docfx/venv/venv1/Lib/site-packages/pythonwin/pywin/idle/PyParse.py +0 -585
- py2docfx/venv/venv1/Lib/site-packages/pythonwin/pywin/idle/__init__.py +0 -1
- py2docfx/venv/venv1/Lib/site-packages/pythonwin/pywin/mfc/__init__.py +0 -0
- py2docfx/venv/venv1/Lib/site-packages/pythonwin/pywin/mfc/activex.py +0 -79
- py2docfx/venv/venv1/Lib/site-packages/pythonwin/pywin/mfc/afxres.py +0 -501
- py2docfx/venv/venv1/Lib/site-packages/pythonwin/pywin/mfc/dialog.py +0 -277
- py2docfx/venv/venv1/Lib/site-packages/pythonwin/pywin/mfc/docview.py +0 -151
- py2docfx/venv/venv1/Lib/site-packages/pythonwin/pywin/mfc/object.py +0 -66
- py2docfx/venv/venv1/Lib/site-packages/pythonwin/pywin/mfc/thread.py +0 -25
- py2docfx/venv/venv1/Lib/site-packages/pythonwin/pywin/mfc/window.py +0 -50
- py2docfx/venv/venv1/Lib/site-packages/pythonwin/pywin/scintilla/IDLEenvironment.py +0 -593
- py2docfx/venv/venv1/Lib/site-packages/pythonwin/pywin/scintilla/__init__.py +0 -1
- py2docfx/venv/venv1/Lib/site-packages/pythonwin/pywin/scintilla/bindings.py +0 -180
- py2docfx/venv/venv1/Lib/site-packages/pythonwin/pywin/scintilla/config.py +0 -363
- py2docfx/venv/venv1/Lib/site-packages/pythonwin/pywin/scintilla/configui.py +0 -291
- py2docfx/venv/venv1/Lib/site-packages/pythonwin/pywin/scintilla/control.py +0 -565
- py2docfx/venv/venv1/Lib/site-packages/pythonwin/pywin/scintilla/document.py +0 -312
- py2docfx/venv/venv1/Lib/site-packages/pythonwin/pywin/scintilla/find.py +0 -511
- py2docfx/venv/venv1/Lib/site-packages/pythonwin/pywin/scintilla/formatter.py +0 -704
- py2docfx/venv/venv1/Lib/site-packages/pythonwin/pywin/scintilla/keycodes.py +0 -190
- py2docfx/venv/venv1/Lib/site-packages/pythonwin/pywin/scintilla/scintillacon.py +0 -3083
- py2docfx/venv/venv1/Lib/site-packages/pythonwin/pywin/scintilla/view.py +0 -841
- py2docfx/venv/venv1/Lib/site-packages/pythonwin/pywin/tools/TraceCollector.py +0 -79
- py2docfx/venv/venv1/Lib/site-packages/pythonwin/pywin/tools/__init__.py +0 -0
- py2docfx/venv/venv1/Lib/site-packages/pythonwin/pywin/tools/browseProjects.py +0 -323
- py2docfx/venv/venv1/Lib/site-packages/pythonwin/pywin/tools/browser.py +0 -494
- py2docfx/venv/venv1/Lib/site-packages/pythonwin/pywin/tools/hierlist.py +0 -353
- py2docfx/venv/venv1/Lib/site-packages/pythonwin/pywin/tools/regedit.py +0 -382
- py2docfx/venv/venv1/Lib/site-packages/pythonwin/pywin/tools/regpy.py +0 -80
- py2docfx/venv/venv1/Lib/site-packages/win32/Demos/BackupRead_BackupWrite.py +0 -119
- py2docfx/venv/venv1/Lib/site-packages/win32/Demos/BackupSeek_streamheaders.py +0 -137
- py2docfx/venv/venv1/Lib/site-packages/win32/Demos/CopyFileEx.py +0 -57
- py2docfx/venv/venv1/Lib/site-packages/win32/Demos/CreateFileTransacted_MiniVersion.py +0 -122
- py2docfx/venv/venv1/Lib/site-packages/win32/Demos/EvtFormatMessage.py +0 -83
- py2docfx/venv/venv1/Lib/site-packages/win32/Demos/EvtSubscribe_pull.py +0 -28
- py2docfx/venv/venv1/Lib/site-packages/win32/Demos/EvtSubscribe_push.py +0 -32
- py2docfx/venv/venv1/Lib/site-packages/win32/Demos/FileSecurityTest.py +0 -137
- py2docfx/venv/venv1/Lib/site-packages/win32/Demos/GetSaveFileName.py +0 -43
- py2docfx/venv/venv1/Lib/site-packages/win32/Demos/NetValidatePasswordPolicy.py +0 -127
- py2docfx/venv/venv1/Lib/site-packages/win32/Demos/OpenEncryptedFileRaw.py +0 -66
- py2docfx/venv/venv1/Lib/site-packages/win32/Demos/RegCreateKeyTransacted.py +0 -60
- py2docfx/venv/venv1/Lib/site-packages/win32/Demos/RegRestoreKey.py +0 -71
- py2docfx/venv/venv1/Lib/site-packages/win32/Demos/SystemParametersInfo.py +0 -210
- py2docfx/venv/venv1/Lib/site-packages/win32/Demos/c_extension/setup.py +0 -26
- py2docfx/venv/venv1/Lib/site-packages/win32/Demos/dde/ddeclient.py +0 -18
- py2docfx/venv/venv1/Lib/site-packages/win32/Demos/dde/ddeserver.py +0 -42
- py2docfx/venv/venv1/Lib/site-packages/win32/Demos/desktopmanager.py +0 -246
- py2docfx/venv/venv1/Lib/site-packages/win32/Demos/eventLogDemo.py +0 -143
- py2docfx/venv/venv1/Lib/site-packages/win32/Demos/getfilever.py +0 -33
- py2docfx/venv/venv1/Lib/site-packages/win32/Demos/mmapfile_demo.py +0 -101
- py2docfx/venv/venv1/Lib/site-packages/win32/Demos/pipes/cat.py +0 -17
- py2docfx/venv/venv1/Lib/site-packages/win32/Demos/pipes/runproc.py +0 -114
- py2docfx/venv/venv1/Lib/site-packages/win32/Demos/print_desktop.py +0 -113
- py2docfx/venv/venv1/Lib/site-packages/win32/Demos/rastest.py +0 -166
- py2docfx/venv/venv1/Lib/site-packages/win32/Demos/security/GetTokenInformation.py +0 -110
- py2docfx/venv/venv1/Lib/site-packages/win32/Demos/security/account_rights.py +0 -49
- py2docfx/venv/venv1/Lib/site-packages/win32/Demos/security/explicit_entries.py +0 -170
- py2docfx/venv/venv1/Lib/site-packages/win32/Demos/security/get_policy_info.py +0 -39
- py2docfx/venv/venv1/Lib/site-packages/win32/Demos/security/list_rights.py +0 -35
- py2docfx/venv/venv1/Lib/site-packages/win32/Demos/security/localized_names.py +0 -70
- py2docfx/venv/venv1/Lib/site-packages/win32/Demos/security/lsaregevent.py +0 -14
- py2docfx/venv/venv1/Lib/site-packages/win32/Demos/security/lsastore.py +0 -12
- py2docfx/venv/venv1/Lib/site-packages/win32/Demos/security/query_information.py +0 -25
- py2docfx/venv/venv1/Lib/site-packages/win32/Demos/security/regsave_sa.py +0 -61
- py2docfx/venv/venv1/Lib/site-packages/win32/Demos/security/regsecurity.py +0 -36
- py2docfx/venv/venv1/Lib/site-packages/win32/Demos/security/sa_inherit.py +0 -8
- py2docfx/venv/venv1/Lib/site-packages/win32/Demos/security/security_enums.py +0 -336
- py2docfx/venv/venv1/Lib/site-packages/win32/Demos/security/set_file_audit.py +0 -106
- py2docfx/venv/venv1/Lib/site-packages/win32/Demos/security/set_file_owner.py +0 -73
- py2docfx/venv/venv1/Lib/site-packages/win32/Demos/security/set_policy_info.py +0 -25
- py2docfx/venv/venv1/Lib/site-packages/win32/Demos/security/setkernelobjectsecurity.py +0 -134
- py2docfx/venv/venv1/Lib/site-packages/win32/Demos/security/setnamedsecurityinfo.py +0 -131
- py2docfx/venv/venv1/Lib/site-packages/win32/Demos/security/setsecurityinfo.py +0 -131
- py2docfx/venv/venv1/Lib/site-packages/win32/Demos/security/setuserobjectsecurity.py +0 -102
- py2docfx/venv/venv1/Lib/site-packages/win32/Demos/security/sspi/fetch_url.py +0 -158
- py2docfx/venv/venv1/Lib/site-packages/win32/Demos/security/sspi/simple_auth.py +0 -72
- py2docfx/venv/venv1/Lib/site-packages/win32/Demos/security/sspi/socket_server.py +0 -199
- py2docfx/venv/venv1/Lib/site-packages/win32/Demos/security/sspi/validate_password.py +0 -41
- py2docfx/venv/venv1/Lib/site-packages/win32/Demos/service/nativePipeTestService.py +0 -63
- py2docfx/venv/venv1/Lib/site-packages/win32/Demos/service/pipeTestService.py +0 -185
- py2docfx/venv/venv1/Lib/site-packages/win32/Demos/service/pipeTestServiceClient.py +0 -158
- py2docfx/venv/venv1/Lib/site-packages/win32/Demos/service/serviceEvents.py +0 -98
- py2docfx/venv/venv1/Lib/site-packages/win32/Demos/timer_demo.py +0 -72
- py2docfx/venv/venv1/Lib/site-packages/win32/Demos/win32clipboardDemo.py +0 -155
- py2docfx/venv/venv1/Lib/site-packages/win32/Demos/win32clipboard_bitmapdemo.py +0 -117
- py2docfx/venv/venv1/Lib/site-packages/win32/Demos/win32comport_demo.py +0 -174
- py2docfx/venv/venv1/Lib/site-packages/win32/Demos/win32console_demo.py +0 -132
- py2docfx/venv/venv1/Lib/site-packages/win32/Demos/win32cred_demo.py +0 -82
- py2docfx/venv/venv1/Lib/site-packages/win32/Demos/win32fileDemo.py +0 -41
- py2docfx/venv/venv1/Lib/site-packages/win32/Demos/win32gui_demo.py +0 -177
- py2docfx/venv/venv1/Lib/site-packages/win32/Demos/win32gui_devicenotify.py +0 -106
- py2docfx/venv/venv1/Lib/site-packages/win32/Demos/win32gui_dialog.py +0 -445
- py2docfx/venv/venv1/Lib/site-packages/win32/Demos/win32gui_menu.py +0 -464
- py2docfx/venv/venv1/Lib/site-packages/win32/Demos/win32gui_taskbar.py +0 -136
- py2docfx/venv/venv1/Lib/site-packages/win32/Demos/win32netdemo.py +0 -272
- py2docfx/venv/venv1/Lib/site-packages/win32/Demos/win32rcparser_demo.py +0 -86
- py2docfx/venv/venv1/Lib/site-packages/win32/Demos/win32servicedemo.py +0 -23
- py2docfx/venv/venv1/Lib/site-packages/win32/Demos/win32ts_logoff_disconnected.py +0 -25
- py2docfx/venv/venv1/Lib/site-packages/win32/Demos/win32wnet/testwnet.py +0 -123
- py2docfx/venv/venv1/Lib/site-packages/win32/Demos/win32wnet/winnetwk.py +0 -100
- py2docfx/venv/venv1/Lib/site-packages/win32/Demos/winprocess.py +0 -230
- py2docfx/venv/venv1/Lib/site-packages/win32/lib/_win32verstamp_pywin32ctypes.py +0 -164
- py2docfx/venv/venv1/Lib/site-packages/win32/lib/afxres.py +0 -8
- py2docfx/venv/venv1/Lib/site-packages/win32/lib/commctrl.py +0 -1551
- py2docfx/venv/venv1/Lib/site-packages/win32/lib/mmsystem.py +0 -956
- py2docfx/venv/venv1/Lib/site-packages/win32/lib/netbios.py +0 -293
- py2docfx/venv/venv1/Lib/site-packages/win32/lib/ntsecuritycon.py +0 -731
- py2docfx/venv/venv1/Lib/site-packages/win32/lib/pywin32_bootstrap.py +0 -21
- py2docfx/venv/venv1/Lib/site-packages/win32/lib/pywin32_testutil.py +0 -291
- py2docfx/venv/venv1/Lib/site-packages/win32/lib/pywintypes.py +0 -124
- py2docfx/venv/venv1/Lib/site-packages/win32/lib/rasutil.py +0 -40
- py2docfx/venv/venv1/Lib/site-packages/win32/lib/regcheck.py +0 -161
- py2docfx/venv/venv1/Lib/site-packages/win32/lib/regutil.py +0 -395
- py2docfx/venv/venv1/Lib/site-packages/win32/lib/sspi.py +0 -413
- py2docfx/venv/venv1/Lib/site-packages/win32/lib/sspicon.py +0 -477
- py2docfx/venv/venv1/Lib/site-packages/win32/lib/win2kras.py +0 -14
- py2docfx/venv/venv1/Lib/site-packages/win32/lib/win32con.py +0 -5064
- py2docfx/venv/venv1/Lib/site-packages/win32/lib/win32cryptcon.py +0 -1922
- py2docfx/venv/venv1/Lib/site-packages/win32/lib/win32evtlogutil.py +0 -225
- py2docfx/venv/venv1/Lib/site-packages/win32/lib/win32gui_struct.py +0 -957
- py2docfx/venv/venv1/Lib/site-packages/win32/lib/win32inetcon.py +0 -1086
- py2docfx/venv/venv1/Lib/site-packages/win32/lib/win32netcon.py +0 -627
- py2docfx/venv/venv1/Lib/site-packages/win32/lib/win32pdhquery.py +0 -570
- py2docfx/venv/venv1/Lib/site-packages/win32/lib/win32pdhutil.py +0 -212
- py2docfx/venv/venv1/Lib/site-packages/win32/lib/win32rcparser.py +0 -674
- py2docfx/venv/venv1/Lib/site-packages/win32/lib/win32serviceutil.py +0 -1073
- py2docfx/venv/venv1/Lib/site-packages/win32/lib/win32timezone.py +0 -1201
- py2docfx/venv/venv1/Lib/site-packages/win32/lib/win32traceutil.py +0 -59
- py2docfx/venv/venv1/Lib/site-packages/win32/lib/win32verstamp.py +0 -235
- py2docfx/venv/venv1/Lib/site-packages/win32/lib/winerror.py +0 -7362
- py2docfx/venv/venv1/Lib/site-packages/win32/lib/winioctlcon.py +0 -1079
- py2docfx/venv/venv1/Lib/site-packages/win32/lib/winnt.py +0 -1347
- py2docfx/venv/venv1/Lib/site-packages/win32/lib/winperf.py +0 -236
- py2docfx/venv/venv1/Lib/site-packages/win32/lib/winxptheme.py +0 -8
- py2docfx/venv/venv1/Lib/site-packages/win32/scripts/ControlService.py +0 -594
- py2docfx/venv/venv1/Lib/site-packages/win32/scripts/VersionStamp/BrandProject.py +0 -97
- py2docfx/venv/venv1/Lib/site-packages/win32/scripts/VersionStamp/bulkstamp.py +0 -156
- py2docfx/venv/venv1/Lib/site-packages/win32/scripts/VersionStamp/vssutil.py +0 -201
- py2docfx/venv/venv1/Lib/site-packages/win32/scripts/backupEventLog.py +0 -46
- py2docfx/venv/venv1/Lib/site-packages/win32/scripts/h2py.py +0 -194
- py2docfx/venv/venv1/Lib/site-packages/win32/scripts/killProcName.py +0 -62
- py2docfx/venv/venv1/Lib/site-packages/win32/scripts/pywin32_postinstall.py +0 -733
- py2docfx/venv/venv1/Lib/site-packages/win32/scripts/pywin32_testall.py +0 -120
- py2docfx/venv/venv1/Lib/site-packages/win32/scripts/rasutil.py +0 -98
- py2docfx/venv/venv1/Lib/site-packages/win32/scripts/regsetup.py +0 -607
- py2docfx/venv/venv1/Lib/site-packages/win32/scripts/setup_d.py +0 -111
- py2docfx/venv/venv1/Lib/site-packages/win32/test/handles.py +0 -175
- py2docfx/venv/venv1/Lib/site-packages/win32/test/test_clipboard.py +0 -137
- py2docfx/venv/venv1/Lib/site-packages/win32/test/test_exceptions.py +0 -213
- py2docfx/venv/venv1/Lib/site-packages/win32/test/test_odbc.py +0 -264
- py2docfx/venv/venv1/Lib/site-packages/win32/test/test_pywintypes.py +0 -111
- py2docfx/venv/venv1/Lib/site-packages/win32/test/test_security.py +0 -166
- py2docfx/venv/venv1/Lib/site-packages/win32/test/test_sspi.py +0 -229
- py2docfx/venv/venv1/Lib/site-packages/win32/test/test_win32api.py +0 -273
- py2docfx/venv/venv1/Lib/site-packages/win32/test/test_win32clipboard.py +0 -59
- py2docfx/venv/venv1/Lib/site-packages/win32/test/test_win32cred.py +0 -91
- py2docfx/venv/venv1/Lib/site-packages/win32/test/test_win32crypt.py +0 -144
- py2docfx/venv/venv1/Lib/site-packages/win32/test/test_win32event.py +0 -119
- py2docfx/venv/venv1/Lib/site-packages/win32/test/test_win32file.py +0 -1096
- py2docfx/venv/venv1/Lib/site-packages/win32/test/test_win32gui.py +0 -227
- py2docfx/venv/venv1/Lib/site-packages/win32/test/test_win32guistruct.py +0 -333
- py2docfx/venv/venv1/Lib/site-packages/win32/test/test_win32inet.py +0 -108
- py2docfx/venv/venv1/Lib/site-packages/win32/test/test_win32net.py +0 -23
- py2docfx/venv/venv1/Lib/site-packages/win32/test/test_win32pipe.py +0 -148
- py2docfx/venv/venv1/Lib/site-packages/win32/test/test_win32print.py +0 -24
- py2docfx/venv/venv1/Lib/site-packages/win32/test/test_win32profile.py +0 -19
- py2docfx/venv/venv1/Lib/site-packages/win32/test/test_win32rcparser.py +0 -70
- py2docfx/venv/venv1/Lib/site-packages/win32/test/test_win32timezone.py +0 -16
- py2docfx/venv/venv1/Lib/site-packages/win32/test/test_win32trace.py +0 -366
- py2docfx/venv/venv1/Lib/site-packages/win32/test/test_win32ts.py +0 -19
- py2docfx/venv/venv1/Lib/site-packages/win32/test/test_win32wnet.py +0 -174
- py2docfx/venv/venv1/Lib/site-packages/win32/test/testall.py +0 -223
- py2docfx/venv/venv1/Lib/site-packages/win32/winxpgui.py +0 -13
- py2docfx/venv/venv1/Lib/site-packages/win32com/__init__.py +0 -134
- py2docfx/venv/venv1/Lib/site-packages/win32com/client/CLSIDToClass.py +0 -60
- py2docfx/venv/venv1/Lib/site-packages/win32com/client/__init__.py +0 -717
- py2docfx/venv/venv1/Lib/site-packages/win32com/client/build.py +0 -771
- py2docfx/venv/venv1/Lib/site-packages/win32com/client/combrowse.py +0 -604
- py2docfx/venv/venv1/Lib/site-packages/win32com/client/connect.py +0 -48
- py2docfx/venv/venv1/Lib/site-packages/win32com/client/dynamic.py +0 -699
- py2docfx/venv/venv1/Lib/site-packages/win32com/client/gencache.py +0 -825
- py2docfx/venv/venv1/Lib/site-packages/win32com/client/genpy.py +0 -1350
- py2docfx/venv/venv1/Lib/site-packages/win32com/client/makepy.py +0 -453
- py2docfx/venv/venv1/Lib/site-packages/win32com/client/selecttlb.py +0 -182
- py2docfx/venv/venv1/Lib/site-packages/win32com/client/tlbrowse.py +0 -277
- py2docfx/venv/venv1/Lib/site-packages/win32com/client/util.py +0 -103
- py2docfx/venv/venv1/Lib/site-packages/win32com/demos/__init__.py +0 -0
- py2docfx/venv/venv1/Lib/site-packages/win32com/demos/connect.py +0 -96
- py2docfx/venv/venv1/Lib/site-packages/win32com/demos/dump_clipboard.py +0 -74
- py2docfx/venv/venv1/Lib/site-packages/win32com/demos/eventsApartmentThreaded.py +0 -98
- py2docfx/venv/venv1/Lib/site-packages/win32com/demos/eventsFreeThreaded.py +0 -92
- py2docfx/venv/venv1/Lib/site-packages/win32com/demos/excelAddin.py +0 -169
- py2docfx/venv/venv1/Lib/site-packages/win32com/demos/excelRTDServer.py +0 -434
- py2docfx/venv/venv1/Lib/site-packages/win32com/demos/iebutton.py +0 -214
- py2docfx/venv/venv1/Lib/site-packages/win32com/demos/ietoolbar.py +0 -368
- py2docfx/venv/venv1/Lib/site-packages/win32com/demos/outlookAddin.py +0 -135
- py2docfx/venv/venv1/Lib/site-packages/win32com/demos/trybag.py +0 -78
- py2docfx/venv/venv1/Lib/site-packages/win32com/makegw/__init__.py +0 -1
- py2docfx/venv/venv1/Lib/site-packages/win32com/makegw/makegw.py +0 -618
- py2docfx/venv/venv1/Lib/site-packages/win32com/makegw/makegwenum.py +0 -331
- py2docfx/venv/venv1/Lib/site-packages/win32com/makegw/makegwparse.py +0 -1017
- py2docfx/venv/venv1/Lib/site-packages/win32com/olectl.py +0 -70
- py2docfx/venv/venv1/Lib/site-packages/win32com/server/__init__.py +0 -1
- py2docfx/venv/venv1/Lib/site-packages/win32com/server/connect.py +0 -85
- py2docfx/venv/venv1/Lib/site-packages/win32com/server/dispatcher.py +0 -239
- py2docfx/venv/venv1/Lib/site-packages/win32com/server/exception.py +0 -99
- py2docfx/venv/venv1/Lib/site-packages/win32com/server/factory.py +0 -26
- py2docfx/venv/venv1/Lib/site-packages/win32com/server/localserver.py +0 -53
- py2docfx/venv/venv1/Lib/site-packages/win32com/server/policy.py +0 -803
- py2docfx/venv/venv1/Lib/site-packages/win32com/server/register.py +0 -677
- py2docfx/venv/venv1/Lib/site-packages/win32com/server/util.py +0 -229
- py2docfx/venv/venv1/Lib/site-packages/win32com/servers/PythonTools.py +0 -47
- py2docfx/venv/venv1/Lib/site-packages/win32com/servers/__init__.py +0 -0
- py2docfx/venv/venv1/Lib/site-packages/win32com/servers/dictionary.py +0 -133
- py2docfx/venv/venv1/Lib/site-packages/win32com/servers/interp.py +0 -59
- py2docfx/venv/venv1/Lib/site-packages/win32com/servers/perfmon.py +0 -36
- py2docfx/venv/venv1/Lib/site-packages/win32com/servers/test_pycomtest.py +0 -181
- py2docfx/venv/venv1/Lib/site-packages/win32com/storagecon.py +0 -142
- py2docfx/venv/venv1/Lib/site-packages/win32com/test/GenTestScripts.py +0 -95
- py2docfx/venv/venv1/Lib/site-packages/win32com/test/__init__.py +0 -1
- py2docfx/venv/venv1/Lib/site-packages/win32com/test/daodump.py +0 -88
- py2docfx/venv/venv1/Lib/site-packages/win32com/test/errorSemantics.py +0 -243
- py2docfx/venv/venv1/Lib/site-packages/win32com/test/pippo_server.py +0 -96
- py2docfx/venv/venv1/Lib/site-packages/win32com/test/policySemantics.py +0 -115
- py2docfx/venv/venv1/Lib/site-packages/win32com/test/testADOEvents.py +0 -100
- py2docfx/venv/venv1/Lib/site-packages/win32com/test/testAXScript.py +0 -44
- py2docfx/venv/venv1/Lib/site-packages/win32com/test/testAccess.py +0 -185
- py2docfx/venv/venv1/Lib/site-packages/win32com/test/testArrays.py +0 -99
- py2docfx/venv/venv1/Lib/site-packages/win32com/test/testClipboard.py +0 -169
- py2docfx/venv/venv1/Lib/site-packages/win32com/test/testCollections.py +0 -159
- py2docfx/venv/venv1/Lib/site-packages/win32com/test/testConversionErrors.py +0 -35
- py2docfx/venv/venv1/Lib/site-packages/win32com/test/testDCOM.py +0 -50
- py2docfx/venv/venv1/Lib/site-packages/win32com/test/testDates.py +0 -74
- py2docfx/venv/venv1/Lib/site-packages/win32com/test/testDictionary.py +0 -101
- py2docfx/venv/venv1/Lib/site-packages/win32com/test/testDynamic.py +0 -83
- py2docfx/venv/venv1/Lib/site-packages/win32com/test/testExchange.py +0 -121
- py2docfx/venv/venv1/Lib/site-packages/win32com/test/testExplorer.py +0 -139
- py2docfx/venv/venv1/Lib/site-packages/win32com/test/testGIT.py +0 -142
- py2docfx/venv/venv1/Lib/site-packages/win32com/test/testGatewayAddresses.py +0 -149
- py2docfx/venv/venv1/Lib/site-packages/win32com/test/testIterators.py +0 -140
- py2docfx/venv/venv1/Lib/site-packages/win32com/test/testMSOffice.py +0 -184
- py2docfx/venv/venv1/Lib/site-packages/win32com/test/testMSOfficeEvents.py +0 -138
- py2docfx/venv/venv1/Lib/site-packages/win32com/test/testMarshal.py +0 -160
- py2docfx/venv/venv1/Lib/site-packages/win32com/test/testPersist.py +0 -227
- py2docfx/venv/venv1/Lib/site-packages/win32com/test/testPippo.py +0 -80
- py2docfx/venv/venv1/Lib/site-packages/win32com/test/testPyComTest.py +0 -918
- py2docfx/venv/venv1/Lib/site-packages/win32com/test/testROT.py +0 -29
- py2docfx/venv/venv1/Lib/site-packages/win32com/test/testServers.py +0 -51
- py2docfx/venv/venv1/Lib/site-packages/win32com/test/testShell.py +0 -272
- py2docfx/venv/venv1/Lib/site-packages/win32com/test/testStorage.py +0 -88
- py2docfx/venv/venv1/Lib/site-packages/win32com/test/testStreams.py +0 -147
- py2docfx/venv/venv1/Lib/site-packages/win32com/test/testWMI.py +0 -18
- py2docfx/venv/venv1/Lib/site-packages/win32com/test/testall.py +0 -320
- py2docfx/venv/venv1/Lib/site-packages/win32com/test/testmakepy.py +0 -54
- py2docfx/venv/venv1/Lib/site-packages/win32com/test/testvb.py +0 -583
- py2docfx/venv/venv1/Lib/site-packages/win32com/test/testvbscript_regexp.py +0 -40
- py2docfx/venv/venv1/Lib/site-packages/win32com/test/testxslt.py +0 -34
- py2docfx/venv/venv1/Lib/site-packages/win32com/test/util.py +0 -262
- py2docfx/venv/venv1/Lib/site-packages/win32com/universal.py +0 -224
- py2docfx/venv/venv1/Lib/site-packages/win32com/util.py +0 -35
- py2docfx/venv/venv1/Lib/site-packages/win32comext/adsi/__init__.py +0 -113
- py2docfx/venv/venv1/Lib/site-packages/win32comext/adsi/adsicon.py +0 -340
- py2docfx/venv/venv1/Lib/site-packages/win32comext/adsi/demos/objectPicker.py +0 -68
- py2docfx/venv/venv1/Lib/site-packages/win32comext/adsi/demos/scp.py +0 -565
- py2docfx/venv/venv1/Lib/site-packages/win32comext/adsi/demos/search.py +0 -151
- py2docfx/venv/venv1/Lib/site-packages/win32comext/adsi/demos/test.py +0 -274
- py2docfx/venv/venv1/Lib/site-packages/win32comext/authorization/__init__.py +0 -6
- py2docfx/venv/venv1/Lib/site-packages/win32comext/authorization/demos/EditSecurity.py +0 -229
- py2docfx/venv/venv1/Lib/site-packages/win32comext/authorization/demos/EditServiceSecurity.py +0 -219
- py2docfx/venv/venv1/Lib/site-packages/win32comext/axcontrol/__init__.py +0 -4
- py2docfx/venv/venv1/Lib/site-packages/win32comext/axdebug/__init__.py +0 -4
- py2docfx/venv/venv1/Lib/site-packages/win32comext/axdebug/adb.py +0 -467
- py2docfx/venv/venv1/Lib/site-packages/win32comext/axdebug/codecontainer.py +0 -279
- py2docfx/venv/venv1/Lib/site-packages/win32comext/axdebug/contexts.py +0 -58
- py2docfx/venv/venv1/Lib/site-packages/win32comext/axdebug/debugger.py +0 -238
- py2docfx/venv/venv1/Lib/site-packages/win32comext/axdebug/documents.py +0 -135
- py2docfx/venv/venv1/Lib/site-packages/win32comext/axdebug/dump.py +0 -57
- py2docfx/venv/venv1/Lib/site-packages/win32comext/axdebug/expressions.py +0 -212
- py2docfx/venv/venv1/Lib/site-packages/win32comext/axdebug/gateways.py +0 -583
- py2docfx/venv/venv1/Lib/site-packages/win32comext/axdebug/stackframe.py +0 -178
- py2docfx/venv/venv1/Lib/site-packages/win32comext/axdebug/util.py +0 -98
- py2docfx/venv/venv1/Lib/site-packages/win32comext/axscript/__init__.py +0 -4
- py2docfx/venv/venv1/Lib/site-packages/win32comext/axscript/asputil.py +0 -13
- py2docfx/venv/venv1/Lib/site-packages/win32comext/axscript/client/__init__.py +0 -1
- py2docfx/venv/venv1/Lib/site-packages/win32comext/axscript/client/debug.py +0 -223
- py2docfx/venv/venv1/Lib/site-packages/win32comext/axscript/client/error.py +0 -262
- py2docfx/venv/venv1/Lib/site-packages/win32comext/axscript/client/framework.py +0 -1291
- py2docfx/venv/venv1/Lib/site-packages/win32comext/axscript/client/pydumper.py +0 -78
- py2docfx/venv/venv1/Lib/site-packages/win32comext/axscript/client/pyscript.py +0 -438
- py2docfx/venv/venv1/Lib/site-packages/win32comext/axscript/client/pyscript_rexec.py +0 -54
- py2docfx/venv/venv1/Lib/site-packages/win32comext/axscript/client/scriptdispatch.py +0 -103
- py2docfx/venv/venv1/Lib/site-packages/win32comext/axscript/server/__init__.py +0 -0
- py2docfx/venv/venv1/Lib/site-packages/win32comext/axscript/server/axsite.py +0 -145
- py2docfx/venv/venv1/Lib/site-packages/win32comext/axscript/test/leakTest.py +0 -185
- py2docfx/venv/venv1/Lib/site-packages/win32comext/axscript/test/testHost.py +0 -240
- py2docfx/venv/venv1/Lib/site-packages/win32comext/axscript/test/testHost4Dbg.py +0 -83
- py2docfx/venv/venv1/Lib/site-packages/win32comext/bits/__init__.py +0 -6
- py2docfx/venv/venv1/Lib/site-packages/win32comext/bits/test/show_all_jobs.py +0 -48
- py2docfx/venv/venv1/Lib/site-packages/win32comext/bits/test/test_bits.py +0 -119
- py2docfx/venv/venv1/Lib/site-packages/win32comext/directsound/__init__.py +0 -4
- py2docfx/venv/venv1/Lib/site-packages/win32comext/directsound/test/__init__.py +0 -1
- py2docfx/venv/venv1/Lib/site-packages/win32comext/directsound/test/ds_record.py +0 -60
- py2docfx/venv/venv1/Lib/site-packages/win32comext/directsound/test/ds_test.py +0 -402
- py2docfx/venv/venv1/Lib/site-packages/win32comext/ifilter/__init__.py +0 -1
- py2docfx/venv/venv1/Lib/site-packages/win32comext/ifilter/demo/filterDemo.py +0 -300
- py2docfx/venv/venv1/Lib/site-packages/win32comext/ifilter/ifiltercon.py +0 -110
- py2docfx/venv/venv1/Lib/site-packages/win32comext/internet/__init__.py +0 -4
- py2docfx/venv/venv1/Lib/site-packages/win32comext/internet/inetcon.py +0 -261
- py2docfx/venv/venv1/Lib/site-packages/win32comext/mapi/__init__.py +0 -21
- py2docfx/venv/venv1/Lib/site-packages/win32comext/mapi/demos/mapisend.py +0 -98
- py2docfx/venv/venv1/Lib/site-packages/win32comext/mapi/emsabtags.py +0 -875
- py2docfx/venv/venv1/Lib/site-packages/win32comext/mapi/mapitags.py +0 -1023
- py2docfx/venv/venv1/Lib/site-packages/win32comext/mapi/mapiutil.py +0 -211
- py2docfx/venv/venv1/Lib/site-packages/win32comext/propsys/__init__.py +0 -1
- py2docfx/venv/venv1/Lib/site-packages/win32comext/propsys/pscon.py +0 -838
- py2docfx/venv/venv1/Lib/site-packages/win32comext/propsys/test/testpropsys.py +0 -5
- py2docfx/venv/venv1/Lib/site-packages/win32comext/shell/__init__.py +0 -4
- py2docfx/venv/venv1/Lib/site-packages/win32comext/shell/demos/IActiveDesktop.py +0 -83
- py2docfx/venv/venv1/Lib/site-packages/win32comext/shell/demos/IFileOperationProgressSink.py +0 -179
- py2docfx/venv/venv1/Lib/site-packages/win32comext/shell/demos/IShellLinkDataList.py +0 -67
- py2docfx/venv/venv1/Lib/site-packages/win32comext/shell/demos/ITransferAdviseSink.py +0 -93
- py2docfx/venv/venv1/Lib/site-packages/win32comext/shell/demos/IUniformResourceLocator.py +0 -56
- py2docfx/venv/venv1/Lib/site-packages/win32comext/shell/demos/browse_for_folder.py +0 -45
- py2docfx/venv/venv1/Lib/site-packages/win32comext/shell/demos/create_link.py +0 -73
- py2docfx/venv/venv1/Lib/site-packages/win32comext/shell/demos/dump_link.py +0 -58
- py2docfx/venv/venv1/Lib/site-packages/win32comext/shell/demos/explorer_browser.py +0 -143
- py2docfx/venv/venv1/Lib/site-packages/win32comext/shell/demos/servers/column_provider.py +0 -125
- py2docfx/venv/venv1/Lib/site-packages/win32comext/shell/demos/servers/context_menu.py +0 -122
- py2docfx/venv/venv1/Lib/site-packages/win32comext/shell/demos/servers/copy_hook.py +0 -84
- py2docfx/venv/venv1/Lib/site-packages/win32comext/shell/demos/servers/empty_volume_cache.py +0 -188
- py2docfx/venv/venv1/Lib/site-packages/win32comext/shell/demos/servers/folder_view.py +0 -866
- py2docfx/venv/venv1/Lib/site-packages/win32comext/shell/demos/servers/icon_handler.py +0 -81
- py2docfx/venv/venv1/Lib/site-packages/win32comext/shell/demos/servers/shell_view.py +0 -971
- py2docfx/venv/venv1/Lib/site-packages/win32comext/shell/demos/shellexecuteex.py +0 -19
- py2docfx/venv/venv1/Lib/site-packages/win32comext/shell/demos/viewstate.py +0 -68
- py2docfx/venv/venv1/Lib/site-packages/win32comext/shell/demos/walk_shell_folders.py +0 -24
- py2docfx/venv/venv1/Lib/site-packages/win32comext/shell/shellcon.py +0 -1615
- py2docfx/venv/venv1/Lib/site-packages/win32comext/shell/test/testSHFileOperation.py +0 -75
- py2docfx/venv/venv1/Lib/site-packages/win32comext/shell/test/testShellFolder.py +0 -21
- py2docfx/venv/venv1/Lib/site-packages/win32comext/shell/test/testShellItem.py +0 -69
- py2docfx/venv/venv1/Lib/site-packages/win32comext/taskscheduler/__init__.py +0 -6
- py2docfx/venv/venv1/Lib/site-packages/win32comext/taskscheduler/test/test_addtask.py +0 -66
- py2docfx/venv/venv1/Lib/site-packages/win32comext/taskscheduler/test/test_addtask_1.py +0 -68
- py2docfx/venv/venv1/Lib/site-packages/win32comext/taskscheduler/test/test_addtask_2.py +0 -49
- py2docfx/venv/venv1/Lib/site-packages/win32comext/taskscheduler/test/test_localsystem.py +0 -3
- py2docfx/venv/venv1/Scripts/pywin32_postinstall.py +0 -733
- py2docfx/venv/venv1/Scripts/pywin32_testall.py +0 -120
- {py2docfx-0.1.15.dev2025736.dist-info → py2docfx-0.1.15.dev2038852.dist-info}/WHEEL +0 -0
- {py2docfx-0.1.15.dev2025736.dist-info → py2docfx-0.1.15.dev2038852.dist-info}/top_level.txt +0 -0
@@ -1,1201 +0,0 @@
|
|
1
|
-
"""
|
2
|
-
win32timezone:
|
3
|
-
Module for handling datetime.tzinfo time zones using the windows
|
4
|
-
registry for time zone information. The time zone names are dependent
|
5
|
-
on the registry entries defined by the operating system.
|
6
|
-
|
7
|
-
This module may be tested using the doctest module.
|
8
|
-
|
9
|
-
Written by Jason R. Coombs (jaraco@jaraco.com).
|
10
|
-
Copyright © 2003-2012.
|
11
|
-
All Rights Reserved.
|
12
|
-
|
13
|
-
This module is licenced for use in Mark Hammond's pywin32
|
14
|
-
library under the same terms as the pywin32 library.
|
15
|
-
|
16
|
-
To use this time zone module with the datetime module, simply pass
|
17
|
-
the TimeZoneInfo object to the datetime constructor. For example,
|
18
|
-
|
19
|
-
>>> import win32timezone, datetime
|
20
|
-
>>> assert 'Mountain Standard Time' in win32timezone.TimeZoneInfo.get_sorted_time_zone_names()
|
21
|
-
>>> MST = win32timezone.TimeZoneInfo('Mountain Standard Time')
|
22
|
-
>>> now = datetime.datetime.now(MST)
|
23
|
-
|
24
|
-
The now object is now a time-zone aware object, and daylight savings-
|
25
|
-
aware methods may be called on it.
|
26
|
-
|
27
|
-
>>> now.utcoffset() in (datetime.timedelta(-1, 61200), datetime.timedelta(-1, 64800))
|
28
|
-
True
|
29
|
-
|
30
|
-
(note that the result of utcoffset call will be different based on when now was
|
31
|
-
generated, unless standard time is always used)
|
32
|
-
|
33
|
-
>>> now = datetime.datetime.now(win32timezone.TimeZoneInfo('Mountain Standard Time', True))
|
34
|
-
>>> now.utcoffset()
|
35
|
-
datetime.timedelta(days=-1, seconds=61200)
|
36
|
-
|
37
|
-
>>> aug2 = datetime.datetime(2003, 8, 2, tzinfo = MST)
|
38
|
-
>>> tuple(aug2.utctimetuple())
|
39
|
-
(2003, 8, 2, 6, 0, 0, 5, 214, 0)
|
40
|
-
>>> nov2 = datetime.datetime(2003, 11, 25, tzinfo = MST)
|
41
|
-
>>> tuple(nov2.utctimetuple())
|
42
|
-
(2003, 11, 25, 7, 0, 0, 1, 329, 0)
|
43
|
-
|
44
|
-
To convert from one timezone to another, just use the astimezone method.
|
45
|
-
|
46
|
-
>>> aug2.isoformat()
|
47
|
-
'2003-08-02T00:00:00-06:00'
|
48
|
-
>>> aug2est = aug2.astimezone(win32timezone.TimeZoneInfo('Eastern Standard Time'))
|
49
|
-
>>> aug2est.isoformat()
|
50
|
-
'2003-08-02T02:00:00-04:00'
|
51
|
-
|
52
|
-
calling the displayName member will return the display name as set in the
|
53
|
-
registry.
|
54
|
-
|
55
|
-
>>> est = win32timezone.TimeZoneInfo('Eastern Standard Time')
|
56
|
-
>>> str(est.displayName)
|
57
|
-
'(UTC-05:00) Eastern Time (US & Canada)'
|
58
|
-
|
59
|
-
>>> gmt = win32timezone.TimeZoneInfo('GMT Standard Time', True)
|
60
|
-
>>> str(gmt.displayName)
|
61
|
-
'(UTC+00:00) Dublin, Edinburgh, Lisbon, London'
|
62
|
-
|
63
|
-
To get the complete list of available time zone keys,
|
64
|
-
>>> zones = win32timezone.TimeZoneInfo.get_all_time_zones()
|
65
|
-
|
66
|
-
If you want to get them in an order that's sorted longitudinally
|
67
|
-
>>> zones = win32timezone.TimeZoneInfo.get_sorted_time_zones()
|
68
|
-
|
69
|
-
TimeZoneInfo now supports being pickled and comparison
|
70
|
-
>>> import pickle
|
71
|
-
>>> tz = win32timezone.TimeZoneInfo('China Standard Time')
|
72
|
-
>>> tz == pickle.loads(pickle.dumps(tz))
|
73
|
-
True
|
74
|
-
|
75
|
-
It's possible to construct a TimeZoneInfo from a TimeZoneDescription
|
76
|
-
including the currently-defined zone.
|
77
|
-
>>> code, info = win32timezone.TimeZoneDefinition.current()
|
78
|
-
>>> tz = win32timezone.TimeZoneInfo(info, not code)
|
79
|
-
>>> tz == pickle.loads(pickle.dumps(tz))
|
80
|
-
True
|
81
|
-
|
82
|
-
Although it's easier to use TimeZoneInfo.local() to get the local info
|
83
|
-
>>> tz == TimeZoneInfo.local()
|
84
|
-
True
|
85
|
-
|
86
|
-
>>> aest = win32timezone.TimeZoneInfo('AUS Eastern Standard Time')
|
87
|
-
>>> est = win32timezone.TimeZoneInfo('E. Australia Standard Time')
|
88
|
-
>>> dt = datetime.datetime(2006, 11, 11, 1, 0, 0, tzinfo = aest)
|
89
|
-
>>> estdt = dt.astimezone(est)
|
90
|
-
>>> estdt.strftime('%Y-%m-%d %H:%M:%S')
|
91
|
-
'2006-11-11 00:00:00'
|
92
|
-
|
93
|
-
>>> dt = datetime.datetime(2007, 1, 12, 1, 0, 0, tzinfo = aest)
|
94
|
-
>>> estdt = dt.astimezone(est)
|
95
|
-
>>> estdt.strftime('%Y-%m-%d %H:%M:%S')
|
96
|
-
'2007-01-12 00:00:00'
|
97
|
-
|
98
|
-
>>> dt = datetime.datetime(2007, 6, 13, 1, 0, 0, tzinfo = aest)
|
99
|
-
>>> estdt = dt.astimezone(est)
|
100
|
-
>>> estdt.strftime('%Y-%m-%d %H:%M:%S')
|
101
|
-
'2007-06-13 01:00:00'
|
102
|
-
|
103
|
-
Microsoft now has a patch for handling time zones in 2007 (see
|
104
|
-
https://learn.microsoft.com/en-us/troubleshoot/windows-client/system-management-components/daylight-saving-time-help-support)
|
105
|
-
|
106
|
-
As a result, patched systems will give an incorrect result for
|
107
|
-
dates prior to the designated year except for Vista and its
|
108
|
-
successors, which have dynamic time zone support.
|
109
|
-
>>> nov2_pre_change = datetime.datetime(2003, 11, 2, tzinfo = MST)
|
110
|
-
>>> old_response = (2003, 11, 2, 7, 0, 0, 6, 306, 0)
|
111
|
-
>>> incorrect_patch_response = (2003, 11, 2, 6, 0, 0, 6, 306, 0)
|
112
|
-
>>> pre_response = nov2_pre_change.utctimetuple()
|
113
|
-
>>> pre_response in (old_response, incorrect_patch_response)
|
114
|
-
True
|
115
|
-
|
116
|
-
Furthermore, unpatched systems pre-Vista will give an incorrect
|
117
|
-
result for dates after 2007.
|
118
|
-
>>> nov2_post_change = datetime.datetime(2007, 11, 2, tzinfo = MST)
|
119
|
-
>>> incorrect_unpatched_response = (2007, 11, 2, 7, 0, 0, 4, 306, 0)
|
120
|
-
>>> new_response = (2007, 11, 2, 6, 0, 0, 4, 306, 0)
|
121
|
-
>>> post_response = nov2_post_change.utctimetuple()
|
122
|
-
>>> post_response in (new_response, incorrect_unpatched_response)
|
123
|
-
True
|
124
|
-
|
125
|
-
|
126
|
-
There is a function you can call to get some capabilities of the time
|
127
|
-
zone data.
|
128
|
-
>>> caps = GetTZCapabilities()
|
129
|
-
>>> isinstance(caps, dict)
|
130
|
-
True
|
131
|
-
>>> 'MissingTZPatch' in caps
|
132
|
-
True
|
133
|
-
>>> 'DynamicTZSupport' in caps
|
134
|
-
True
|
135
|
-
|
136
|
-
>>> both_dates_correct = (pre_response == old_response and post_response == new_response)
|
137
|
-
>>> old_dates_wrong = (pre_response == incorrect_patch_response)
|
138
|
-
>>> new_dates_wrong = (post_response == incorrect_unpatched_response)
|
139
|
-
|
140
|
-
>>> caps['DynamicTZSupport'] == both_dates_correct
|
141
|
-
True
|
142
|
-
|
143
|
-
>>> (not caps['DynamicTZSupport'] and caps['MissingTZPatch']) == new_dates_wrong
|
144
|
-
True
|
145
|
-
|
146
|
-
>>> (not caps['DynamicTZSupport'] and not caps['MissingTZPatch']) == old_dates_wrong
|
147
|
-
True
|
148
|
-
|
149
|
-
This test helps ensure language support for unicode characters
|
150
|
-
>>> x = TIME_ZONE_INFORMATION(0, 'français')
|
151
|
-
|
152
|
-
|
153
|
-
Test conversion from one time zone to another at a DST boundary
|
154
|
-
===============================================================
|
155
|
-
|
156
|
-
>>> tz_hi = TimeZoneInfo('Hawaiian Standard Time')
|
157
|
-
>>> tz_pac = TimeZoneInfo('Pacific Standard Time')
|
158
|
-
>>> time_before = datetime.datetime(2011, 11, 5, 15, 59, 59, tzinfo=tz_hi)
|
159
|
-
>>> tz_hi.utcoffset(time_before)
|
160
|
-
datetime.timedelta(days=-1, seconds=50400)
|
161
|
-
>>> tz_hi.dst(time_before)
|
162
|
-
datetime.timedelta(0)
|
163
|
-
|
164
|
-
Hawaii doesn't need dynamic TZ info
|
165
|
-
>>> getattr(tz_hi, 'dynamicInfo', None)
|
166
|
-
|
167
|
-
Here's a time that gave some trouble as reported in #3523104
|
168
|
-
because one minute later, the equivalent UTC time changes from DST
|
169
|
-
in the U.S.
|
170
|
-
>>> dt_hi = datetime.datetime(2011, 11, 5, 15, 59, 59, 0, tzinfo=tz_hi)
|
171
|
-
>>> dt_hi.timetuple()
|
172
|
-
time.struct_time(tm_year=2011, tm_mon=11, tm_mday=5, tm_hour=15, tm_min=59, tm_sec=59, tm_wday=5, tm_yday=309, tm_isdst=0)
|
173
|
-
>>> dt_hi.utctimetuple()
|
174
|
-
time.struct_time(tm_year=2011, tm_mon=11, tm_mday=6, tm_hour=1, tm_min=59, tm_sec=59, tm_wday=6, tm_yday=310, tm_isdst=0)
|
175
|
-
|
176
|
-
Convert the time to pacific time.
|
177
|
-
>>> dt_pac = dt_hi.astimezone(tz_pac)
|
178
|
-
>>> dt_pac.timetuple()
|
179
|
-
time.struct_time(tm_year=2011, tm_mon=11, tm_mday=5, tm_hour=18, tm_min=59, tm_sec=59, tm_wday=5, tm_yday=309, tm_isdst=1)
|
180
|
-
|
181
|
-
Notice that the UTC time is almost 2am.
|
182
|
-
>>> dt_pac.utctimetuple()
|
183
|
-
time.struct_time(tm_year=2011, tm_mon=11, tm_mday=6, tm_hour=1, tm_min=59, tm_sec=59, tm_wday=6, tm_yday=310, tm_isdst=0)
|
184
|
-
|
185
|
-
Now do the same tests one minute later in Hawaii.
|
186
|
-
>>> time_after = datetime.datetime(2011, 11, 5, 16, 0, 0, 0, tzinfo=tz_hi)
|
187
|
-
>>> tz_hi.utcoffset(time_after)
|
188
|
-
datetime.timedelta(days=-1, seconds=50400)
|
189
|
-
>>> tz_hi.dst(time_before)
|
190
|
-
datetime.timedelta(0)
|
191
|
-
|
192
|
-
>>> dt_hi = datetime.datetime(2011, 11, 5, 16, 0, 0, 0, tzinfo=tz_hi)
|
193
|
-
>>> print(dt_hi.timetuple())
|
194
|
-
time.struct_time(tm_year=2011, tm_mon=11, tm_mday=5, tm_hour=16, tm_min=0, tm_sec=0, tm_wday=5, tm_yday=309, tm_isdst=0)
|
195
|
-
>>> print(dt_hi.utctimetuple())
|
196
|
-
time.struct_time(tm_year=2011, tm_mon=11, tm_mday=6, tm_hour=2, tm_min=0, tm_sec=0, tm_wday=6, tm_yday=310, tm_isdst=0)
|
197
|
-
|
198
|
-
According to the docs, this is what astimezone does.
|
199
|
-
>>> utc = (dt_hi - dt_hi.utcoffset()).replace(tzinfo=tz_pac)
|
200
|
-
>>> utc
|
201
|
-
datetime.datetime(2011, 11, 6, 2, 0, tzinfo=TimeZoneInfo('Pacific Standard Time'))
|
202
|
-
>>> tz_pac.fromutc(utc) == dt_hi.astimezone(tz_pac)
|
203
|
-
True
|
204
|
-
>>> tz_pac.fromutc(utc)
|
205
|
-
datetime.datetime(2011, 11, 5, 19, 0, tzinfo=TimeZoneInfo('Pacific Standard Time'))
|
206
|
-
|
207
|
-
Make sure the converted time is correct.
|
208
|
-
>>> dt_pac = dt_hi.astimezone(tz_pac)
|
209
|
-
>>> dt_pac.timetuple()
|
210
|
-
time.struct_time(tm_year=2011, tm_mon=11, tm_mday=5, tm_hour=19, tm_min=0, tm_sec=0, tm_wday=5, tm_yday=309, tm_isdst=1)
|
211
|
-
>>> dt_pac.utctimetuple()
|
212
|
-
time.struct_time(tm_year=2011, tm_mon=11, tm_mday=6, tm_hour=2, tm_min=0, tm_sec=0, tm_wday=6, tm_yday=310, tm_isdst=0)
|
213
|
-
|
214
|
-
Check some internal methods
|
215
|
-
>>> tz_pac._getStandardBias(datetime.datetime(2011, 1, 1))
|
216
|
-
datetime.timedelta(seconds=28800)
|
217
|
-
>>> tz_pac._getDaylightBias(datetime.datetime(2011, 1, 1))
|
218
|
-
datetime.timedelta(seconds=25200)
|
219
|
-
|
220
|
-
Test the offsets
|
221
|
-
>>> offset = tz_pac.utcoffset(datetime.datetime(2011, 11, 6, 2, 0))
|
222
|
-
>>> offset == datetime.timedelta(hours=-8)
|
223
|
-
True
|
224
|
-
>>> dst_offset = tz_pac.dst(datetime.datetime(2011, 11, 6, 2, 0) + offset)
|
225
|
-
>>> dst_offset == datetime.timedelta(hours=1)
|
226
|
-
True
|
227
|
-
>>> (offset + dst_offset) == datetime.timedelta(hours=-7)
|
228
|
-
True
|
229
|
-
|
230
|
-
|
231
|
-
Test offsets that occur right at the DST changeover
|
232
|
-
>>> datetime.datetime.utcfromtimestamp(1320570000).replace(
|
233
|
-
... tzinfo=TimeZoneInfo.utc()).astimezone(tz_pac)
|
234
|
-
datetime.datetime(2011, 11, 6, 1, 0, tzinfo=TimeZoneInfo('Pacific Standard Time'))
|
235
|
-
|
236
|
-
"""
|
237
|
-
|
238
|
-
from __future__ import annotations
|
239
|
-
|
240
|
-
import datetime
|
241
|
-
import functools
|
242
|
-
import logging
|
243
|
-
import operator
|
244
|
-
import re
|
245
|
-
import struct
|
246
|
-
import winreg
|
247
|
-
from itertools import count
|
248
|
-
from typing import (
|
249
|
-
TYPE_CHECKING,
|
250
|
-
Any,
|
251
|
-
Callable,
|
252
|
-
ClassVar,
|
253
|
-
Dict,
|
254
|
-
Generator,
|
255
|
-
Iterable,
|
256
|
-
Mapping,
|
257
|
-
TypeVar,
|
258
|
-
overload,
|
259
|
-
)
|
260
|
-
|
261
|
-
import win32api
|
262
|
-
|
263
|
-
if TYPE_CHECKING:
|
264
|
-
from _operator import _SupportsComparison
|
265
|
-
|
266
|
-
from _typeshed import SupportsKeysAndGetItem
|
267
|
-
from typing_extensions import Self
|
268
|
-
|
269
|
-
__author__ = "Jason R. Coombs <jaraco@jaraco.com>"
|
270
|
-
|
271
|
-
_RangeMapKT = TypeVar("_RangeMapKT", bound="_SupportsComparison")
|
272
|
-
|
273
|
-
_T = TypeVar("_T")
|
274
|
-
_VT = TypeVar("_VT")
|
275
|
-
|
276
|
-
log = logging.getLogger(__file__)
|
277
|
-
|
278
|
-
|
279
|
-
# A couple of objects for working with objects as if they were native C-type
|
280
|
-
# structures.
|
281
|
-
class _SimpleStruct:
|
282
|
-
_fields_: ClassVar[list[tuple[str, type]]] = [] # must be overridden by subclasses
|
283
|
-
|
284
|
-
def __init__(self, *args, **kw) -> None:
|
285
|
-
for i, (name, typ) in enumerate(self._fields_):
|
286
|
-
def_arg = None
|
287
|
-
if i < len(args):
|
288
|
-
def_arg = args[i]
|
289
|
-
if name in kw:
|
290
|
-
def_arg = kw[name]
|
291
|
-
if def_arg is not None:
|
292
|
-
if not isinstance(def_arg, tuple):
|
293
|
-
def_arg = (def_arg,)
|
294
|
-
else:
|
295
|
-
def_arg = ()
|
296
|
-
if len(def_arg) == 1 and isinstance(def_arg[0], typ):
|
297
|
-
# already an object of this type.
|
298
|
-
# XXX - should copy.copy???
|
299
|
-
def_val = def_arg[0]
|
300
|
-
else:
|
301
|
-
def_val = typ(*def_arg)
|
302
|
-
setattr(self, name, def_val)
|
303
|
-
|
304
|
-
def field_names(self) -> list[str]:
|
305
|
-
return [f[0] for f in self._fields_]
|
306
|
-
|
307
|
-
def __eq__(self, other) -> bool:
|
308
|
-
if not hasattr(other, "_fields_"):
|
309
|
-
return False
|
310
|
-
if self._fields_ != other._fields_:
|
311
|
-
return False
|
312
|
-
for name, _ in self._fields_:
|
313
|
-
if getattr(self, name) != getattr(other, name):
|
314
|
-
return False
|
315
|
-
return True
|
316
|
-
|
317
|
-
def __ne__(self, other: object) -> bool:
|
318
|
-
return not self.__eq__(other)
|
319
|
-
|
320
|
-
|
321
|
-
class SYSTEMTIME(_SimpleStruct):
|
322
|
-
_fields_ = [
|
323
|
-
("year", int),
|
324
|
-
("month", int),
|
325
|
-
("day_of_week", int),
|
326
|
-
("day", int),
|
327
|
-
("hour", int),
|
328
|
-
("minute", int),
|
329
|
-
("second", int),
|
330
|
-
("millisecond", int),
|
331
|
-
]
|
332
|
-
|
333
|
-
|
334
|
-
class TIME_ZONE_INFORMATION(_SimpleStruct):
|
335
|
-
_fields_ = [
|
336
|
-
("bias", int),
|
337
|
-
("standard_name", str),
|
338
|
-
("standard_start", SYSTEMTIME),
|
339
|
-
("standard_bias", int),
|
340
|
-
("daylight_name", str),
|
341
|
-
("daylight_start", SYSTEMTIME),
|
342
|
-
("daylight_bias", int),
|
343
|
-
]
|
344
|
-
|
345
|
-
|
346
|
-
class DYNAMIC_TIME_ZONE_INFORMATION(TIME_ZONE_INFORMATION):
|
347
|
-
_fields_ = TIME_ZONE_INFORMATION._fields_ + [
|
348
|
-
("key_name", str),
|
349
|
-
("dynamic_daylight_time_disabled", bool),
|
350
|
-
]
|
351
|
-
|
352
|
-
|
353
|
-
class TimeZoneDefinition(DYNAMIC_TIME_ZONE_INFORMATION):
|
354
|
-
"""
|
355
|
-
A time zone definition class based on the win32
|
356
|
-
DYNAMIC_TIME_ZONE_INFORMATION structure.
|
357
|
-
|
358
|
-
Describes a bias against UTC (bias), and two dates at which a separate
|
359
|
-
additional bias applies (standard_bias and daylight_bias).
|
360
|
-
"""
|
361
|
-
|
362
|
-
def __init__(self, *args, **kwargs) -> None:
|
363
|
-
"""
|
364
|
-
>>> test_args = [1] * 44
|
365
|
-
|
366
|
-
Try to construct a TimeZoneDefinition from:
|
367
|
-
|
368
|
-
a) [DYNAMIC_]TIME_ZONE_INFORMATION args
|
369
|
-
>>> TimeZoneDefinition(*test_args).bias
|
370
|
-
datetime.timedelta(seconds=60)
|
371
|
-
|
372
|
-
b) another TimeZoneDefinition or [DYNAMIC_]TIME_ZONE_INFORMATION
|
373
|
-
>>> TimeZoneDefinition(TimeZoneDefinition(*test_args)).bias
|
374
|
-
datetime.timedelta(seconds=60)
|
375
|
-
>>> TimeZoneDefinition(DYNAMIC_TIME_ZONE_INFORMATION(*test_args)).bias
|
376
|
-
datetime.timedelta(seconds=60)
|
377
|
-
>>> TimeZoneDefinition(TIME_ZONE_INFORMATION(*test_args)).bias
|
378
|
-
datetime.timedelta(seconds=60)
|
379
|
-
|
380
|
-
c) a byte structure (using _from_bytes)
|
381
|
-
>>> TimeZoneDefinition(bytes(test_args)).bias
|
382
|
-
datetime.timedelta(days=11696, seconds=46140)
|
383
|
-
"""
|
384
|
-
try:
|
385
|
-
super().__init__(*args, **kwargs)
|
386
|
-
return
|
387
|
-
except (TypeError, ValueError):
|
388
|
-
pass
|
389
|
-
|
390
|
-
try:
|
391
|
-
self.__init_from_other(*args, **kwargs)
|
392
|
-
return
|
393
|
-
except TypeError:
|
394
|
-
pass
|
395
|
-
|
396
|
-
try:
|
397
|
-
self.__init_from_bytes(*args, **kwargs)
|
398
|
-
return
|
399
|
-
except TypeError:
|
400
|
-
pass
|
401
|
-
|
402
|
-
raise TypeError(f"Invalid arguments for {self.__class__}")
|
403
|
-
|
404
|
-
def __init_from_bytes(
|
405
|
-
self,
|
406
|
-
bytes,
|
407
|
-
standard_name="",
|
408
|
-
daylight_name="",
|
409
|
-
key_name="",
|
410
|
-
daylight_disabled=False,
|
411
|
-
):
|
412
|
-
format = "3l8h8h"
|
413
|
-
components = struct.unpack(format, bytes)
|
414
|
-
bias, standard_bias, daylight_bias = components[:3]
|
415
|
-
standard_start = SYSTEMTIME(*components[3:11])
|
416
|
-
daylight_start = SYSTEMTIME(*components[11:19])
|
417
|
-
super().__init__(
|
418
|
-
bias,
|
419
|
-
standard_name,
|
420
|
-
standard_start,
|
421
|
-
standard_bias,
|
422
|
-
daylight_name,
|
423
|
-
daylight_start,
|
424
|
-
daylight_bias,
|
425
|
-
key_name,
|
426
|
-
daylight_disabled,
|
427
|
-
)
|
428
|
-
|
429
|
-
def __init_from_other(self, other: TIME_ZONE_INFORMATION) -> None:
|
430
|
-
if not isinstance(other, TIME_ZONE_INFORMATION):
|
431
|
-
raise TypeError("Not a TIME_ZONE_INFORMATION")
|
432
|
-
for name in other.field_names():
|
433
|
-
# explicitly get the value from the underlying structure
|
434
|
-
value = super(TIME_ZONE_INFORMATION, other).__getattribute__(name)
|
435
|
-
setattr(self, name, value)
|
436
|
-
# consider instead of the loop above just copying the memory directly
|
437
|
-
# size = max(ctypes.sizeof(DYNAMIC_TIME_ZONE_INFO), ctypes.sizeof(other))
|
438
|
-
# ctypes.memmove(ctypes.addressof(self), other, size)
|
439
|
-
|
440
|
-
if TYPE_CHECKING:
|
441
|
-
# TIME_ZONE_INFORMATION fields as obtained by __getattribute__
|
442
|
-
bias: datetime.timedelta
|
443
|
-
standard_name: str
|
444
|
-
standard_start: SYSTEMTIME
|
445
|
-
standard_bias: datetime.timedelta
|
446
|
-
daylight_name: str
|
447
|
-
daylight_start: SYSTEMTIME
|
448
|
-
daylight_bias: datetime.timedelta
|
449
|
-
|
450
|
-
def __getattribute__(self, attr: str) -> Any:
|
451
|
-
value = super().__getattribute__(attr)
|
452
|
-
if "bias" in attr:
|
453
|
-
value = datetime.timedelta(minutes=value)
|
454
|
-
return value
|
455
|
-
|
456
|
-
@classmethod
|
457
|
-
def current(cls):
|
458
|
-
"Windows Platform SDK GetTimeZoneInformation"
|
459
|
-
code, tzi = win32api.GetTimeZoneInformation(True)
|
460
|
-
return code, cls(*tzi)
|
461
|
-
|
462
|
-
def set(self) -> None:
|
463
|
-
tzi = tuple(getattr(self, n) for n, t in self._fields_)
|
464
|
-
win32api.SetTimeZoneInformation(tzi)
|
465
|
-
|
466
|
-
def copy(self) -> Self:
|
467
|
-
# XXX - this is no longer a copy!
|
468
|
-
return self.__class__(self)
|
469
|
-
|
470
|
-
def locate_daylight_start(self, year) -> datetime.datetime:
|
471
|
-
return self._locate_day(year, self.daylight_start)
|
472
|
-
|
473
|
-
def locate_standard_start(self, year) -> datetime.datetime:
|
474
|
-
return self._locate_day(year, self.standard_start)
|
475
|
-
|
476
|
-
@staticmethod
|
477
|
-
def _locate_day(year, cutoff) -> datetime.datetime:
|
478
|
-
"""
|
479
|
-
Takes a SYSTEMTIME object, such as retrieved from a TIME_ZONE_INFORMATION
|
480
|
-
structure or call to GetTimeZoneInformation and interprets it based on the given
|
481
|
-
year to identify the actual day.
|
482
|
-
|
483
|
-
This method is necessary because the SYSTEMTIME structure refers to a day by its
|
484
|
-
day of the week and week of the month (e.g. 4th saturday in March).
|
485
|
-
|
486
|
-
>>> SATURDAY = 6
|
487
|
-
>>> MARCH = 3
|
488
|
-
>>> st = SYSTEMTIME(2000, MARCH, SATURDAY, 4, 0, 0, 0, 0)
|
489
|
-
|
490
|
-
# according to my calendar, the 4th Saturday in March in 2009 was the 28th
|
491
|
-
>>> expected_date = datetime.datetime(2009, 3, 28)
|
492
|
-
>>> TimeZoneDefinition._locate_day(2009, st) == expected_date
|
493
|
-
True
|
494
|
-
"""
|
495
|
-
# MS stores Sunday as 0, Python datetime stores Monday as zero
|
496
|
-
target_weekday = (cutoff.day_of_week + 6) % 7
|
497
|
-
# For SYSTEMTIMEs relating to time zone information, cutoff.day
|
498
|
-
# is the week of the month
|
499
|
-
week_of_month = cutoff.day
|
500
|
-
# so the following is the first day of that week
|
501
|
-
day = (week_of_month - 1) * 7 + 1
|
502
|
-
result = datetime.datetime(
|
503
|
-
year,
|
504
|
-
cutoff.month,
|
505
|
-
day,
|
506
|
-
cutoff.hour,
|
507
|
-
cutoff.minute,
|
508
|
-
cutoff.second,
|
509
|
-
cutoff.millisecond,
|
510
|
-
)
|
511
|
-
# now the result is the correct week, but not necessarily the correct day of the week
|
512
|
-
days_to_go = (target_weekday - result.weekday()) % 7
|
513
|
-
result += datetime.timedelta(days_to_go)
|
514
|
-
# if we selected a day in the month following the target month,
|
515
|
-
# move back a week or two.
|
516
|
-
# This is necessary because Microsoft defines the fifth week in a month
|
517
|
-
# to be the last week in a month and adding the time delta might have
|
518
|
-
# pushed the result into the next month.
|
519
|
-
while result.month == cutoff.month + 1:
|
520
|
-
result -= datetime.timedelta(weeks=1)
|
521
|
-
return result
|
522
|
-
|
523
|
-
|
524
|
-
class TimeZoneInfo(datetime.tzinfo):
|
525
|
-
"""
|
526
|
-
Main class for handling Windows time zones.
|
527
|
-
Usage:
|
528
|
-
TimeZoneInfo(<Time Zone Standard Name>, [<Fix Standard Time>])
|
529
|
-
|
530
|
-
If <Fix Standard Time> evaluates to True, daylight savings time is
|
531
|
-
calculated in the same way as standard time.
|
532
|
-
|
533
|
-
>>> tzi = TimeZoneInfo('Pacific Standard Time')
|
534
|
-
>>> march31 = datetime.datetime(2000,3,31)
|
535
|
-
|
536
|
-
We know that time zone definitions haven't changed from 2007
|
537
|
-
to 2012, so regardless of whether dynamic info is available,
|
538
|
-
there should be consistent results for these years.
|
539
|
-
>>> subsequent_years = [march31.replace(year=year)
|
540
|
-
... for year in range(2007, 2013)]
|
541
|
-
>>> offsets = set(tzi.utcoffset(year) for year in subsequent_years)
|
542
|
-
>>> len(offsets)
|
543
|
-
1
|
544
|
-
|
545
|
-
Cannot create a `TimeZoneInfo` with an invalid name.
|
546
|
-
>>> TimeZoneInfo('Does not exist')
|
547
|
-
Traceback (most recent call last):
|
548
|
-
...
|
549
|
-
ValueError: Timezone Name 'Does not exist' not found
|
550
|
-
>>> TimeZoneInfo(None)
|
551
|
-
Traceback (most recent call last):
|
552
|
-
...
|
553
|
-
ValueError: subkey name cannot be empty
|
554
|
-
>>> TimeZoneInfo("")
|
555
|
-
Traceback (most recent call last):
|
556
|
-
...
|
557
|
-
ValueError: subkey name cannot be empty
|
558
|
-
"""
|
559
|
-
|
560
|
-
# this key works for WinNT+, but not for the Win95 line.
|
561
|
-
tzRegKey = r"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones"
|
562
|
-
|
563
|
-
def __init__(
|
564
|
-
self,
|
565
|
-
param: str | TimeZoneDefinition,
|
566
|
-
fix_standard_time: bool = False,
|
567
|
-
) -> None:
|
568
|
-
if isinstance(param, TimeZoneDefinition):
|
569
|
-
self._LoadFromTZI(param)
|
570
|
-
else:
|
571
|
-
self.timeZoneName = param
|
572
|
-
self._LoadInfoFromKey()
|
573
|
-
self.fixedStandardTime = fix_standard_time
|
574
|
-
|
575
|
-
# For tzinfo pickle support
|
576
|
-
def __getinitargs__(self) -> tuple[TimeZoneDefinition, bool]:
|
577
|
-
return (self.staticInfo, self.fixedStandardTime)
|
578
|
-
|
579
|
-
def _FindTimeZoneKey(self) -> _RegKeyDict:
|
580
|
-
"""Find the registry key for the time zone name (self.timeZoneName)."""
|
581
|
-
# for multi-language compatability, match the time zone name in the
|
582
|
-
# "Std" key of the time zone key.
|
583
|
-
zoneNames = dict(self._get_indexed_time_zone_keys("Std"))
|
584
|
-
# Also match the time zone key name itself, to be compatible with
|
585
|
-
# English-based hard-coded time zones.
|
586
|
-
timeZoneName = zoneNames.get(self.timeZoneName, self.timeZoneName)
|
587
|
-
key = _RegKeyDict.open(winreg.HKEY_LOCAL_MACHINE, self.tzRegKey)
|
588
|
-
try:
|
589
|
-
result = key.subkey(timeZoneName)
|
590
|
-
except FileNotFoundError:
|
591
|
-
# Don't catch ValueError, keep the original error message
|
592
|
-
raise ValueError(f"Timezone Name {timeZoneName!r} not found")
|
593
|
-
return result
|
594
|
-
|
595
|
-
def _LoadInfoFromKey(self) -> None:
|
596
|
-
"""Loads the information from an opened time zone registry key
|
597
|
-
into relevant fields of this TZI object"""
|
598
|
-
key = self._FindTimeZoneKey()
|
599
|
-
self.displayName = key["Display"]
|
600
|
-
self.standardName = key["Std"]
|
601
|
-
self.daylightName = key["Dlt"]
|
602
|
-
self.staticInfo = TimeZoneDefinition(key["TZI"])
|
603
|
-
self._LoadDynamicInfoFromKey(key)
|
604
|
-
|
605
|
-
def _LoadFromTZI(self, tzi: TimeZoneDefinition):
|
606
|
-
self.timeZoneName = tzi.standard_name
|
607
|
-
self.displayName = "Unknown"
|
608
|
-
self.standardName = tzi.standard_name
|
609
|
-
self.daylightName = tzi.daylight_name
|
610
|
-
self.staticInfo = tzi
|
611
|
-
|
612
|
-
def _LoadDynamicInfoFromKey(self, key) -> None:
|
613
|
-
"""
|
614
|
-
>>> tzi = TimeZoneInfo('Central Standard Time')
|
615
|
-
|
616
|
-
Here's how the RangeMap is supposed to work:
|
617
|
-
>>> m = RangeMap(zip([2006,2007], 'BC'),
|
618
|
-
... sort_params = {"reverse": True},
|
619
|
-
... key_match_comparator=operator.ge)
|
620
|
-
>>> m.get(2000, 'A')
|
621
|
-
'A'
|
622
|
-
>>> m[2006]
|
623
|
-
'B'
|
624
|
-
>>> m[2007]
|
625
|
-
'C'
|
626
|
-
>>> m[2008]
|
627
|
-
'C'
|
628
|
-
|
629
|
-
>>> m[RangeMap.last_item]
|
630
|
-
'B'
|
631
|
-
|
632
|
-
>>> m.get(2008, m[RangeMap.last_item])
|
633
|
-
'C'
|
634
|
-
|
635
|
-
|
636
|
-
Now test the dynamic info (but fallback to our simple RangeMap
|
637
|
-
on systems that don't have dynamicInfo).
|
638
|
-
|
639
|
-
>>> dinfo = getattr(tzi, 'dynamicInfo', m)
|
640
|
-
>>> 2007 in dinfo
|
641
|
-
True
|
642
|
-
>>> 2008 in dinfo
|
643
|
-
False
|
644
|
-
>>> dinfo[2007] == dinfo[2008] == dinfo[2012]
|
645
|
-
True
|
646
|
-
"""
|
647
|
-
try:
|
648
|
-
info = key.subkey("Dynamic DST")
|
649
|
-
except FileNotFoundError:
|
650
|
-
return
|
651
|
-
del info["FirstEntry"]
|
652
|
-
del info["LastEntry"]
|
653
|
-
|
654
|
-
infos = [
|
655
|
-
(int(year), TimeZoneDefinition(values)) for year, values in info.items()
|
656
|
-
]
|
657
|
-
# create a range mapping that searches by descending year and matches
|
658
|
-
# if the target year is greater or equal.
|
659
|
-
self.dynamicInfo = RangeMap(
|
660
|
-
infos,
|
661
|
-
sort_params={"reverse": True},
|
662
|
-
key_match_comparator=operator.ge,
|
663
|
-
)
|
664
|
-
|
665
|
-
def __repr__(self) -> str:
|
666
|
-
result = f"{self.__class__.__name__}({self.timeZoneName!r}"
|
667
|
-
if self.fixedStandardTime:
|
668
|
-
result += ", True"
|
669
|
-
result += ")"
|
670
|
-
return result
|
671
|
-
|
672
|
-
def __str__(self) -> str:
|
673
|
-
return self.displayName
|
674
|
-
|
675
|
-
@overload # type: ignore[override] # Split definition into overrides
|
676
|
-
def tzname(self, dt: datetime.datetime) -> str: ...
|
677
|
-
@overload
|
678
|
-
def tzname(self, dt: None) -> None: ...
|
679
|
-
def tzname(self, dt: datetime.datetime | None) -> str | None:
|
680
|
-
"""
|
681
|
-
>>> MST = TimeZoneInfo('Mountain Standard Time')
|
682
|
-
>>> MST.tzname(datetime.datetime(2003, 8, 2))
|
683
|
-
'Mountain Daylight Time'
|
684
|
-
>>> MST.tzname(datetime.datetime(2003, 11, 25))
|
685
|
-
'Mountain Standard Time'
|
686
|
-
>>> MST.tzname(None)
|
687
|
-
|
688
|
-
"""
|
689
|
-
# https://docs.python.org/3/library/datetime.html#datetime.tzinfo.tzname
|
690
|
-
# > [...] returning `None` is appropriate if the class wishes to say
|
691
|
-
# > that `time` objects don’t participate in the `tzinfo` protocols.
|
692
|
-
if dt is None:
|
693
|
-
return None
|
694
|
-
|
695
|
-
dst = self.dst(dt)
|
696
|
-
winInfo = self.getWinInfo(dt.year)
|
697
|
-
if dst == -winInfo.daylight_bias:
|
698
|
-
return self.daylightName
|
699
|
-
elif dst == -winInfo.standard_bias:
|
700
|
-
return self.standardName
|
701
|
-
|
702
|
-
raise ValueError(
|
703
|
-
"Unexpected daylight bias",
|
704
|
-
dt,
|
705
|
-
dst,
|
706
|
-
winInfo.daylight_bias,
|
707
|
-
winInfo.standard_bias,
|
708
|
-
)
|
709
|
-
|
710
|
-
def getWinInfo(self, targetYear: int) -> TimeZoneDefinition:
|
711
|
-
"""
|
712
|
-
Return the most relevant "info" for this time zone
|
713
|
-
in the target year.
|
714
|
-
"""
|
715
|
-
if not getattr(self, "dynamicInfo", {}):
|
716
|
-
return self.staticInfo
|
717
|
-
# Find the greatest year entry in self.dynamicInfo which is for
|
718
|
-
# a year greater than or equal to our targetYear. If not found,
|
719
|
-
# default to the earliest year.
|
720
|
-
return self.dynamicInfo.get(targetYear, self.dynamicInfo[RangeMap.last_item])
|
721
|
-
|
722
|
-
def _getStandardBias(self, dt):
|
723
|
-
winInfo = self.getWinInfo(dt.year)
|
724
|
-
return winInfo.bias + winInfo.standard_bias
|
725
|
-
|
726
|
-
def _getDaylightBias(self, dt):
|
727
|
-
winInfo = self.getWinInfo(dt.year)
|
728
|
-
return winInfo.bias + winInfo.daylight_bias
|
729
|
-
|
730
|
-
@overload # type: ignore[override] # False-positive, our overload covers all base types
|
731
|
-
def utcoffset(self, dt: None) -> None: ...
|
732
|
-
@overload
|
733
|
-
def utcoffset(self, dt: datetime.datetime) -> datetime.timedelta: ...
|
734
|
-
def utcoffset(self, dt: datetime.datetime | None) -> datetime.timedelta | None:
|
735
|
-
"Calculates the utcoffset according to the datetime.tzinfo spec"
|
736
|
-
if dt is None:
|
737
|
-
return None
|
738
|
-
winInfo = self.getWinInfo(dt.year)
|
739
|
-
return -winInfo.bias + self.dst(dt)
|
740
|
-
|
741
|
-
@overload # type: ignore[override] # False-positive, our overload covers all base types
|
742
|
-
def dst(self, dt: None) -> None: ...
|
743
|
-
@overload
|
744
|
-
def dst(self, dt: datetime.datetime) -> datetime.timedelta: ...
|
745
|
-
def dst(self, dt: datetime.datetime | None) -> datetime.timedelta | None:
|
746
|
-
"""
|
747
|
-
Calculate the daylight savings offset according to the
|
748
|
-
datetime.tzinfo spec.
|
749
|
-
"""
|
750
|
-
if dt is None:
|
751
|
-
return None
|
752
|
-
winInfo = self.getWinInfo(dt.year)
|
753
|
-
if not self.fixedStandardTime and self._inDaylightSavings(dt):
|
754
|
-
result = winInfo.daylight_bias
|
755
|
-
else:
|
756
|
-
result = winInfo.standard_bias
|
757
|
-
return -result
|
758
|
-
|
759
|
-
def _inDaylightSavings(self, dt):
|
760
|
-
dt = dt.replace(tzinfo=None)
|
761
|
-
winInfo = self.getWinInfo(dt.year)
|
762
|
-
try:
|
763
|
-
dstStart = self.GetDSTStartTime(dt.year)
|
764
|
-
dstEnd = self.GetDSTEndTime(dt.year)
|
765
|
-
|
766
|
-
# at the end of DST, when clocks are moved back, there's a period
|
767
|
-
# of daylight_bias where it's ambiguous whether we're in DST or
|
768
|
-
# not.
|
769
|
-
dstEndAdj = dstEnd + winInfo.daylight_bias
|
770
|
-
|
771
|
-
# the same thing could theoretically happen at the start of DST
|
772
|
-
# if there's a standard_bias (which I suspect is always 0).
|
773
|
-
dstStartAdj = dstStart + winInfo.standard_bias
|
774
|
-
|
775
|
-
if dstStart < dstEnd:
|
776
|
-
in_dst = dstStartAdj <= dt < dstEndAdj
|
777
|
-
else:
|
778
|
-
# in the southern hemisphere, daylight savings time
|
779
|
-
# typically ends before it begins in a given year.
|
780
|
-
in_dst = not (dstEndAdj < dt <= dstStartAdj)
|
781
|
-
except ValueError:
|
782
|
-
# there was an error parsing the time zone, which is normal when a
|
783
|
-
# start and end time are not specified.
|
784
|
-
in_dst = False
|
785
|
-
|
786
|
-
return in_dst
|
787
|
-
|
788
|
-
def GetDSTStartTime(self, year: int) -> datetime.datetime:
|
789
|
-
"Given a year, determines the time when daylight savings time starts"
|
790
|
-
return self.getWinInfo(year).locate_daylight_start(year)
|
791
|
-
|
792
|
-
def GetDSTEndTime(self, year: int) -> datetime.datetime:
|
793
|
-
"Given a year, determines the time when daylight savings ends."
|
794
|
-
return self.getWinInfo(year).locate_standard_start(year)
|
795
|
-
|
796
|
-
def __eq__(self, other: object) -> bool:
|
797
|
-
return self.__dict__ == other.__dict__
|
798
|
-
|
799
|
-
def __ne__(self, other: object) -> bool:
|
800
|
-
return self.__dict__ != other.__dict__
|
801
|
-
|
802
|
-
@classmethod
|
803
|
-
def local(cls) -> Self:
|
804
|
-
"""Returns the local time zone as defined by the operating system in the
|
805
|
-
registry.
|
806
|
-
>>> localTZ = TimeZoneInfo.local()
|
807
|
-
>>> now_local = datetime.datetime.now(localTZ)
|
808
|
-
>>> now_UTC = datetime.datetime.utcnow() # deprecated
|
809
|
-
>>> (now_UTC - now_local) < datetime.timedelta(seconds = 5)
|
810
|
-
Traceback (most recent call last):
|
811
|
-
...
|
812
|
-
TypeError: can't subtract offset-naive and offset-aware datetimes
|
813
|
-
|
814
|
-
>>> now_UTC = now_UTC.replace(tzinfo = TimeZoneInfo('GMT Standard Time', True))
|
815
|
-
|
816
|
-
Now one can compare the results of the two offset aware values
|
817
|
-
>>> (now_UTC - now_local) < datetime.timedelta(seconds = 5)
|
818
|
-
True
|
819
|
-
|
820
|
-
Or use the newer `datetime.timezone.utc`
|
821
|
-
>>> now_UTC = datetime.datetime.now(datetime.timezone.utc)
|
822
|
-
>>> (now_UTC - now_local) < datetime.timedelta(seconds = 5)
|
823
|
-
True
|
824
|
-
"""
|
825
|
-
code, info = TimeZoneDefinition.current()
|
826
|
-
# code is 0 if daylight savings is disabled or not defined
|
827
|
-
# code is 1 or 2 if daylight savings is enabled, 2 if currently active
|
828
|
-
fix_standard_time = not code
|
829
|
-
# note that although the given information is sufficient
|
830
|
-
# to construct a WinTZI object, it's
|
831
|
-
# not sufficient to represent the time zone in which
|
832
|
-
# the current user is operating due
|
833
|
-
# to dynamic time zones.
|
834
|
-
return cls(info, fix_standard_time)
|
835
|
-
|
836
|
-
_tzutc: ClassVar[Self | None] = None
|
837
|
-
|
838
|
-
@classmethod
|
839
|
-
def utc(cls) -> Self:
|
840
|
-
"""Returns a time-zone representing UTC.
|
841
|
-
|
842
|
-
Same as TimeZoneInfo('GMT Standard Time', True) but caches the result
|
843
|
-
for performance.
|
844
|
-
|
845
|
-
>>> isinstance(TimeZoneInfo.utc(), TimeZoneInfo)
|
846
|
-
True
|
847
|
-
"""
|
848
|
-
if not cls._tzutc:
|
849
|
-
cls._tzutc = cls("GMT Standard Time", True)
|
850
|
-
return cls._tzutc
|
851
|
-
|
852
|
-
# helper methods for accessing the timezone info from the registry
|
853
|
-
@staticmethod
|
854
|
-
def _get_time_zone_key(subkey=None):
|
855
|
-
"Return the registry key that stores time zone details"
|
856
|
-
key = _RegKeyDict.open(winreg.HKEY_LOCAL_MACHINE, TimeZoneInfo.tzRegKey)
|
857
|
-
if subkey:
|
858
|
-
key = key.subkey(subkey)
|
859
|
-
return key
|
860
|
-
|
861
|
-
@staticmethod
|
862
|
-
def _get_time_zone_key_names():
|
863
|
-
"Returns the names of the (registry keys of the) time zones"
|
864
|
-
return TimeZoneInfo._get_time_zone_key().subkeys()
|
865
|
-
|
866
|
-
@staticmethod
|
867
|
-
def _get_indexed_time_zone_keys(index_key="Index"):
|
868
|
-
"""
|
869
|
-
Get the names of the registry keys indexed by a value in that key,
|
870
|
-
ignoring any keys for which that value is empty or missing.
|
871
|
-
"""
|
872
|
-
key_names = list(TimeZoneInfo._get_time_zone_key_names())
|
873
|
-
|
874
|
-
def get_index_value(key_name):
|
875
|
-
key = TimeZoneInfo._get_time_zone_key(key_name)
|
876
|
-
return key.get(index_key)
|
877
|
-
|
878
|
-
values = map(get_index_value, key_names)
|
879
|
-
|
880
|
-
return (
|
881
|
-
(value, key_name) for value, key_name in zip(values, key_names) if value
|
882
|
-
)
|
883
|
-
|
884
|
-
@staticmethod
|
885
|
-
def get_sorted_time_zone_names() -> list[str]:
|
886
|
-
"""
|
887
|
-
Return a list of time zone names that can
|
888
|
-
be used to initialize TimeZoneInfo instances.
|
889
|
-
"""
|
890
|
-
tzs = TimeZoneInfo.get_sorted_time_zones()
|
891
|
-
return [tz.standardName for tz in tzs]
|
892
|
-
|
893
|
-
@staticmethod
|
894
|
-
def get_all_time_zones() -> list[TimeZoneInfo]:
|
895
|
-
return [TimeZoneInfo(n) for n in TimeZoneInfo._get_time_zone_key_names()]
|
896
|
-
|
897
|
-
@staticmethod
|
898
|
-
def get_sorted_time_zones(key=None) -> list[TimeZoneInfo]:
|
899
|
-
"""
|
900
|
-
Return the time zones sorted by some key.
|
901
|
-
key must be a function that takes a TimeZoneInfo object and returns
|
902
|
-
a value suitable for sorting on.
|
903
|
-
The key defaults to the bias (descending), as is done in Windows
|
904
|
-
(see https://web.archive.org/web/20130723075340/http://blogs.msdn.com/b/michkap/archive/2006/12/22/1350684.aspx)
|
905
|
-
"""
|
906
|
-
key = key or (lambda tzi: -tzi.staticInfo.bias)
|
907
|
-
zones = TimeZoneInfo.get_all_time_zones()
|
908
|
-
zones.sort(key=key)
|
909
|
-
return zones
|
910
|
-
|
911
|
-
|
912
|
-
class _RegKeyDict(Dict[str, str]):
|
913
|
-
def __init__(self, key: winreg._KeyType):
|
914
|
-
dict.__init__(self)
|
915
|
-
self.key = key
|
916
|
-
self.__load_values()
|
917
|
-
|
918
|
-
@classmethod
|
919
|
-
def open(
|
920
|
-
cls, key: winreg._KeyType, sub_key: str, reserved: int = 0, access: int = 131097
|
921
|
-
) -> _RegKeyDict:
|
922
|
-
return _RegKeyDict(winreg.OpenKeyEx(key, sub_key, reserved, access))
|
923
|
-
|
924
|
-
def subkey(self, name: str) -> _RegKeyDict:
|
925
|
-
if not name:
|
926
|
-
raise ValueError("subkey name cannot be empty")
|
927
|
-
return _RegKeyDict(winreg.OpenKeyEx(self.key, name))
|
928
|
-
|
929
|
-
def __load_values(self):
|
930
|
-
pairs = [(n, v) for (n, v, t) in self._enumerate_reg_values(self.key)]
|
931
|
-
self.update(pairs)
|
932
|
-
|
933
|
-
def subkeys(self):
|
934
|
-
return self._enumerate_reg_keys(self.key)
|
935
|
-
|
936
|
-
@staticmethod
|
937
|
-
def _enumerate_reg_values(key):
|
938
|
-
return _RegKeyDict._enumerate_reg(key, winreg.EnumValue)
|
939
|
-
|
940
|
-
@staticmethod
|
941
|
-
def _enumerate_reg_keys(key):
|
942
|
-
return _RegKeyDict._enumerate_reg(key, winreg.EnumKey)
|
943
|
-
|
944
|
-
@staticmethod
|
945
|
-
def _enumerate_reg(
|
946
|
-
key: _T, func: Callable[[_T, int], _VT]
|
947
|
-
) -> Generator[_VT, None, None]:
|
948
|
-
"Enumerates an open registry key as an iterable generator"
|
949
|
-
try:
|
950
|
-
for index in count():
|
951
|
-
yield func(key, index)
|
952
|
-
except OSError:
|
953
|
-
pass
|
954
|
-
|
955
|
-
|
956
|
-
def utcnow() -> datetime.datetime:
|
957
|
-
"""
|
958
|
-
Return the UTC time now with timezone awareness as enabled
|
959
|
-
by this module
|
960
|
-
>>> now = utcnow()
|
961
|
-
|
962
|
-
>>> (now - datetime.datetime.now(datetime.timezone.utc)) < datetime.timedelta(seconds = 5)
|
963
|
-
True
|
964
|
-
>>> type(now.tzinfo) is TimeZoneInfo
|
965
|
-
True
|
966
|
-
"""
|
967
|
-
return datetime.datetime.now(TimeZoneInfo.utc())
|
968
|
-
|
969
|
-
|
970
|
-
def now() -> datetime.datetime:
|
971
|
-
"""
|
972
|
-
Return the local time now with timezone awareness as enabled
|
973
|
-
by this module
|
974
|
-
>>> now_local = now()
|
975
|
-
|
976
|
-
>>> (now_local - datetime.datetime.now(datetime.timezone.utc)) < datetime.timedelta(seconds = 5)
|
977
|
-
True
|
978
|
-
>>> type(now_local.tzinfo) is TimeZoneInfo
|
979
|
-
True
|
980
|
-
"""
|
981
|
-
return datetime.datetime.now(TimeZoneInfo.local())
|
982
|
-
|
983
|
-
|
984
|
-
def GetTZCapabilities() -> dict[str, bool]:
|
985
|
-
"""
|
986
|
-
Run a few known tests to determine the capabilities of
|
987
|
-
the time zone database on this machine.
|
988
|
-
Note Dynamic Time Zone support is not available on any
|
989
|
-
platform at this time; this
|
990
|
-
is a limitation of this library, not the platform."""
|
991
|
-
tzi = TimeZoneInfo("Mountain Standard Time")
|
992
|
-
MissingTZPatch = datetime.datetime(2007, 11, 2, tzinfo=tzi).utctimetuple() != (
|
993
|
-
2007,
|
994
|
-
11,
|
995
|
-
2,
|
996
|
-
6,
|
997
|
-
0,
|
998
|
-
0,
|
999
|
-
4,
|
1000
|
-
306,
|
1001
|
-
0,
|
1002
|
-
)
|
1003
|
-
DynamicTZSupport = not MissingTZPatch and datetime.datetime(
|
1004
|
-
2003, 11, 2, tzinfo=tzi
|
1005
|
-
).utctimetuple() == (2003, 11, 2, 7, 0, 0, 6, 306, 0)
|
1006
|
-
del tzi
|
1007
|
-
return locals()
|
1008
|
-
|
1009
|
-
|
1010
|
-
class DLLHandleCache:
|
1011
|
-
def __init__(self) -> None:
|
1012
|
-
self.__cache: dict[str, int] = {}
|
1013
|
-
|
1014
|
-
def __getitem__(self, filename: str) -> int:
|
1015
|
-
key = filename.lower()
|
1016
|
-
return self.__cache.setdefault(key, win32api.LoadLibrary(key))
|
1017
|
-
|
1018
|
-
|
1019
|
-
DLLCache = DLLHandleCache()
|
1020
|
-
|
1021
|
-
|
1022
|
-
def resolveMUITimeZone(spec: str) -> str | None:
|
1023
|
-
"""Resolve a multilingual user interface resource for the time zone name
|
1024
|
-
|
1025
|
-
spec should be of the format @path,-stringID[;comment]
|
1026
|
-
see https://learn.microsoft.com/en-ca/windows/win32/api/timezoneapi/ns-timezoneapi-time_zone_information
|
1027
|
-
for details
|
1028
|
-
|
1029
|
-
>>> import sys
|
1030
|
-
>>> result = resolveMUITimeZone('@tzres.dll,-110')
|
1031
|
-
>>> expectedResultType = [type(None),str][sys.getwindowsversion() >= (6,)]
|
1032
|
-
>>> type(result) is expectedResultType
|
1033
|
-
True
|
1034
|
-
"""
|
1035
|
-
pattern = re.compile(r"@(?P<dllname>.*),-(?P<index>\d+)(?:;(?P<comment>.*))?")
|
1036
|
-
matcher = pattern.match(spec)
|
1037
|
-
assert matcher, "Could not parse MUI spec"
|
1038
|
-
|
1039
|
-
groupdict = matcher.groupdict()
|
1040
|
-
try:
|
1041
|
-
handle = DLLCache[groupdict["dllname"]]
|
1042
|
-
result: str | None = win32api.LoadString(handle, int(groupdict["index"]))
|
1043
|
-
except win32api.error:
|
1044
|
-
result = None
|
1045
|
-
return result
|
1046
|
-
|
1047
|
-
|
1048
|
-
# from jaraco.collections 5.1
|
1049
|
-
class RangeMap(Dict[_RangeMapKT, _VT]):
|
1050
|
-
"""
|
1051
|
-
A dictionary-like object that uses the keys as bounds for a range.
|
1052
|
-
Inclusion of the value for that range is determined by the
|
1053
|
-
key_match_comparator, which defaults to less-than-or-equal.
|
1054
|
-
A value is returned for a key if it is the first key that matches in
|
1055
|
-
the sorted list of keys.
|
1056
|
-
|
1057
|
-
One may supply keyword parameters to be passed to the sort function used
|
1058
|
-
to sort keys (i.e. key, reverse) as sort_params.
|
1059
|
-
|
1060
|
-
Create a map that maps 1-3 -> 'a', 4-6 -> 'b'
|
1061
|
-
|
1062
|
-
>>> r = RangeMap({3: 'a', 6: 'b'}) # boy, that was easy
|
1063
|
-
>>> r[1], r[2], r[3], r[4], r[5], r[6]
|
1064
|
-
('a', 'a', 'a', 'b', 'b', 'b')
|
1065
|
-
|
1066
|
-
Even float values should work so long as the comparison operator
|
1067
|
-
supports it.
|
1068
|
-
|
1069
|
-
>>> r[4.5]
|
1070
|
-
'b'
|
1071
|
-
|
1072
|
-
Notice that the way rangemap is defined, it must be open-ended
|
1073
|
-
on one side.
|
1074
|
-
|
1075
|
-
>>> r[0]
|
1076
|
-
'a'
|
1077
|
-
>>> r[-1]
|
1078
|
-
'a'
|
1079
|
-
|
1080
|
-
One can close the open-end of the RangeMap by using undefined_value
|
1081
|
-
|
1082
|
-
>>> r = RangeMap({0: RangeMap.undefined_value, 3: 'a', 6: 'b'})
|
1083
|
-
>>> r[0]
|
1084
|
-
Traceback (most recent call last):
|
1085
|
-
...
|
1086
|
-
KeyError: 0
|
1087
|
-
|
1088
|
-
One can get the first or last elements in the range by using RangeMap.Item
|
1089
|
-
|
1090
|
-
>>> last_item = RangeMap.Item(-1)
|
1091
|
-
>>> r[last_item]
|
1092
|
-
'b'
|
1093
|
-
|
1094
|
-
.last_item is a shortcut for Item(-1)
|
1095
|
-
|
1096
|
-
>>> r[RangeMap.last_item]
|
1097
|
-
'b'
|
1098
|
-
|
1099
|
-
Sometimes it's useful to find the bounds for a RangeMap
|
1100
|
-
|
1101
|
-
>>> r.bounds()
|
1102
|
-
(0, 6)
|
1103
|
-
|
1104
|
-
RangeMap supports .get(key, default)
|
1105
|
-
|
1106
|
-
>>> r.get(0, 'not found')
|
1107
|
-
'not found'
|
1108
|
-
|
1109
|
-
>>> r.get(7, 'not found')
|
1110
|
-
'not found'
|
1111
|
-
|
1112
|
-
One often wishes to define the ranges by their left-most values,
|
1113
|
-
which requires use of sort params and a key_match_comparator.
|
1114
|
-
|
1115
|
-
>>> r = RangeMap({1: 'a', 4: 'b'},
|
1116
|
-
... sort_params=dict(reverse=True),
|
1117
|
-
... key_match_comparator=operator.ge)
|
1118
|
-
>>> r[1], r[2], r[3], r[4], r[5], r[6]
|
1119
|
-
('a', 'a', 'a', 'b', 'b', 'b')
|
1120
|
-
|
1121
|
-
That wasn't nearly as easy as before, so an alternate constructor
|
1122
|
-
is provided:
|
1123
|
-
|
1124
|
-
>>> r = RangeMap.left({1: 'a', 4: 'b', 7: RangeMap.undefined_value})
|
1125
|
-
>>> r[1], r[2], r[3], r[4], r[5], r[6]
|
1126
|
-
('a', 'a', 'a', 'b', 'b', 'b')
|
1127
|
-
|
1128
|
-
"""
|
1129
|
-
|
1130
|
-
def __init__(
|
1131
|
-
self,
|
1132
|
-
source: (
|
1133
|
-
SupportsKeysAndGetItem[_RangeMapKT, _VT] | Iterable[tuple[_RangeMapKT, _VT]]
|
1134
|
-
),
|
1135
|
-
sort_params: Mapping[str, Any] = {},
|
1136
|
-
key_match_comparator: Callable[[_RangeMapKT, _RangeMapKT], bool] = operator.le,
|
1137
|
-
) -> None:
|
1138
|
-
dict.__init__(self, source)
|
1139
|
-
self.sort_params = sort_params
|
1140
|
-
self.match = key_match_comparator
|
1141
|
-
|
1142
|
-
@classmethod
|
1143
|
-
def left(
|
1144
|
-
cls,
|
1145
|
-
source: (
|
1146
|
-
SupportsKeysAndGetItem[_RangeMapKT, _VT] | Iterable[tuple[_RangeMapKT, _VT]]
|
1147
|
-
),
|
1148
|
-
) -> Self:
|
1149
|
-
return cls(
|
1150
|
-
source, sort_params={"reverse": True}, key_match_comparator=operator.ge
|
1151
|
-
)
|
1152
|
-
|
1153
|
-
def __getitem__(self, item: _RangeMapKT) -> _VT:
|
1154
|
-
sorted_keys = sorted(self, **self.sort_params)
|
1155
|
-
if isinstance(item, RangeMap.Item):
|
1156
|
-
result = self.__getitem__(sorted_keys[item])
|
1157
|
-
else:
|
1158
|
-
key = self._find_first_match_(sorted_keys, item)
|
1159
|
-
result = dict.__getitem__(self, key)
|
1160
|
-
if result is RangeMap.undefined_value:
|
1161
|
-
raise KeyError(key)
|
1162
|
-
return result
|
1163
|
-
|
1164
|
-
@overload # type: ignore[override] # Signature simplified over dict and Mapping
|
1165
|
-
def get(self, key: _RangeMapKT, default: _T) -> _VT | _T: ...
|
1166
|
-
@overload
|
1167
|
-
def get(self, key: _RangeMapKT, default: None = None) -> _VT | None: ...
|
1168
|
-
def get(self, key: _RangeMapKT, default: _T | None = None) -> _VT | _T | None:
|
1169
|
-
"""
|
1170
|
-
Return the value for key if key is in the dictionary, else default.
|
1171
|
-
If default is not given, it defaults to None, so that this method
|
1172
|
-
never raises a KeyError.
|
1173
|
-
"""
|
1174
|
-
# Necessary to use our own __getitem__ and not dict's
|
1175
|
-
try:
|
1176
|
-
return self[key]
|
1177
|
-
except KeyError:
|
1178
|
-
return default
|
1179
|
-
|
1180
|
-
def _find_first_match_(
|
1181
|
-
self, keys: Iterable[_RangeMapKT], item: _RangeMapKT
|
1182
|
-
) -> _RangeMapKT:
|
1183
|
-
is_match = functools.partial(self.match, item)
|
1184
|
-
matches = filter(is_match, keys)
|
1185
|
-
try:
|
1186
|
-
return next(matches)
|
1187
|
-
except StopIteration:
|
1188
|
-
raise KeyError(item) from None
|
1189
|
-
|
1190
|
-
def bounds(self) -> tuple[_RangeMapKT, _RangeMapKT]:
|
1191
|
-
sorted_keys = sorted(self, **self.sort_params)
|
1192
|
-
return (sorted_keys[RangeMap.first_item], sorted_keys[RangeMap.last_item])
|
1193
|
-
|
1194
|
-
# some special values for the RangeMap
|
1195
|
-
undefined_value = type("RangeValueUndefined", (), {})()
|
1196
|
-
|
1197
|
-
class Item(int):
|
1198
|
-
"""RangeMap Item"""
|
1199
|
-
|
1200
|
-
first_item = Item(0)
|
1201
|
-
last_item = Item(-1)
|