diff --git a/.gitattributes b/.gitattributes index 216c76055a918f757c660f7e572abf64655e9ba7..44777e1b2c06bf512de7c6f07dec84aac60ad74f 100644 --- a/.gitattributes +++ b/.gitattributes @@ -90,3 +90,6 @@ parrot/lib/libbz2.so.1.0 filter=lfs diff=lfs merge=lfs -text parrot/lib/liblzma.so.5.6.4 filter=lfs diff=lfs merge=lfs -text parrot/lib/libbz2.a filter=lfs diff=lfs merge=lfs -text parrot/lib/libtinfow.a filter=lfs diff=lfs merge=lfs -text +parrot/lib/libncursesw.so filter=lfs diff=lfs merge=lfs -text +parrot/lib/libbz2.so.1.0.8 filter=lfs diff=lfs merge=lfs -text +parrot/lib/python3.10/tkinter/__pycache__/__init__.cpython-310.pyc filter=lfs diff=lfs merge=lfs -text diff --git a/parrot/lib/libbz2.so.1.0.8 b/parrot/lib/libbz2.so.1.0.8 new file mode 100644 index 0000000000000000000000000000000000000000..7e057fb75b1b533e33984742a4a02254948e177f --- /dev/null +++ b/parrot/lib/libbz2.so.1.0.8 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4979469ae49ac144f62202f75bbdd69b17197aedb879d633337c8cf7e4aba301 +size 229016 diff --git a/parrot/lib/libncursesw.so b/parrot/lib/libncursesw.so new file mode 100644 index 0000000000000000000000000000000000000000..0745e17b73f2d5570bc5f8868bab0381bd7da794 --- /dev/null +++ b/parrot/lib/libncursesw.so @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7fa4e5e93804d78660b0eef727cdb4211209e1742e4ad3669348022668d90962 +size 271304 diff --git a/parrot/lib/python3.10/site-packages/aiofiles-23.2.1.dist-info/RECORD b/parrot/lib/python3.10/site-packages/aiofiles-23.2.1.dist-info/RECORD new file mode 100644 index 0000000000000000000000000000000000000000..1bde3a70b6e92a5b197eb483b842dec822cb0250 --- /dev/null +++ b/parrot/lib/python3.10/site-packages/aiofiles-23.2.1.dist-info/RECORD @@ -0,0 +1,27 @@ +aiofiles-23.2.1.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4 +aiofiles-23.2.1.dist-info/METADATA,sha256=cot28p_PNjdl_MK--l9Qu2e6QOv9OxdHrKbjLmYf9Uw,9673 +aiofiles-23.2.1.dist-info/RECORD,, +aiofiles-23.2.1.dist-info/REQUESTED,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +aiofiles-23.2.1.dist-info/WHEEL,sha256=KGYbc1zXlYddvwxnNty23BeaKzh7YuoSIvIMO4jEhvw,87 +aiofiles-23.2.1.dist-info/licenses/LICENSE,sha256=y16Ofl9KOYjhBjwULGDcLfdWBfTEZRXnduOspt-XbhQ,11325 +aiofiles-23.2.1.dist-info/licenses/NOTICE,sha256=EExY0dRQvWR0wJ2LZLwBgnM6YKw9jCU-M0zegpRSD_E,55 +aiofiles/__init__.py,sha256=1iAMJQyJtX3LGIS0AoFTJeO1aJ_RK2jpBSBhg0VoIrE,344 +aiofiles/__pycache__/__init__.cpython-310.pyc,, +aiofiles/__pycache__/base.cpython-310.pyc,, +aiofiles/__pycache__/os.cpython-310.pyc,, +aiofiles/__pycache__/ospath.cpython-310.pyc,, +aiofiles/base.py,sha256=rZwA151Ji8XlBkzvDmcF1CgDTY2iKNuJMfvNlM0s0E0,2684 +aiofiles/os.py,sha256=zuFGaIyGCGUuFb7trFFEm6SLdCRqTFsSV0mY6SO8z3M,970 +aiofiles/ospath.py,sha256=zqG2VFzRb6yYiIOWipqsdgvZmoMTFvZmBdkxkAl1FT4,764 +aiofiles/tempfile/__init__.py,sha256=hFSNTOjOUv371Ozdfy6FIxeln46Nm3xOVh4ZR3Q94V0,10244 +aiofiles/tempfile/__pycache__/__init__.cpython-310.pyc,, +aiofiles/tempfile/__pycache__/temptypes.cpython-310.pyc,, +aiofiles/tempfile/temptypes.py,sha256=ddEvNjMLVlr7WUILCe6ypTqw77yREeIonTk16Uw_NVs,2093 +aiofiles/threadpool/__init__.py,sha256=c_aexl1t193iKdPZaolPEEbHDrQ0RrsH_HTAToMPQBo,3171 +aiofiles/threadpool/__pycache__/__init__.cpython-310.pyc,, +aiofiles/threadpool/__pycache__/binary.cpython-310.pyc,, +aiofiles/threadpool/__pycache__/text.cpython-310.pyc,, +aiofiles/threadpool/__pycache__/utils.cpython-310.pyc,, +aiofiles/threadpool/binary.py,sha256=hp-km9VCRu0MLz_wAEUfbCz7OL7xtn9iGAawabpnp5U,2315 +aiofiles/threadpool/text.py,sha256=fNmpw2PEkj0BZSldipJXAgZqVGLxALcfOMiuDQ54Eas,1223 +aiofiles/threadpool/utils.py,sha256=B59dSZwO_WZs2dFFycKeA91iD2Xq2nNw1EFF8YMBI5k,1868 diff --git a/parrot/lib/python3.10/site-packages/aiofiles-23.2.1.dist-info/REQUESTED b/parrot/lib/python3.10/site-packages/aiofiles-23.2.1.dist-info/REQUESTED new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/parrot/lib/python3.10/site-packages/google/protobuf/__pycache__/descriptor.cpython-310.pyc b/parrot/lib/python3.10/site-packages/google/protobuf/__pycache__/descriptor.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f3f4b3f968daa0dc7a471fa1282a70177361f646 Binary files /dev/null and b/parrot/lib/python3.10/site-packages/google/protobuf/__pycache__/descriptor.cpython-310.pyc differ diff --git a/parrot/lib/python3.10/site-packages/google/protobuf/__pycache__/descriptor_database.cpython-310.pyc b/parrot/lib/python3.10/site-packages/google/protobuf/__pycache__/descriptor_database.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..46c5814c0a9dbb8bbafff585ce4a616a7104529d Binary files /dev/null and b/parrot/lib/python3.10/site-packages/google/protobuf/__pycache__/descriptor_database.cpython-310.pyc differ diff --git a/parrot/lib/python3.10/site-packages/google/protobuf/__pycache__/json_format.cpython-310.pyc b/parrot/lib/python3.10/site-packages/google/protobuf/__pycache__/json_format.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e7f7926af6f094b3d73804a4898140b608558893 Binary files /dev/null and b/parrot/lib/python3.10/site-packages/google/protobuf/__pycache__/json_format.cpython-310.pyc differ diff --git a/parrot/lib/python3.10/site-packages/google/protobuf/__pycache__/message.cpython-310.pyc b/parrot/lib/python3.10/site-packages/google/protobuf/__pycache__/message.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..22e4f0a9f28828b01014765d25956cfc5d5b80f0 Binary files /dev/null and b/parrot/lib/python3.10/site-packages/google/protobuf/__pycache__/message.cpython-310.pyc differ diff --git a/parrot/lib/python3.10/site-packages/google/protobuf/__pycache__/message_factory.cpython-310.pyc b/parrot/lib/python3.10/site-packages/google/protobuf/__pycache__/message_factory.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..432693c01ed81593fba9ca7844f1fd97deaef725 Binary files /dev/null and b/parrot/lib/python3.10/site-packages/google/protobuf/__pycache__/message_factory.cpython-310.pyc differ diff --git a/parrot/lib/python3.10/site-packages/google/protobuf/__pycache__/proto.cpython-310.pyc b/parrot/lib/python3.10/site-packages/google/protobuf/__pycache__/proto.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d95b3d959a6ffa255382b10f4cca28618b34e1bd Binary files /dev/null and b/parrot/lib/python3.10/site-packages/google/protobuf/__pycache__/proto.cpython-310.pyc differ diff --git a/parrot/lib/python3.10/site-packages/google/protobuf/__pycache__/reflection.cpython-310.pyc b/parrot/lib/python3.10/site-packages/google/protobuf/__pycache__/reflection.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b5ad0e9e673382772ab2bc44a0d7f4ca69391988 Binary files /dev/null and b/parrot/lib/python3.10/site-packages/google/protobuf/__pycache__/reflection.cpython-310.pyc differ diff --git a/parrot/lib/python3.10/site-packages/google/protobuf/__pycache__/runtime_version.cpython-310.pyc b/parrot/lib/python3.10/site-packages/google/protobuf/__pycache__/runtime_version.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..1c13e51f92d26923d91e9b305710047086ac00d5 Binary files /dev/null and b/parrot/lib/python3.10/site-packages/google/protobuf/__pycache__/runtime_version.cpython-310.pyc differ diff --git a/parrot/lib/python3.10/site-packages/google/protobuf/__pycache__/service.cpython-310.pyc b/parrot/lib/python3.10/site-packages/google/protobuf/__pycache__/service.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f49bd2e753f3afba301b5224a03d580700f60740 Binary files /dev/null and b/parrot/lib/python3.10/site-packages/google/protobuf/__pycache__/service.cpython-310.pyc differ diff --git a/parrot/lib/python3.10/site-packages/google/protobuf/__pycache__/struct_pb2.cpython-310.pyc b/parrot/lib/python3.10/site-packages/google/protobuf/__pycache__/struct_pb2.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7f6ff7cb3803115006d85d34473a44ab61e7abde Binary files /dev/null and b/parrot/lib/python3.10/site-packages/google/protobuf/__pycache__/struct_pb2.cpython-310.pyc differ diff --git a/parrot/lib/python3.10/site-packages/google/protobuf/__pycache__/text_format.cpython-310.pyc b/parrot/lib/python3.10/site-packages/google/protobuf/__pycache__/text_format.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..678d4079e57a65e38dc81904b7ad6ccedb7b54ea Binary files /dev/null and b/parrot/lib/python3.10/site-packages/google/protobuf/__pycache__/text_format.cpython-310.pyc differ diff --git a/parrot/lib/python3.10/site-packages/google/protobuf/compiler/__init__.py b/parrot/lib/python3.10/site-packages/google/protobuf/compiler/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/parrot/lib/python3.10/site-packages/google/protobuf/compiler/__pycache__/__init__.cpython-310.pyc b/parrot/lib/python3.10/site-packages/google/protobuf/compiler/__pycache__/__init__.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..ac3f7a8471137a60e3bd292c7f8485be4dd117f9 Binary files /dev/null and b/parrot/lib/python3.10/site-packages/google/protobuf/compiler/__pycache__/__init__.cpython-310.pyc differ diff --git a/parrot/lib/python3.10/site-packages/google/protobuf/compiler/__pycache__/plugin_pb2.cpython-310.pyc b/parrot/lib/python3.10/site-packages/google/protobuf/compiler/__pycache__/plugin_pb2.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..85710cbe90e66549ab6365acb2b054c5dc3fd9a2 Binary files /dev/null and b/parrot/lib/python3.10/site-packages/google/protobuf/compiler/__pycache__/plugin_pb2.cpython-310.pyc differ diff --git a/parrot/lib/python3.10/site-packages/google/protobuf/compiler/plugin_pb2.py b/parrot/lib/python3.10/site-packages/google/protobuf/compiler/plugin_pb2.py new file mode 100644 index 0000000000000000000000000000000000000000..2b7bd96f5d01dafd07c53f8f1f269d2e33a835c0 --- /dev/null +++ b/parrot/lib/python3.10/site-packages/google/protobuf/compiler/plugin_pb2.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# NO CHECKED-IN PROTOBUF GENCODE +# source: google/protobuf/compiler/plugin.proto +# Protobuf Python Version: 5.28.2 +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import runtime_version as _runtime_version +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +_runtime_version.ValidateProtobufRuntimeVersion( + _runtime_version.Domain.PUBLIC, + 5, + 28, + 2, + '', + 'google/protobuf/compiler/plugin.proto' +) +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from google.protobuf import descriptor_pb2 as google_dot_protobuf_dot_descriptor__pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n%google/protobuf/compiler/plugin.proto\x12\x18google.protobuf.compiler\x1a google/protobuf/descriptor.proto\"c\n\x07Version\x12\x14\n\x05major\x18\x01 \x01(\x05R\x05major\x12\x14\n\x05minor\x18\x02 \x01(\x05R\x05minor\x12\x14\n\x05patch\x18\x03 \x01(\x05R\x05patch\x12\x16\n\x06suffix\x18\x04 \x01(\tR\x06suffix\"\xcf\x02\n\x14\x43odeGeneratorRequest\x12(\n\x10\x66ile_to_generate\x18\x01 \x03(\tR\x0e\x66ileToGenerate\x12\x1c\n\tparameter\x18\x02 \x01(\tR\tparameter\x12\x43\n\nproto_file\x18\x0f \x03(\x0b\x32$.google.protobuf.FileDescriptorProtoR\tprotoFile\x12\\\n\x17source_file_descriptors\x18\x11 \x03(\x0b\x32$.google.protobuf.FileDescriptorProtoR\x15sourceFileDescriptors\x12L\n\x10\x63ompiler_version\x18\x03 \x01(\x0b\x32!.google.protobuf.compiler.VersionR\x0f\x63ompilerVersion\"\x85\x04\n\x15\x43odeGeneratorResponse\x12\x14\n\x05\x65rror\x18\x01 \x01(\tR\x05\x65rror\x12-\n\x12supported_features\x18\x02 \x01(\x04R\x11supportedFeatures\x12\'\n\x0fminimum_edition\x18\x03 \x01(\x05R\x0eminimumEdition\x12\'\n\x0fmaximum_edition\x18\x04 \x01(\x05R\x0emaximumEdition\x12H\n\x04\x66ile\x18\x0f \x03(\x0b\x32\x34.google.protobuf.compiler.CodeGeneratorResponse.FileR\x04\x66ile\x1a\xb1\x01\n\x04\x46ile\x12\x12\n\x04name\x18\x01 \x01(\tR\x04name\x12\'\n\x0finsertion_point\x18\x02 \x01(\tR\x0einsertionPoint\x12\x18\n\x07\x63ontent\x18\x0f \x01(\tR\x07\x63ontent\x12R\n\x13generated_code_info\x18\x10 \x01(\x0b\x32\".google.protobuf.GeneratedCodeInfoR\x11generatedCodeInfo\"W\n\x07\x46\x65\x61ture\x12\x10\n\x0c\x46\x45\x41TURE_NONE\x10\x00\x12\x1b\n\x17\x46\x45\x41TURE_PROTO3_OPTIONAL\x10\x01\x12\x1d\n\x19\x46\x45\x41TURE_SUPPORTS_EDITIONS\x10\x02\x42r\n\x1c\x63om.google.protobuf.compilerB\x0cPluginProtosZ)google.golang.org/protobuf/types/pluginpb\xaa\x02\x18Google.Protobuf.Compiler') + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'google.protobuf.compiler.plugin_pb2', _globals) +if not _descriptor._USE_C_DESCRIPTORS: + _globals['DESCRIPTOR']._loaded_options = None + _globals['DESCRIPTOR']._serialized_options = b'\n\034com.google.protobuf.compilerB\014PluginProtosZ)google.golang.org/protobuf/types/pluginpb\252\002\030Google.Protobuf.Compiler' + _globals['_VERSION']._serialized_start=101 + _globals['_VERSION']._serialized_end=200 + _globals['_CODEGENERATORREQUEST']._serialized_start=203 + _globals['_CODEGENERATORREQUEST']._serialized_end=538 + _globals['_CODEGENERATORRESPONSE']._serialized_start=541 + _globals['_CODEGENERATORRESPONSE']._serialized_end=1058 + _globals['_CODEGENERATORRESPONSE_FILE']._serialized_start=792 + _globals['_CODEGENERATORRESPONSE_FILE']._serialized_end=969 + _globals['_CODEGENERATORRESPONSE_FEATURE']._serialized_start=971 + _globals['_CODEGENERATORRESPONSE_FEATURE']._serialized_end=1058 +# @@protoc_insertion_point(module_scope) diff --git a/parrot/lib/python3.10/site-packages/google/protobuf/internal/__pycache__/__init__.cpython-310.pyc b/parrot/lib/python3.10/site-packages/google/protobuf/internal/__pycache__/__init__.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7a210921644c4b1027269fc102d6406b49328b1f Binary files /dev/null and b/parrot/lib/python3.10/site-packages/google/protobuf/internal/__pycache__/__init__.cpython-310.pyc differ diff --git a/parrot/lib/python3.10/site-packages/google/protobuf/internal/__pycache__/_parameterized.cpython-310.pyc b/parrot/lib/python3.10/site-packages/google/protobuf/internal/__pycache__/_parameterized.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..525532dae37b555f4641220cbebb6205f52fec61 Binary files /dev/null and b/parrot/lib/python3.10/site-packages/google/protobuf/internal/__pycache__/_parameterized.cpython-310.pyc differ diff --git a/parrot/lib/python3.10/site-packages/google/protobuf/internal/__pycache__/builder.cpython-310.pyc b/parrot/lib/python3.10/site-packages/google/protobuf/internal/__pycache__/builder.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..ab9f799fdfb5517b82d8097037fb3e921cd7b748 Binary files /dev/null and b/parrot/lib/python3.10/site-packages/google/protobuf/internal/__pycache__/builder.cpython-310.pyc differ diff --git a/parrot/lib/python3.10/site-packages/google/protobuf/internal/__pycache__/containers.cpython-310.pyc b/parrot/lib/python3.10/site-packages/google/protobuf/internal/__pycache__/containers.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..0832a0d07edbb97e0982cfd76e5b9f4a2e9fcba1 Binary files /dev/null and b/parrot/lib/python3.10/site-packages/google/protobuf/internal/__pycache__/containers.cpython-310.pyc differ diff --git a/parrot/lib/python3.10/site-packages/google/protobuf/internal/__pycache__/decoder.cpython-310.pyc b/parrot/lib/python3.10/site-packages/google/protobuf/internal/__pycache__/decoder.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..86a9c6e6cc0e5163579a7f441e36548a3835b2a4 Binary files /dev/null and b/parrot/lib/python3.10/site-packages/google/protobuf/internal/__pycache__/decoder.cpython-310.pyc differ diff --git a/parrot/lib/python3.10/site-packages/google/protobuf/internal/__pycache__/enum_type_wrapper.cpython-310.pyc b/parrot/lib/python3.10/site-packages/google/protobuf/internal/__pycache__/enum_type_wrapper.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..1f211749c76fb7ea8ef158e3e1a27a83f8ca19e8 Binary files /dev/null and b/parrot/lib/python3.10/site-packages/google/protobuf/internal/__pycache__/enum_type_wrapper.cpython-310.pyc differ diff --git a/parrot/lib/python3.10/site-packages/google/protobuf/internal/__pycache__/field_mask.cpython-310.pyc b/parrot/lib/python3.10/site-packages/google/protobuf/internal/__pycache__/field_mask.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d1f0c4abbb6355ff628e7150da6ceba62d10d829 Binary files /dev/null and b/parrot/lib/python3.10/site-packages/google/protobuf/internal/__pycache__/field_mask.cpython-310.pyc differ diff --git a/parrot/lib/python3.10/site-packages/google/protobuf/internal/__pycache__/message_listener.cpython-310.pyc b/parrot/lib/python3.10/site-packages/google/protobuf/internal/__pycache__/message_listener.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..8dd889ed23d7f1b5232170b5828e2a8ff830b923 Binary files /dev/null and b/parrot/lib/python3.10/site-packages/google/protobuf/internal/__pycache__/message_listener.cpython-310.pyc differ diff --git a/parrot/lib/python3.10/site-packages/google/protobuf/internal/__pycache__/python_edition_defaults.cpython-310.pyc b/parrot/lib/python3.10/site-packages/google/protobuf/internal/__pycache__/python_edition_defaults.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..da6b4784863f4c302178a4b50f363ec439b52a06 Binary files /dev/null and b/parrot/lib/python3.10/site-packages/google/protobuf/internal/__pycache__/python_edition_defaults.cpython-310.pyc differ diff --git a/parrot/lib/python3.10/site-packages/google/protobuf/internal/__pycache__/python_message.cpython-310.pyc b/parrot/lib/python3.10/site-packages/google/protobuf/internal/__pycache__/python_message.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a3a8aa39d6ea5422309a28d89781d45c15e10ff6 Binary files /dev/null and b/parrot/lib/python3.10/site-packages/google/protobuf/internal/__pycache__/python_message.cpython-310.pyc differ diff --git a/parrot/lib/python3.10/site-packages/google/protobuf/internal/__pycache__/testing_refleaks.cpython-310.pyc b/parrot/lib/python3.10/site-packages/google/protobuf/internal/__pycache__/testing_refleaks.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..9c57ec24657e034f38ab68fa0002c1d739e6e195 Binary files /dev/null and b/parrot/lib/python3.10/site-packages/google/protobuf/internal/__pycache__/testing_refleaks.cpython-310.pyc differ diff --git a/parrot/lib/python3.10/site-packages/google/protobuf/internal/__pycache__/type_checkers.cpython-310.pyc b/parrot/lib/python3.10/site-packages/google/protobuf/internal/__pycache__/type_checkers.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..9f924bc5dd730b7e3c4806118886be91b0790156 Binary files /dev/null and b/parrot/lib/python3.10/site-packages/google/protobuf/internal/__pycache__/type_checkers.cpython-310.pyc differ diff --git a/parrot/lib/python3.10/site-packages/google/protobuf/internal/__pycache__/well_known_types.cpython-310.pyc b/parrot/lib/python3.10/site-packages/google/protobuf/internal/__pycache__/well_known_types.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..3b3b9204ce5db61d5ff0e1cd99d2839a4f08281b Binary files /dev/null and b/parrot/lib/python3.10/site-packages/google/protobuf/internal/__pycache__/well_known_types.cpython-310.pyc differ diff --git a/parrot/lib/python3.10/site-packages/google/protobuf/internal/__pycache__/wire_format.cpython-310.pyc b/parrot/lib/python3.10/site-packages/google/protobuf/internal/__pycache__/wire_format.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..37aaeb6c5d86f17deabf5aed92b9461a450d551d Binary files /dev/null and b/parrot/lib/python3.10/site-packages/google/protobuf/internal/__pycache__/wire_format.cpython-310.pyc differ diff --git a/parrot/lib/python3.10/site-packages/google/protobuf/util/__init__.py b/parrot/lib/python3.10/site-packages/google/protobuf/util/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/parrot/lib/python3.10/site-packages/google/protobuf/util/__pycache__/__init__.cpython-310.pyc b/parrot/lib/python3.10/site-packages/google/protobuf/util/__pycache__/__init__.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c0a8c18a5db05d72e622f1dd9d75e83a7ef26447 Binary files /dev/null and b/parrot/lib/python3.10/site-packages/google/protobuf/util/__pycache__/__init__.cpython-310.pyc differ diff --git a/parrot/lib/python3.10/site-packages/jinja2-3.1.4.dist-info/INSTALLER b/parrot/lib/python3.10/site-packages/jinja2-3.1.4.dist-info/INSTALLER new file mode 100644 index 0000000000000000000000000000000000000000..a1b589e38a32041e49332e5e81c2d363dc418d68 --- /dev/null +++ b/parrot/lib/python3.10/site-packages/jinja2-3.1.4.dist-info/INSTALLER @@ -0,0 +1 @@ +pip diff --git a/parrot/lib/python3.10/site-packages/jinja2-3.1.4.dist-info/LICENSE.txt b/parrot/lib/python3.10/site-packages/jinja2-3.1.4.dist-info/LICENSE.txt new file mode 100644 index 0000000000000000000000000000000000000000..c37cae49ec77ad6ebb25568c1605f1fee5313cfb --- /dev/null +++ b/parrot/lib/python3.10/site-packages/jinja2-3.1.4.dist-info/LICENSE.txt @@ -0,0 +1,28 @@ +Copyright 2007 Pallets + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +3. Neither the name of the copyright holder nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A +PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED +TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/parrot/lib/python3.10/site-packages/jinja2-3.1.4.dist-info/METADATA b/parrot/lib/python3.10/site-packages/jinja2-3.1.4.dist-info/METADATA new file mode 100644 index 0000000000000000000000000000000000000000..265cc32e1355ea1aa0f6c1794e84c8f2f636606b --- /dev/null +++ b/parrot/lib/python3.10/site-packages/jinja2-3.1.4.dist-info/METADATA @@ -0,0 +1,76 @@ +Metadata-Version: 2.1 +Name: Jinja2 +Version: 3.1.4 +Summary: A very fast and expressive template engine. +Maintainer-email: Pallets +Requires-Python: >=3.7 +Description-Content-Type: text/markdown +Classifier: Development Status :: 5 - Production/Stable +Classifier: Environment :: Web Environment +Classifier: Intended Audience :: Developers +Classifier: License :: OSI Approved :: BSD License +Classifier: Operating System :: OS Independent +Classifier: Programming Language :: Python +Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content +Classifier: Topic :: Text Processing :: Markup :: HTML +Classifier: Typing :: Typed +Requires-Dist: MarkupSafe>=2.0 +Requires-Dist: Babel>=2.7 ; extra == "i18n" +Project-URL: Changes, https://jinja.palletsprojects.com/changes/ +Project-URL: Chat, https://discord.gg/pallets +Project-URL: Documentation, https://jinja.palletsprojects.com/ +Project-URL: Donate, https://palletsprojects.com/donate +Project-URL: Source, https://github.com/pallets/jinja/ +Provides-Extra: i18n + +# Jinja + +Jinja is a fast, expressive, extensible templating engine. Special +placeholders in the template allow writing code similar to Python +syntax. Then the template is passed data to render the final document. + +It includes: + +- Template inheritance and inclusion. +- Define and import macros within templates. +- HTML templates can use autoescaping to prevent XSS from untrusted + user input. +- A sandboxed environment can safely render untrusted templates. +- AsyncIO support for generating templates and calling async + functions. +- I18N support with Babel. +- Templates are compiled to optimized Python code just-in-time and + cached, or can be compiled ahead-of-time. +- Exceptions point to the correct line in templates to make debugging + easier. +- Extensible filters, tests, functions, and even syntax. + +Jinja's philosophy is that while application logic belongs in Python if +possible, it shouldn't make the template designer's job difficult by +restricting functionality too much. + + +## In A Nutshell + +.. code-block:: jinja + + {% extends "base.html" %} + {% block title %}Members{% endblock %} + {% block content %} + + {% endblock %} + + +## Donate + +The Pallets organization develops and supports Jinja and other popular +packages. In order to grow the community of contributors and users, and +allow the maintainers to devote more time to the projects, [please +donate today][]. + +[please donate today]: https://palletsprojects.com/donate + diff --git a/parrot/lib/python3.10/site-packages/jinja2-3.1.4.dist-info/RECORD b/parrot/lib/python3.10/site-packages/jinja2-3.1.4.dist-info/RECORD new file mode 100644 index 0000000000000000000000000000000000000000..ef0beac65d8b31cd27511c3e893598876f145735 --- /dev/null +++ b/parrot/lib/python3.10/site-packages/jinja2-3.1.4.dist-info/RECORD @@ -0,0 +1,58 @@ +jinja2-3.1.4.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4 +jinja2-3.1.4.dist-info/LICENSE.txt,sha256=O0nc7kEF6ze6wQ-vG-JgQI_oXSUrjp3y4JefweCUQ3s,1475 +jinja2-3.1.4.dist-info/METADATA,sha256=R_brzpPQVBvpGcsm-WbrtgotO7suQ1D0F-qkhTzeEfY,2640 +jinja2-3.1.4.dist-info/RECORD,, +jinja2-3.1.4.dist-info/REQUESTED,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +jinja2-3.1.4.dist-info/WHEEL,sha256=EZbGkh7Ie4PoZfRQ8I0ZuP9VklN_TvcZ6DSE5Uar4z4,81 +jinja2-3.1.4.dist-info/entry_points.txt,sha256=OL85gYU1eD8cuPlikifFngXpeBjaxl6rIJ8KkC_3r-I,58 +jinja2/__init__.py,sha256=wIl45IM20KGw-kfr7jJhaBxxX5g4-kihlBYjxopX7Pw,1928 +jinja2/__pycache__/__init__.cpython-310.pyc,, +jinja2/__pycache__/_identifier.cpython-310.pyc,, +jinja2/__pycache__/async_utils.cpython-310.pyc,, +jinja2/__pycache__/bccache.cpython-310.pyc,, +jinja2/__pycache__/compiler.cpython-310.pyc,, +jinja2/__pycache__/constants.cpython-310.pyc,, +jinja2/__pycache__/debug.cpython-310.pyc,, +jinja2/__pycache__/defaults.cpython-310.pyc,, +jinja2/__pycache__/environment.cpython-310.pyc,, +jinja2/__pycache__/exceptions.cpython-310.pyc,, +jinja2/__pycache__/ext.cpython-310.pyc,, +jinja2/__pycache__/filters.cpython-310.pyc,, +jinja2/__pycache__/idtracking.cpython-310.pyc,, +jinja2/__pycache__/lexer.cpython-310.pyc,, +jinja2/__pycache__/loaders.cpython-310.pyc,, +jinja2/__pycache__/meta.cpython-310.pyc,, +jinja2/__pycache__/nativetypes.cpython-310.pyc,, +jinja2/__pycache__/nodes.cpython-310.pyc,, +jinja2/__pycache__/optimizer.cpython-310.pyc,, +jinja2/__pycache__/parser.cpython-310.pyc,, +jinja2/__pycache__/runtime.cpython-310.pyc,, +jinja2/__pycache__/sandbox.cpython-310.pyc,, +jinja2/__pycache__/tests.cpython-310.pyc,, +jinja2/__pycache__/utils.cpython-310.pyc,, +jinja2/__pycache__/visitor.cpython-310.pyc,, +jinja2/_identifier.py,sha256=_zYctNKzRqlk_murTNlzrju1FFJL7Va_Ijqqd7ii2lU,1958 +jinja2/async_utils.py,sha256=JXKWCAXmTx0iZB4-hAsF50vgjxw_RJTjiLOlGGTBso0,2477 +jinja2/bccache.py,sha256=gh0qs9rulnXo0PhX5jTJy2UHzI8wFnQ63o_vw7nhzRg,14061 +jinja2/compiler.py,sha256=dpV-n6_iQUP4uSwlXwGUavJmwjvXdyxKzJ-AonFjPBk,72271 +jinja2/constants.py,sha256=GMoFydBF_kdpaRKPoM5cl5MviquVRLVyZtfp5-16jg0,1433 +jinja2/debug.py,sha256=iWJ432RadxJNnaMOPrjIDInz50UEgni3_HKuFXi2vuQ,6299 +jinja2/defaults.py,sha256=boBcSw78h-lp20YbaXSJsqkAI2uN_mD_TtCydpeq5wU,1267 +jinja2/environment.py,sha256=xhFkmxO0CESA76Ki5tz4XWq9yzGu-t0p93JCCVBVNps,61538 +jinja2/exceptions.py,sha256=ioHeHrWwCWNaXX1inHmHVblvc4haO7AXsjCp3GfWvx0,5071 +jinja2/ext.py,sha256=igsBH7c6C0byHaOtMbE-ugpt4GjLGgR-ywskyXtKgq8,31877 +jinja2/filters.py,sha256=bKeqjFjjz88TkHVLSyyMIEB75CzAN6b3Airgx0phJDg,54611 +jinja2/idtracking.py,sha256=GfNmadir4oDALVxzn3DL9YInhJDr69ebXeA2ygfuCGA,10704 +jinja2/lexer.py,sha256=xnWWXhPndHFsoqzpc5VTjheDE9JuKk9MUo9DZkrM8Os,29754 +jinja2/loaders.py,sha256=ru0GIWHo5KiHJi7_MoI_LvGDoBBvP6rd0hiC1ReaTwk,23167 +jinja2/meta.py,sha256=OTDPkaFvU2Hgvx-6akz7154F8BIWaRmvJcBFvwopHww,4397 +jinja2/nativetypes.py,sha256=7GIGALVJgdyL80oZJdQUaUfwSt5q2lSSZbXt0dNf_M4,4210 +jinja2/nodes.py,sha256=m1Duzcr6qhZI8JQ6VyJgUNinjAf5bQzijSmDnMsvUx8,34579 +jinja2/optimizer.py,sha256=rJnCRlQ7pZsEEmMhsQDgC_pKyDHxP5TPS6zVPGsgcu8,1651 +jinja2/parser.py,sha256=DV1iF1FR2Rsaj_5zl8rmx7j6Bj4S8iLHoYsvJ0bfEis,39890 +jinja2/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +jinja2/runtime.py,sha256=POXT3tKNKJRENx2CymwUsOOXH2JwGPjW702njB5__cQ,33435 +jinja2/sandbox.py,sha256=TJjBNS9qRJ2ZgBMWdAgRBpyDLOHea2kT-2mk4PrjYx0,14616 +jinja2/tests.py,sha256=VLsBhVFnWg-PxSBz1MhRnNWgP1ovXk3neO1FLQMeC9Q,5926 +jinja2/utils.py,sha256=nV7IpWLvRCMyHW1irBAK8CIPAnOFfkb2ukggDBjbBEY,23952 +jinja2/visitor.py,sha256=EcnL1PIwf_4RVCOMxsRNuR8AXHbS1qfAdMOE2ngKJz4,3557 diff --git a/parrot/lib/python3.10/site-packages/jinja2-3.1.4.dist-info/REQUESTED b/parrot/lib/python3.10/site-packages/jinja2-3.1.4.dist-info/REQUESTED new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/parrot/lib/python3.10/site-packages/jinja2-3.1.4.dist-info/WHEEL b/parrot/lib/python3.10/site-packages/jinja2-3.1.4.dist-info/WHEEL new file mode 100644 index 0000000000000000000000000000000000000000..3b5e64b5e6c4a210201d1676a891fd57b15cda99 --- /dev/null +++ b/parrot/lib/python3.10/site-packages/jinja2-3.1.4.dist-info/WHEEL @@ -0,0 +1,4 @@ +Wheel-Version: 1.0 +Generator: flit 3.9.0 +Root-Is-Purelib: true +Tag: py3-none-any diff --git a/parrot/lib/python3.10/site-packages/jinja2-3.1.4.dist-info/entry_points.txt b/parrot/lib/python3.10/site-packages/jinja2-3.1.4.dist-info/entry_points.txt new file mode 100644 index 0000000000000000000000000000000000000000..abc3eae3b3bc573957cf7401711948799b3465c0 --- /dev/null +++ b/parrot/lib/python3.10/site-packages/jinja2-3.1.4.dist-info/entry_points.txt @@ -0,0 +1,3 @@ +[babel.extractors] +jinja2=jinja2.ext:babel_extract[i18n] + diff --git a/parrot/lib/python3.10/site-packages/platformdirs/__main__.py b/parrot/lib/python3.10/site-packages/platformdirs/__main__.py new file mode 100644 index 0000000000000000000000000000000000000000..922c521358e349470ec48d6372b8f8ee8641128a --- /dev/null +++ b/parrot/lib/python3.10/site-packages/platformdirs/__main__.py @@ -0,0 +1,55 @@ +"""Main entry point.""" + +from __future__ import annotations + +from platformdirs import PlatformDirs, __version__ + +PROPS = ( + "user_data_dir", + "user_config_dir", + "user_cache_dir", + "user_state_dir", + "user_log_dir", + "user_documents_dir", + "user_downloads_dir", + "user_pictures_dir", + "user_videos_dir", + "user_music_dir", + "user_runtime_dir", + "site_data_dir", + "site_config_dir", + "site_cache_dir", + "site_runtime_dir", +) + + +def main() -> None: + """Run the main entry point.""" + app_name = "MyApp" + app_author = "MyCompany" + + print(f"-- platformdirs {__version__} --") # noqa: T201 + + print("-- app dirs (with optional 'version')") # noqa: T201 + dirs = PlatformDirs(app_name, app_author, version="1.0") + for prop in PROPS: + print(f"{prop}: {getattr(dirs, prop)}") # noqa: T201 + + print("\n-- app dirs (without optional 'version')") # noqa: T201 + dirs = PlatformDirs(app_name, app_author) + for prop in PROPS: + print(f"{prop}: {getattr(dirs, prop)}") # noqa: T201 + + print("\n-- app dirs (without optional 'appauthor')") # noqa: T201 + dirs = PlatformDirs(app_name) + for prop in PROPS: + print(f"{prop}: {getattr(dirs, prop)}") # noqa: T201 + + print("\n-- app dirs (with disabled 'appauthor')") # noqa: T201 + dirs = PlatformDirs(app_name, appauthor=False) + for prop in PROPS: + print(f"{prop}: {getattr(dirs, prop)}") # noqa: T201 + + +if __name__ == "__main__": + main() diff --git a/parrot/lib/python3.10/site-packages/platformdirs/__pycache__/__init__.cpython-310.pyc b/parrot/lib/python3.10/site-packages/platformdirs/__pycache__/__init__.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..9efedd92e465f5d8cc02acc5c3bcfbc4cf9fc931 Binary files /dev/null and b/parrot/lib/python3.10/site-packages/platformdirs/__pycache__/__init__.cpython-310.pyc differ diff --git a/parrot/lib/python3.10/site-packages/platformdirs/__pycache__/__main__.cpython-310.pyc b/parrot/lib/python3.10/site-packages/platformdirs/__pycache__/__main__.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..0ffb8d0e07b41503fc62f0965615e3b9341cc454 Binary files /dev/null and b/parrot/lib/python3.10/site-packages/platformdirs/__pycache__/__main__.cpython-310.pyc differ diff --git a/parrot/lib/python3.10/site-packages/platformdirs/__pycache__/android.cpython-310.pyc b/parrot/lib/python3.10/site-packages/platformdirs/__pycache__/android.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..6b02b14e0e94e946dc310946da51b6a83b0e30f0 Binary files /dev/null and b/parrot/lib/python3.10/site-packages/platformdirs/__pycache__/android.cpython-310.pyc differ diff --git a/parrot/lib/python3.10/site-packages/platformdirs/__pycache__/api.cpython-310.pyc b/parrot/lib/python3.10/site-packages/platformdirs/__pycache__/api.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e2961af1df9673d0ba87653aa9013902ead21da1 Binary files /dev/null and b/parrot/lib/python3.10/site-packages/platformdirs/__pycache__/api.cpython-310.pyc differ diff --git a/parrot/lib/python3.10/site-packages/platformdirs/__pycache__/macos.cpython-310.pyc b/parrot/lib/python3.10/site-packages/platformdirs/__pycache__/macos.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d271b7c5621d0c69e7eab87a0ef6a3f437deea0f Binary files /dev/null and b/parrot/lib/python3.10/site-packages/platformdirs/__pycache__/macos.cpython-310.pyc differ diff --git a/parrot/lib/python3.10/site-packages/platformdirs/__pycache__/unix.cpython-310.pyc b/parrot/lib/python3.10/site-packages/platformdirs/__pycache__/unix.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..05ab9e3855b6885696ceb5635d7aa9c61bf779f2 Binary files /dev/null and b/parrot/lib/python3.10/site-packages/platformdirs/__pycache__/unix.cpython-310.pyc differ diff --git a/parrot/lib/python3.10/site-packages/platformdirs/__pycache__/version.cpython-310.pyc b/parrot/lib/python3.10/site-packages/platformdirs/__pycache__/version.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..fa789b24adf89fa269396a691e77ffff95e292bc Binary files /dev/null and b/parrot/lib/python3.10/site-packages/platformdirs/__pycache__/version.cpython-310.pyc differ diff --git a/parrot/lib/python3.10/site-packages/platformdirs/__pycache__/windows.cpython-310.pyc b/parrot/lib/python3.10/site-packages/platformdirs/__pycache__/windows.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..11aa27ecd4c85ebe0848c79485488a8d98646f99 Binary files /dev/null and b/parrot/lib/python3.10/site-packages/platformdirs/__pycache__/windows.cpython-310.pyc differ diff --git a/parrot/lib/python3.10/site-packages/platformdirs/android.py b/parrot/lib/python3.10/site-packages/platformdirs/android.py new file mode 100644 index 0000000000000000000000000000000000000000..7004a852422b104d16c9cbdfb2febe7b0504a594 --- /dev/null +++ b/parrot/lib/python3.10/site-packages/platformdirs/android.py @@ -0,0 +1,249 @@ +"""Android.""" + +from __future__ import annotations + +import os +import re +import sys +from functools import lru_cache +from typing import TYPE_CHECKING, cast + +from .api import PlatformDirsABC + + +class Android(PlatformDirsABC): + """ + Follows the guidance `from here `_. + + Makes use of the `appname `, `version + `, `ensure_exists `. + + """ + + @property + def user_data_dir(self) -> str: + """:return: data directory tied to the user, e.g. ``/data/user///files/``""" + return self._append_app_name_and_version(cast(str, _android_folder()), "files") + + @property + def site_data_dir(self) -> str: + """:return: data directory shared by users, same as `user_data_dir`""" + return self.user_data_dir + + @property + def user_config_dir(self) -> str: + """ + :return: config directory tied to the user, e.g. \ + ``/data/user///shared_prefs/`` + """ + return self._append_app_name_and_version(cast(str, _android_folder()), "shared_prefs") + + @property + def site_config_dir(self) -> str: + """:return: config directory shared by the users, same as `user_config_dir`""" + return self.user_config_dir + + @property + def user_cache_dir(self) -> str: + """:return: cache directory tied to the user, e.g.,``/data/user///cache/``""" + return self._append_app_name_and_version(cast(str, _android_folder()), "cache") + + @property + def site_cache_dir(self) -> str: + """:return: cache directory shared by users, same as `user_cache_dir`""" + return self.user_cache_dir + + @property + def user_state_dir(self) -> str: + """:return: state directory tied to the user, same as `user_data_dir`""" + return self.user_data_dir + + @property + def user_log_dir(self) -> str: + """ + :return: log directory tied to the user, same as `user_cache_dir` if not opinionated else ``log`` in it, + e.g. ``/data/user///cache//log`` + """ + path = self.user_cache_dir + if self.opinion: + path = os.path.join(path, "log") # noqa: PTH118 + return path + + @property + def user_documents_dir(self) -> str: + """:return: documents directory tied to the user e.g. ``/storage/emulated/0/Documents``""" + return _android_documents_folder() + + @property + def user_downloads_dir(self) -> str: + """:return: downloads directory tied to the user e.g. ``/storage/emulated/0/Downloads``""" + return _android_downloads_folder() + + @property + def user_pictures_dir(self) -> str: + """:return: pictures directory tied to the user e.g. ``/storage/emulated/0/Pictures``""" + return _android_pictures_folder() + + @property + def user_videos_dir(self) -> str: + """:return: videos directory tied to the user e.g. ``/storage/emulated/0/DCIM/Camera``""" + return _android_videos_folder() + + @property + def user_music_dir(self) -> str: + """:return: music directory tied to the user e.g. ``/storage/emulated/0/Music``""" + return _android_music_folder() + + @property + def user_desktop_dir(self) -> str: + """:return: desktop directory tied to the user e.g. ``/storage/emulated/0/Desktop``""" + return "/storage/emulated/0/Desktop" + + @property + def user_runtime_dir(self) -> str: + """ + :return: runtime directory tied to the user, same as `user_cache_dir` if not opinionated else ``tmp`` in it, + e.g. ``/data/user///cache//tmp`` + """ + path = self.user_cache_dir + if self.opinion: + path = os.path.join(path, "tmp") # noqa: PTH118 + return path + + @property + def site_runtime_dir(self) -> str: + """:return: runtime directory shared by users, same as `user_runtime_dir`""" + return self.user_runtime_dir + + +@lru_cache(maxsize=1) +def _android_folder() -> str | None: # noqa: C901 + """:return: base folder for the Android OS or None if it cannot be found""" + result: str | None = None + # type checker isn't happy with our "import android", just don't do this when type checking see + # https://stackoverflow.com/a/61394121 + if not TYPE_CHECKING: + try: + # First try to get a path to android app using python4android (if available)... + from android import mActivity # noqa: PLC0415 + + context = cast("android.content.Context", mActivity.getApplicationContext()) # noqa: F821 + result = context.getFilesDir().getParentFile().getAbsolutePath() + except Exception: # noqa: BLE001 + result = None + if result is None: + try: + # ...and fall back to using plain pyjnius, if python4android isn't available or doesn't deliver any useful + # result... + from jnius import autoclass # noqa: PLC0415 + + context = autoclass("android.content.Context") + result = context.getFilesDir().getParentFile().getAbsolutePath() + except Exception: # noqa: BLE001 + result = None + if result is None: + # and if that fails, too, find an android folder looking at path on the sys.path + # warning: only works for apps installed under /data, not adopted storage etc. + pattern = re.compile(r"/data/(data|user/\d+)/(.+)/files") + for path in sys.path: + if pattern.match(path): + result = path.split("/files")[0] + break + else: + result = None + if result is None: + # one last try: find an android folder looking at path on the sys.path taking adopted storage paths into + # account + pattern = re.compile(r"/mnt/expand/[a-fA-F0-9-]{36}/(data|user/\d+)/(.+)/files") + for path in sys.path: + if pattern.match(path): + result = path.split("/files")[0] + break + else: + result = None + return result + + +@lru_cache(maxsize=1) +def _android_documents_folder() -> str: + """:return: documents folder for the Android OS""" + # Get directories with pyjnius + try: + from jnius import autoclass # noqa: PLC0415 + + context = autoclass("android.content.Context") + environment = autoclass("android.os.Environment") + documents_dir: str = context.getExternalFilesDir(environment.DIRECTORY_DOCUMENTS).getAbsolutePath() + except Exception: # noqa: BLE001 + documents_dir = "/storage/emulated/0/Documents" + + return documents_dir + + +@lru_cache(maxsize=1) +def _android_downloads_folder() -> str: + """:return: downloads folder for the Android OS""" + # Get directories with pyjnius + try: + from jnius import autoclass # noqa: PLC0415 + + context = autoclass("android.content.Context") + environment = autoclass("android.os.Environment") + downloads_dir: str = context.getExternalFilesDir(environment.DIRECTORY_DOWNLOADS).getAbsolutePath() + except Exception: # noqa: BLE001 + downloads_dir = "/storage/emulated/0/Downloads" + + return downloads_dir + + +@lru_cache(maxsize=1) +def _android_pictures_folder() -> str: + """:return: pictures folder for the Android OS""" + # Get directories with pyjnius + try: + from jnius import autoclass # noqa: PLC0415 + + context = autoclass("android.content.Context") + environment = autoclass("android.os.Environment") + pictures_dir: str = context.getExternalFilesDir(environment.DIRECTORY_PICTURES).getAbsolutePath() + except Exception: # noqa: BLE001 + pictures_dir = "/storage/emulated/0/Pictures" + + return pictures_dir + + +@lru_cache(maxsize=1) +def _android_videos_folder() -> str: + """:return: videos folder for the Android OS""" + # Get directories with pyjnius + try: + from jnius import autoclass # noqa: PLC0415 + + context = autoclass("android.content.Context") + environment = autoclass("android.os.Environment") + videos_dir: str = context.getExternalFilesDir(environment.DIRECTORY_DCIM).getAbsolutePath() + except Exception: # noqa: BLE001 + videos_dir = "/storage/emulated/0/DCIM/Camera" + + return videos_dir + + +@lru_cache(maxsize=1) +def _android_music_folder() -> str: + """:return: music folder for the Android OS""" + # Get directories with pyjnius + try: + from jnius import autoclass # noqa: PLC0415 + + context = autoclass("android.content.Context") + environment = autoclass("android.os.Environment") + music_dir: str = context.getExternalFilesDir(environment.DIRECTORY_MUSIC).getAbsolutePath() + except Exception: # noqa: BLE001 + music_dir = "/storage/emulated/0/Music" + + return music_dir + + +__all__ = [ + "Android", +] diff --git a/parrot/lib/python3.10/site-packages/platformdirs/api.py b/parrot/lib/python3.10/site-packages/platformdirs/api.py new file mode 100644 index 0000000000000000000000000000000000000000..18d660e4f8c90dd170f7e131a9ac55d68e60ce56 --- /dev/null +++ b/parrot/lib/python3.10/site-packages/platformdirs/api.py @@ -0,0 +1,298 @@ +"""Base API.""" + +from __future__ import annotations + +import os +from abc import ABC, abstractmethod +from pathlib import Path +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from typing import Iterator, Literal + + +class PlatformDirsABC(ABC): # noqa: PLR0904 + """Abstract base class for platform directories.""" + + def __init__( # noqa: PLR0913, PLR0917 + self, + appname: str | None = None, + appauthor: str | None | Literal[False] = None, + version: str | None = None, + roaming: bool = False, # noqa: FBT001, FBT002 + multipath: bool = False, # noqa: FBT001, FBT002 + opinion: bool = True, # noqa: FBT001, FBT002 + ensure_exists: bool = False, # noqa: FBT001, FBT002 + ) -> None: + """ + Create a new platform directory. + + :param appname: See `appname`. + :param appauthor: See `appauthor`. + :param version: See `version`. + :param roaming: See `roaming`. + :param multipath: See `multipath`. + :param opinion: See `opinion`. + :param ensure_exists: See `ensure_exists`. + + """ + self.appname = appname #: The name of application. + self.appauthor = appauthor + """ + The name of the app author or distributing body for this application. + + Typically, it is the owning company name. Defaults to `appname`. You may pass ``False`` to disable it. + + """ + self.version = version + """ + An optional version path element to append to the path. + + You might want to use this if you want multiple versions of your app to be able to run independently. If used, + this would typically be ``.``. + + """ + self.roaming = roaming + """ + Whether to use the roaming appdata directory on Windows. + + That means that for users on a Windows network setup for roaming profiles, this user data will be synced on + login (see + `here `_). + + """ + self.multipath = multipath + """ + An optional parameter which indicates that the entire list of data dirs should be returned. + + By default, the first item would only be returned. + + """ + self.opinion = opinion #: A flag to indicating to use opinionated values. + self.ensure_exists = ensure_exists + """ + Optionally create the directory (and any missing parents) upon access if it does not exist. + + By default, no directories are created. + + """ + + def _append_app_name_and_version(self, *base: str) -> str: + params = list(base[1:]) + if self.appname: + params.append(self.appname) + if self.version: + params.append(self.version) + path = os.path.join(base[0], *params) # noqa: PTH118 + self._optionally_create_directory(path) + return path + + def _optionally_create_directory(self, path: str) -> None: + if self.ensure_exists: + Path(path).mkdir(parents=True, exist_ok=True) + + def _first_item_as_path_if_multipath(self, directory: str) -> Path: + if self.multipath: + # If multipath is True, the first path is returned. + directory = directory.split(os.pathsep)[0] + return Path(directory) + + @property + @abstractmethod + def user_data_dir(self) -> str: + """:return: data directory tied to the user""" + + @property + @abstractmethod + def site_data_dir(self) -> str: + """:return: data directory shared by users""" + + @property + @abstractmethod + def user_config_dir(self) -> str: + """:return: config directory tied to the user""" + + @property + @abstractmethod + def site_config_dir(self) -> str: + """:return: config directory shared by the users""" + + @property + @abstractmethod + def user_cache_dir(self) -> str: + """:return: cache directory tied to the user""" + + @property + @abstractmethod + def site_cache_dir(self) -> str: + """:return: cache directory shared by users""" + + @property + @abstractmethod + def user_state_dir(self) -> str: + """:return: state directory tied to the user""" + + @property + @abstractmethod + def user_log_dir(self) -> str: + """:return: log directory tied to the user""" + + @property + @abstractmethod + def user_documents_dir(self) -> str: + """:return: documents directory tied to the user""" + + @property + @abstractmethod + def user_downloads_dir(self) -> str: + """:return: downloads directory tied to the user""" + + @property + @abstractmethod + def user_pictures_dir(self) -> str: + """:return: pictures directory tied to the user""" + + @property + @abstractmethod + def user_videos_dir(self) -> str: + """:return: videos directory tied to the user""" + + @property + @abstractmethod + def user_music_dir(self) -> str: + """:return: music directory tied to the user""" + + @property + @abstractmethod + def user_desktop_dir(self) -> str: + """:return: desktop directory tied to the user""" + + @property + @abstractmethod + def user_runtime_dir(self) -> str: + """:return: runtime directory tied to the user""" + + @property + @abstractmethod + def site_runtime_dir(self) -> str: + """:return: runtime directory shared by users""" + + @property + def user_data_path(self) -> Path: + """:return: data path tied to the user""" + return Path(self.user_data_dir) + + @property + def site_data_path(self) -> Path: + """:return: data path shared by users""" + return Path(self.site_data_dir) + + @property + def user_config_path(self) -> Path: + """:return: config path tied to the user""" + return Path(self.user_config_dir) + + @property + def site_config_path(self) -> Path: + """:return: config path shared by the users""" + return Path(self.site_config_dir) + + @property + def user_cache_path(self) -> Path: + """:return: cache path tied to the user""" + return Path(self.user_cache_dir) + + @property + def site_cache_path(self) -> Path: + """:return: cache path shared by users""" + return Path(self.site_cache_dir) + + @property + def user_state_path(self) -> Path: + """:return: state path tied to the user""" + return Path(self.user_state_dir) + + @property + def user_log_path(self) -> Path: + """:return: log path tied to the user""" + return Path(self.user_log_dir) + + @property + def user_documents_path(self) -> Path: + """:return: documents a path tied to the user""" + return Path(self.user_documents_dir) + + @property + def user_downloads_path(self) -> Path: + """:return: downloads path tied to the user""" + return Path(self.user_downloads_dir) + + @property + def user_pictures_path(self) -> Path: + """:return: pictures path tied to the user""" + return Path(self.user_pictures_dir) + + @property + def user_videos_path(self) -> Path: + """:return: videos path tied to the user""" + return Path(self.user_videos_dir) + + @property + def user_music_path(self) -> Path: + """:return: music path tied to the user""" + return Path(self.user_music_dir) + + @property + def user_desktop_path(self) -> Path: + """:return: desktop path tied to the user""" + return Path(self.user_desktop_dir) + + @property + def user_runtime_path(self) -> Path: + """:return: runtime path tied to the user""" + return Path(self.user_runtime_dir) + + @property + def site_runtime_path(self) -> Path: + """:return: runtime path shared by users""" + return Path(self.site_runtime_dir) + + def iter_config_dirs(self) -> Iterator[str]: + """:yield: all user and site configuration directories.""" + yield self.user_config_dir + yield self.site_config_dir + + def iter_data_dirs(self) -> Iterator[str]: + """:yield: all user and site data directories.""" + yield self.user_data_dir + yield self.site_data_dir + + def iter_cache_dirs(self) -> Iterator[str]: + """:yield: all user and site cache directories.""" + yield self.user_cache_dir + yield self.site_cache_dir + + def iter_runtime_dirs(self) -> Iterator[str]: + """:yield: all user and site runtime directories.""" + yield self.user_runtime_dir + yield self.site_runtime_dir + + def iter_config_paths(self) -> Iterator[Path]: + """:yield: all user and site configuration paths.""" + for path in self.iter_config_dirs(): + yield Path(path) + + def iter_data_paths(self) -> Iterator[Path]: + """:yield: all user and site data paths.""" + for path in self.iter_data_dirs(): + yield Path(path) + + def iter_cache_paths(self) -> Iterator[Path]: + """:yield: all user and site cache paths.""" + for path in self.iter_cache_dirs(): + yield Path(path) + + def iter_runtime_paths(self) -> Iterator[Path]: + """:yield: all user and site runtime paths.""" + for path in self.iter_runtime_dirs(): + yield Path(path) diff --git a/parrot/lib/python3.10/site-packages/platformdirs/macos.py b/parrot/lib/python3.10/site-packages/platformdirs/macos.py new file mode 100644 index 0000000000000000000000000000000000000000..e4b0391abd7a09ab76a6351fb6757f6498cdb240 --- /dev/null +++ b/parrot/lib/python3.10/site-packages/platformdirs/macos.py @@ -0,0 +1,144 @@ +"""macOS.""" + +from __future__ import annotations + +import os.path +import sys +from typing import TYPE_CHECKING + +from .api import PlatformDirsABC + +if TYPE_CHECKING: + from pathlib import Path + + +class MacOS(PlatformDirsABC): + """ + Platform directories for the macOS operating system. + + Follows the guidance from + `Apple documentation `_. + Makes use of the `appname `, + `version `, + `ensure_exists `. + + """ + + @property + def user_data_dir(self) -> str: + """:return: data directory tied to the user, e.g. ``~/Library/Application Support/$appname/$version``""" + return self._append_app_name_and_version(os.path.expanduser("~/Library/Application Support")) # noqa: PTH111 + + @property + def site_data_dir(self) -> str: + """ + :return: data directory shared by users, e.g. ``/Library/Application Support/$appname/$version``. + If we're using a Python binary managed by `Homebrew `_, the directory + will be under the Homebrew prefix, e.g. ``/opt/homebrew/share/$appname/$version``. + If `multipath ` is enabled, and we're in Homebrew, + the response is a multi-path string separated by ":", e.g. + ``/opt/homebrew/share/$appname/$version:/Library/Application Support/$appname/$version`` + """ + is_homebrew = sys.prefix.startswith("/opt/homebrew") + path_list = [self._append_app_name_and_version("/opt/homebrew/share")] if is_homebrew else [] + path_list.append(self._append_app_name_and_version("/Library/Application Support")) + if self.multipath: + return os.pathsep.join(path_list) + return path_list[0] + + @property + def site_data_path(self) -> Path: + """:return: data path shared by users. Only return the first item, even if ``multipath`` is set to ``True``""" + return self._first_item_as_path_if_multipath(self.site_data_dir) + + @property + def user_config_dir(self) -> str: + """:return: config directory tied to the user, same as `user_data_dir`""" + return self.user_data_dir + + @property + def site_config_dir(self) -> str: + """:return: config directory shared by the users, same as `site_data_dir`""" + return self.site_data_dir + + @property + def user_cache_dir(self) -> str: + """:return: cache directory tied to the user, e.g. ``~/Library/Caches/$appname/$version``""" + return self._append_app_name_and_version(os.path.expanduser("~/Library/Caches")) # noqa: PTH111 + + @property + def site_cache_dir(self) -> str: + """ + :return: cache directory shared by users, e.g. ``/Library/Caches/$appname/$version``. + If we're using a Python binary managed by `Homebrew `_, the directory + will be under the Homebrew prefix, e.g. ``/opt/homebrew/var/cache/$appname/$version``. + If `multipath ` is enabled, and we're in Homebrew, + the response is a multi-path string separated by ":", e.g. + ``/opt/homebrew/var/cache/$appname/$version:/Library/Caches/$appname/$version`` + """ + is_homebrew = sys.prefix.startswith("/opt/homebrew") + path_list = [self._append_app_name_and_version("/opt/homebrew/var/cache")] if is_homebrew else [] + path_list.append(self._append_app_name_and_version("/Library/Caches")) + if self.multipath: + return os.pathsep.join(path_list) + return path_list[0] + + @property + def site_cache_path(self) -> Path: + """:return: cache path shared by users. Only return the first item, even if ``multipath`` is set to ``True``""" + return self._first_item_as_path_if_multipath(self.site_cache_dir) + + @property + def user_state_dir(self) -> str: + """:return: state directory tied to the user, same as `user_data_dir`""" + return self.user_data_dir + + @property + def user_log_dir(self) -> str: + """:return: log directory tied to the user, e.g. ``~/Library/Logs/$appname/$version``""" + return self._append_app_name_and_version(os.path.expanduser("~/Library/Logs")) # noqa: PTH111 + + @property + def user_documents_dir(self) -> str: + """:return: documents directory tied to the user, e.g. ``~/Documents``""" + return os.path.expanduser("~/Documents") # noqa: PTH111 + + @property + def user_downloads_dir(self) -> str: + """:return: downloads directory tied to the user, e.g. ``~/Downloads``""" + return os.path.expanduser("~/Downloads") # noqa: PTH111 + + @property + def user_pictures_dir(self) -> str: + """:return: pictures directory tied to the user, e.g. ``~/Pictures``""" + return os.path.expanduser("~/Pictures") # noqa: PTH111 + + @property + def user_videos_dir(self) -> str: + """:return: videos directory tied to the user, e.g. ``~/Movies``""" + return os.path.expanduser("~/Movies") # noqa: PTH111 + + @property + def user_music_dir(self) -> str: + """:return: music directory tied to the user, e.g. ``~/Music``""" + return os.path.expanduser("~/Music") # noqa: PTH111 + + @property + def user_desktop_dir(self) -> str: + """:return: desktop directory tied to the user, e.g. ``~/Desktop``""" + return os.path.expanduser("~/Desktop") # noqa: PTH111 + + @property + def user_runtime_dir(self) -> str: + """:return: runtime directory tied to the user, e.g. ``~/Library/Caches/TemporaryItems/$appname/$version``""" + return self._append_app_name_and_version(os.path.expanduser("~/Library/Caches/TemporaryItems")) # noqa: PTH111 + + @property + def site_runtime_dir(self) -> str: + """:return: runtime directory shared by users, same as `user_runtime_dir`""" + return self.user_runtime_dir + + +__all__ = [ + "MacOS", +] diff --git a/parrot/lib/python3.10/site-packages/platformdirs/py.typed b/parrot/lib/python3.10/site-packages/platformdirs/py.typed new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/parrot/lib/python3.10/site-packages/platformdirs/unix.py b/parrot/lib/python3.10/site-packages/platformdirs/unix.py new file mode 100644 index 0000000000000000000000000000000000000000..f1942e92ef47ce5195966634c2a3c572776038de --- /dev/null +++ b/parrot/lib/python3.10/site-packages/platformdirs/unix.py @@ -0,0 +1,269 @@ +"""Unix.""" + +from __future__ import annotations + +import os +import sys +from configparser import ConfigParser +from pathlib import Path +from typing import Iterator, NoReturn + +from .api import PlatformDirsABC + +if sys.platform == "win32": + + def getuid() -> NoReturn: + msg = "should only be used on Unix" + raise RuntimeError(msg) + +else: + from os import getuid + + +class Unix(PlatformDirsABC): # noqa: PLR0904 + """ + On Unix/Linux, we follow the `XDG Basedir Spec `_. + + The spec allows overriding directories with environment variables. The examples shown are the default values, + alongside the name of the environment variable that overrides them. Makes use of the `appname + `, `version `, `multipath + `, `opinion `, `ensure_exists + `. + + """ + + @property + def user_data_dir(self) -> str: + """ + :return: data directory tied to the user, e.g. ``~/.local/share/$appname/$version`` or + ``$XDG_DATA_HOME/$appname/$version`` + """ + path = os.environ.get("XDG_DATA_HOME", "") + if not path.strip(): + path = os.path.expanduser("~/.local/share") # noqa: PTH111 + return self._append_app_name_and_version(path) + + @property + def _site_data_dirs(self) -> list[str]: + path = os.environ.get("XDG_DATA_DIRS", "") + if not path.strip(): + path = f"/usr/local/share{os.pathsep}/usr/share" + return [self._append_app_name_and_version(p) for p in path.split(os.pathsep)] + + @property + def site_data_dir(self) -> str: + """ + :return: data directories shared by users (if `multipath ` is + enabled and ``XDG_DATA_DIRS`` is set and a multi path the response is also a multi path separated by the + OS path separator), e.g. ``/usr/local/share/$appname/$version`` or ``/usr/share/$appname/$version`` + """ + # XDG default for $XDG_DATA_DIRS; only first, if multipath is False + dirs = self._site_data_dirs + if not self.multipath: + return dirs[0] + return os.pathsep.join(dirs) + + @property + def user_config_dir(self) -> str: + """ + :return: config directory tied to the user, e.g. ``~/.config/$appname/$version`` or + ``$XDG_CONFIG_HOME/$appname/$version`` + """ + path = os.environ.get("XDG_CONFIG_HOME", "") + if not path.strip(): + path = os.path.expanduser("~/.config") # noqa: PTH111 + return self._append_app_name_and_version(path) + + @property + def _site_config_dirs(self) -> list[str]: + path = os.environ.get("XDG_CONFIG_DIRS", "") + if not path.strip(): + path = "/etc/xdg" + return [self._append_app_name_and_version(p) for p in path.split(os.pathsep)] + + @property + def site_config_dir(self) -> str: + """ + :return: config directories shared by users (if `multipath ` + is enabled and ``XDG_CONFIG_DIRS`` is set and a multi path the response is also a multi path separated by + the OS path separator), e.g. ``/etc/xdg/$appname/$version`` + """ + # XDG default for $XDG_CONFIG_DIRS only first, if multipath is False + dirs = self._site_config_dirs + if not self.multipath: + return dirs[0] + return os.pathsep.join(dirs) + + @property + def user_cache_dir(self) -> str: + """ + :return: cache directory tied to the user, e.g. ``~/.cache/$appname/$version`` or + ``~/$XDG_CACHE_HOME/$appname/$version`` + """ + path = os.environ.get("XDG_CACHE_HOME", "") + if not path.strip(): + path = os.path.expanduser("~/.cache") # noqa: PTH111 + return self._append_app_name_and_version(path) + + @property + def site_cache_dir(self) -> str: + """:return: cache directory shared by users, e.g. ``/var/cache/$appname/$version``""" + return self._append_app_name_and_version("/var/cache") + + @property + def user_state_dir(self) -> str: + """ + :return: state directory tied to the user, e.g. ``~/.local/state/$appname/$version`` or + ``$XDG_STATE_HOME/$appname/$version`` + """ + path = os.environ.get("XDG_STATE_HOME", "") + if not path.strip(): + path = os.path.expanduser("~/.local/state") # noqa: PTH111 + return self._append_app_name_and_version(path) + + @property + def user_log_dir(self) -> str: + """:return: log directory tied to the user, same as `user_state_dir` if not opinionated else ``log`` in it""" + path = self.user_state_dir + if self.opinion: + path = os.path.join(path, "log") # noqa: PTH118 + self._optionally_create_directory(path) + return path + + @property + def user_documents_dir(self) -> str: + """:return: documents directory tied to the user, e.g. ``~/Documents``""" + return _get_user_media_dir("XDG_DOCUMENTS_DIR", "~/Documents") + + @property + def user_downloads_dir(self) -> str: + """:return: downloads directory tied to the user, e.g. ``~/Downloads``""" + return _get_user_media_dir("XDG_DOWNLOAD_DIR", "~/Downloads") + + @property + def user_pictures_dir(self) -> str: + """:return: pictures directory tied to the user, e.g. ``~/Pictures``""" + return _get_user_media_dir("XDG_PICTURES_DIR", "~/Pictures") + + @property + def user_videos_dir(self) -> str: + """:return: videos directory tied to the user, e.g. ``~/Videos``""" + return _get_user_media_dir("XDG_VIDEOS_DIR", "~/Videos") + + @property + def user_music_dir(self) -> str: + """:return: music directory tied to the user, e.g. ``~/Music``""" + return _get_user_media_dir("XDG_MUSIC_DIR", "~/Music") + + @property + def user_desktop_dir(self) -> str: + """:return: desktop directory tied to the user, e.g. ``~/Desktop``""" + return _get_user_media_dir("XDG_DESKTOP_DIR", "~/Desktop") + + @property + def user_runtime_dir(self) -> str: + """ + :return: runtime directory tied to the user, e.g. ``/run/user/$(id -u)/$appname/$version`` or + ``$XDG_RUNTIME_DIR/$appname/$version``. + + For FreeBSD/OpenBSD/NetBSD, it would return ``/var/run/user/$(id -u)/$appname/$version`` if + exists, otherwise ``/tmp/runtime-$(id -u)/$appname/$version``, if``$XDG_RUNTIME_DIR`` + is not set. + """ + path = os.environ.get("XDG_RUNTIME_DIR", "") + if not path.strip(): + if sys.platform.startswith(("freebsd", "openbsd", "netbsd")): + path = f"/var/run/user/{getuid()}" + if not Path(path).exists(): + path = f"/tmp/runtime-{getuid()}" # noqa: S108 + else: + path = f"/run/user/{getuid()}" + return self._append_app_name_and_version(path) + + @property + def site_runtime_dir(self) -> str: + """ + :return: runtime directory shared by users, e.g. ``/run/$appname/$version`` or \ + ``$XDG_RUNTIME_DIR/$appname/$version``. + + Note that this behaves almost exactly like `user_runtime_dir` if ``$XDG_RUNTIME_DIR`` is set, but will + fall back to paths associated to the root user instead of a regular logged-in user if it's not set. + + If you wish to ensure that a logged-in root user path is returned e.g. ``/run/user/0``, use `user_runtime_dir` + instead. + + For FreeBSD/OpenBSD/NetBSD, it would return ``/var/run/$appname/$version`` if ``$XDG_RUNTIME_DIR`` is not set. + """ + path = os.environ.get("XDG_RUNTIME_DIR", "") + if not path.strip(): + if sys.platform.startswith(("freebsd", "openbsd", "netbsd")): + path = "/var/run" + else: + path = "/run" + return self._append_app_name_and_version(path) + + @property + def site_data_path(self) -> Path: + """:return: data path shared by users. Only return the first item, even if ``multipath`` is set to ``True``""" + return self._first_item_as_path_if_multipath(self.site_data_dir) + + @property + def site_config_path(self) -> Path: + """:return: config path shared by the users, returns the first item, even if ``multipath`` is set to ``True``""" + return self._first_item_as_path_if_multipath(self.site_config_dir) + + @property + def site_cache_path(self) -> Path: + """:return: cache path shared by users. Only return the first item, even if ``multipath`` is set to ``True``""" + return self._first_item_as_path_if_multipath(self.site_cache_dir) + + def iter_config_dirs(self) -> Iterator[str]: + """:yield: all user and site configuration directories.""" + yield self.user_config_dir + yield from self._site_config_dirs + + def iter_data_dirs(self) -> Iterator[str]: + """:yield: all user and site data directories.""" + yield self.user_data_dir + yield from self._site_data_dirs + + +def _get_user_media_dir(env_var: str, fallback_tilde_path: str) -> str: + media_dir = _get_user_dirs_folder(env_var) + if media_dir is None: + media_dir = os.environ.get(env_var, "").strip() + if not media_dir: + media_dir = os.path.expanduser(fallback_tilde_path) # noqa: PTH111 + + return media_dir + + +def _get_user_dirs_folder(key: str) -> str | None: + """ + Return directory from user-dirs.dirs config file. + + See https://freedesktop.org/wiki/Software/xdg-user-dirs/. + + """ + user_dirs_config_path = Path(Unix().user_config_dir) / "user-dirs.dirs" + if user_dirs_config_path.exists(): + parser = ConfigParser() + + with user_dirs_config_path.open() as stream: + # Add fake section header, so ConfigParser doesn't complain + parser.read_string(f"[top]\n{stream.read()}") + + if key not in parser["top"]: + return None + + path = parser["top"][key].strip('"') + # Handle relative home paths + return path.replace("$HOME", os.path.expanduser("~")) # noqa: PTH111 + + return None + + +__all__ = [ + "Unix", +] diff --git a/parrot/lib/python3.10/site-packages/platformdirs/version.py b/parrot/lib/python3.10/site-packages/platformdirs/version.py new file mode 100644 index 0000000000000000000000000000000000000000..afb49243e3dee24315f75c2a9c7fbf20b4de4b5f --- /dev/null +++ b/parrot/lib/python3.10/site-packages/platformdirs/version.py @@ -0,0 +1,16 @@ +# file generated by setuptools_scm +# don't change, don't track in version control +TYPE_CHECKING = False +if TYPE_CHECKING: + from typing import Tuple, Union + VERSION_TUPLE = Tuple[Union[int, str], ...] +else: + VERSION_TUPLE = object + +version: str +__version__: str +__version_tuple__: VERSION_TUPLE +version_tuple: VERSION_TUPLE + +__version__ = version = '4.3.6' +__version_tuple__ = version_tuple = (4, 3, 6) diff --git a/parrot/lib/python3.10/site-packages/platformdirs/windows.py b/parrot/lib/python3.10/site-packages/platformdirs/windows.py new file mode 100644 index 0000000000000000000000000000000000000000..d7bc96091a2b1cd078a0847519cb5dd50a5d8898 --- /dev/null +++ b/parrot/lib/python3.10/site-packages/platformdirs/windows.py @@ -0,0 +1,272 @@ +"""Windows.""" + +from __future__ import annotations + +import os +import sys +from functools import lru_cache +from typing import TYPE_CHECKING + +from .api import PlatformDirsABC + +if TYPE_CHECKING: + from collections.abc import Callable + + +class Windows(PlatformDirsABC): + """ + `MSDN on where to store app data files `_. + + Makes use of the `appname `, `appauthor + `, `version `, `roaming + `, `opinion `, `ensure_exists + `. + + """ + + @property + def user_data_dir(self) -> str: + """ + :return: data directory tied to the user, e.g. + ``%USERPROFILE%\\AppData\\Local\\$appauthor\\$appname`` (not roaming) or + ``%USERPROFILE%\\AppData\\Roaming\\$appauthor\\$appname`` (roaming) + """ + const = "CSIDL_APPDATA" if self.roaming else "CSIDL_LOCAL_APPDATA" + path = os.path.normpath(get_win_folder(const)) + return self._append_parts(path) + + def _append_parts(self, path: str, *, opinion_value: str | None = None) -> str: + params = [] + if self.appname: + if self.appauthor is not False: + author = self.appauthor or self.appname + params.append(author) + params.append(self.appname) + if opinion_value is not None and self.opinion: + params.append(opinion_value) + if self.version: + params.append(self.version) + path = os.path.join(path, *params) # noqa: PTH118 + self._optionally_create_directory(path) + return path + + @property + def site_data_dir(self) -> str: + """:return: data directory shared by users, e.g. ``C:\\ProgramData\\$appauthor\\$appname``""" + path = os.path.normpath(get_win_folder("CSIDL_COMMON_APPDATA")) + return self._append_parts(path) + + @property + def user_config_dir(self) -> str: + """:return: config directory tied to the user, same as `user_data_dir`""" + return self.user_data_dir + + @property + def site_config_dir(self) -> str: + """:return: config directory shared by the users, same as `site_data_dir`""" + return self.site_data_dir + + @property + def user_cache_dir(self) -> str: + """ + :return: cache directory tied to the user (if opinionated with ``Cache`` folder within ``$appname``) e.g. + ``%USERPROFILE%\\AppData\\Local\\$appauthor\\$appname\\Cache\\$version`` + """ + path = os.path.normpath(get_win_folder("CSIDL_LOCAL_APPDATA")) + return self._append_parts(path, opinion_value="Cache") + + @property + def site_cache_dir(self) -> str: + """:return: cache directory shared by users, e.g. ``C:\\ProgramData\\$appauthor\\$appname\\Cache\\$version``""" + path = os.path.normpath(get_win_folder("CSIDL_COMMON_APPDATA")) + return self._append_parts(path, opinion_value="Cache") + + @property + def user_state_dir(self) -> str: + """:return: state directory tied to the user, same as `user_data_dir`""" + return self.user_data_dir + + @property + def user_log_dir(self) -> str: + """:return: log directory tied to the user, same as `user_data_dir` if not opinionated else ``Logs`` in it""" + path = self.user_data_dir + if self.opinion: + path = os.path.join(path, "Logs") # noqa: PTH118 + self._optionally_create_directory(path) + return path + + @property + def user_documents_dir(self) -> str: + """:return: documents directory tied to the user e.g. ``%USERPROFILE%\\Documents``""" + return os.path.normpath(get_win_folder("CSIDL_PERSONAL")) + + @property + def user_downloads_dir(self) -> str: + """:return: downloads directory tied to the user e.g. ``%USERPROFILE%\\Downloads``""" + return os.path.normpath(get_win_folder("CSIDL_DOWNLOADS")) + + @property + def user_pictures_dir(self) -> str: + """:return: pictures directory tied to the user e.g. ``%USERPROFILE%\\Pictures``""" + return os.path.normpath(get_win_folder("CSIDL_MYPICTURES")) + + @property + def user_videos_dir(self) -> str: + """:return: videos directory tied to the user e.g. ``%USERPROFILE%\\Videos``""" + return os.path.normpath(get_win_folder("CSIDL_MYVIDEO")) + + @property + def user_music_dir(self) -> str: + """:return: music directory tied to the user e.g. ``%USERPROFILE%\\Music``""" + return os.path.normpath(get_win_folder("CSIDL_MYMUSIC")) + + @property + def user_desktop_dir(self) -> str: + """:return: desktop directory tied to the user, e.g. ``%USERPROFILE%\\Desktop``""" + return os.path.normpath(get_win_folder("CSIDL_DESKTOPDIRECTORY")) + + @property + def user_runtime_dir(self) -> str: + """ + :return: runtime directory tied to the user, e.g. + ``%USERPROFILE%\\AppData\\Local\\Temp\\$appauthor\\$appname`` + """ + path = os.path.normpath(os.path.join(get_win_folder("CSIDL_LOCAL_APPDATA"), "Temp")) # noqa: PTH118 + return self._append_parts(path) + + @property + def site_runtime_dir(self) -> str: + """:return: runtime directory shared by users, same as `user_runtime_dir`""" + return self.user_runtime_dir + + +def get_win_folder_from_env_vars(csidl_name: str) -> str: + """Get folder from environment variables.""" + result = get_win_folder_if_csidl_name_not_env_var(csidl_name) + if result is not None: + return result + + env_var_name = { + "CSIDL_APPDATA": "APPDATA", + "CSIDL_COMMON_APPDATA": "ALLUSERSPROFILE", + "CSIDL_LOCAL_APPDATA": "LOCALAPPDATA", + }.get(csidl_name) + if env_var_name is None: + msg = f"Unknown CSIDL name: {csidl_name}" + raise ValueError(msg) + result = os.environ.get(env_var_name) + if result is None: + msg = f"Unset environment variable: {env_var_name}" + raise ValueError(msg) + return result + + +def get_win_folder_if_csidl_name_not_env_var(csidl_name: str) -> str | None: + """Get a folder for a CSIDL name that does not exist as an environment variable.""" + if csidl_name == "CSIDL_PERSONAL": + return os.path.join(os.path.normpath(os.environ["USERPROFILE"]), "Documents") # noqa: PTH118 + + if csidl_name == "CSIDL_DOWNLOADS": + return os.path.join(os.path.normpath(os.environ["USERPROFILE"]), "Downloads") # noqa: PTH118 + + if csidl_name == "CSIDL_MYPICTURES": + return os.path.join(os.path.normpath(os.environ["USERPROFILE"]), "Pictures") # noqa: PTH118 + + if csidl_name == "CSIDL_MYVIDEO": + return os.path.join(os.path.normpath(os.environ["USERPROFILE"]), "Videos") # noqa: PTH118 + + if csidl_name == "CSIDL_MYMUSIC": + return os.path.join(os.path.normpath(os.environ["USERPROFILE"]), "Music") # noqa: PTH118 + return None + + +def get_win_folder_from_registry(csidl_name: str) -> str: + """ + Get folder from the registry. + + This is a fallback technique at best. I'm not sure if using the registry for these guarantees us the correct answer + for all CSIDL_* names. + + """ + shell_folder_name = { + "CSIDL_APPDATA": "AppData", + "CSIDL_COMMON_APPDATA": "Common AppData", + "CSIDL_LOCAL_APPDATA": "Local AppData", + "CSIDL_PERSONAL": "Personal", + "CSIDL_DOWNLOADS": "{374DE290-123F-4565-9164-39C4925E467B}", + "CSIDL_MYPICTURES": "My Pictures", + "CSIDL_MYVIDEO": "My Video", + "CSIDL_MYMUSIC": "My Music", + }.get(csidl_name) + if shell_folder_name is None: + msg = f"Unknown CSIDL name: {csidl_name}" + raise ValueError(msg) + if sys.platform != "win32": # only needed for mypy type checker to know that this code runs only on Windows + raise NotImplementedError + import winreg # noqa: PLC0415 + + key = winreg.OpenKey(winreg.HKEY_CURRENT_USER, r"Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders") + directory, _ = winreg.QueryValueEx(key, shell_folder_name) + return str(directory) + + +def get_win_folder_via_ctypes(csidl_name: str) -> str: + """Get folder with ctypes.""" + # There is no 'CSIDL_DOWNLOADS'. + # Use 'CSIDL_PROFILE' (40) and append the default folder 'Downloads' instead. + # https://learn.microsoft.com/en-us/windows/win32/shell/knownfolderid + + import ctypes # noqa: PLC0415 + + csidl_const = { + "CSIDL_APPDATA": 26, + "CSIDL_COMMON_APPDATA": 35, + "CSIDL_LOCAL_APPDATA": 28, + "CSIDL_PERSONAL": 5, + "CSIDL_MYPICTURES": 39, + "CSIDL_MYVIDEO": 14, + "CSIDL_MYMUSIC": 13, + "CSIDL_DOWNLOADS": 40, + "CSIDL_DESKTOPDIRECTORY": 16, + }.get(csidl_name) + if csidl_const is None: + msg = f"Unknown CSIDL name: {csidl_name}" + raise ValueError(msg) + + buf = ctypes.create_unicode_buffer(1024) + windll = getattr(ctypes, "windll") # noqa: B009 # using getattr to avoid false positive with mypy type checker + windll.shell32.SHGetFolderPathW(None, csidl_const, None, 0, buf) + + # Downgrade to short path name if it has high-bit chars. + if any(ord(c) > 255 for c in buf): # noqa: PLR2004 + buf2 = ctypes.create_unicode_buffer(1024) + if windll.kernel32.GetShortPathNameW(buf.value, buf2, 1024): + buf = buf2 + + if csidl_name == "CSIDL_DOWNLOADS": + return os.path.join(buf.value, "Downloads") # noqa: PTH118 + + return buf.value + + +def _pick_get_win_folder() -> Callable[[str], str]: + try: + import ctypes # noqa: PLC0415 + except ImportError: + pass + else: + if hasattr(ctypes, "windll"): + return get_win_folder_via_ctypes + try: + import winreg # noqa: PLC0415, F401 + except ImportError: + return get_win_folder_from_env_vars + else: + return get_win_folder_from_registry + + +get_win_folder = lru_cache(maxsize=None)(_pick_get_win_folder()) + +__all__ = [ + "Windows", +] diff --git a/parrot/lib/python3.10/site-packages/portalocker/__about__.py b/parrot/lib/python3.10/site-packages/portalocker/__about__.py new file mode 100644 index 0000000000000000000000000000000000000000..a0b817abd5a40ebbbddc247e55637a5629ffc558 --- /dev/null +++ b/parrot/lib/python3.10/site-packages/portalocker/__about__.py @@ -0,0 +1,6 @@ +__package_name__ = 'portalocker' +__author__ = 'Rick van Hattem' +__email__ = 'wolph@wol.ph' +__version__ = '2.10.1' +__description__ = '''Wraps the portalocker recipe for easy usage''' +__url__ = 'https://github.com/WoLpH/portalocker' diff --git a/parrot/lib/python3.10/site-packages/portalocker/__init__.py b/parrot/lib/python3.10/site-packages/portalocker/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..7e757efe0f0d1c8c15c1c75744a2ea191d1ebdf5 --- /dev/null +++ b/parrot/lib/python3.10/site-packages/portalocker/__init__.py @@ -0,0 +1,79 @@ +from . import __about__, constants, exceptions, portalocker +from .utils import ( + BoundedSemaphore, + Lock, + RLock, + TemporaryFileLock, + open_atomic, +) + +try: # pragma: no cover + from .redis import RedisLock +except ImportError: # pragma: no cover + RedisLock = None # type: ignore + + +#: The package name on Pypi +__package_name__ = __about__.__package_name__ +#: Current author and maintainer, view the git history for the previous ones +__author__ = __about__.__author__ +#: Current author's email address +__email__ = __about__.__email__ +#: Version number +__version__ = '2.10.1' +#: Package description for Pypi +__description__ = __about__.__description__ +#: Package homepage +__url__ = __about__.__url__ + + +#: Exception thrown when the file is already locked by someone else +AlreadyLocked = exceptions.AlreadyLocked +#: Exception thrown if an error occurred during locking +LockException = exceptions.LockException + + +#: Lock a file. Note that this is an advisory lock on Linux/Unix systems +lock = portalocker.lock +#: Unlock a file +unlock = portalocker.unlock + +#: Place an exclusive lock. +#: Only one process may hold an exclusive lock for a given file at a given +#: time. +LOCK_EX: constants.LockFlags = constants.LockFlags.EXCLUSIVE + +#: Place a shared lock. +#: More than one process may hold a shared lock for a given file at a given +#: time. +LOCK_SH: constants.LockFlags = constants.LockFlags.SHARED + +#: Acquire the lock in a non-blocking fashion. +LOCK_NB: constants.LockFlags = constants.LockFlags.NON_BLOCKING + +#: Remove an existing lock held by this process. +LOCK_UN: constants.LockFlags = constants.LockFlags.UNBLOCK + +#: Locking flags enum +LockFlags = constants.LockFlags + +#: Locking utility class to automatically handle opening with timeouts and +#: context wrappers + +__all__ = [ + 'lock', + 'unlock', + 'LOCK_EX', + 'LOCK_SH', + 'LOCK_NB', + 'LOCK_UN', + 'LockFlags', + 'LockException', + 'Lock', + 'RLock', + 'AlreadyLocked', + 'BoundedSemaphore', + 'TemporaryFileLock', + 'open_atomic', + 'RedisLock', +] diff --git a/parrot/lib/python3.10/site-packages/portalocker/__main__.py b/parrot/lib/python3.10/site-packages/portalocker/__main__.py new file mode 100644 index 0000000000000000000000000000000000000000..ecac2075a966c9b0331110fac72ef0dcde31d310 --- /dev/null +++ b/parrot/lib/python3.10/site-packages/portalocker/__main__.py @@ -0,0 +1,122 @@ +import argparse +import logging +import os +import pathlib +import re +import typing + +base_path = pathlib.Path(__file__).parent.parent +src_path = base_path / 'portalocker' +dist_path = base_path / 'dist' +_default_output_path = base_path / 'dist' / 'portalocker.py' + +_NAMES_RE = re.compile(r'(?P[^()]+)$') +_RELATIVE_IMPORT_RE = re.compile( + r'^from \.(?P.*?) import (?P\(?)(?P[^()]+)$', +) +_USELESS_ASSIGNMENT_RE = re.compile(r'^(?P\w+) = \1\n$') + +_TEXT_TEMPLATE = """''' +{} +''' + +""" + +logger = logging.getLogger(__name__) + + +def main(argv=None): + parser = argparse.ArgumentParser() + + subparsers = parser.add_subparsers(required=True) + combine_parser = subparsers.add_parser( + 'combine', + help='Combine all Python files into a single unified `portalocker.py` ' + 'file for easy distribution', + ) + combine_parser.add_argument( + '--output-file', + '-o', + type=argparse.FileType('w'), + default=str(_default_output_path), + ) + + combine_parser.set_defaults(func=combine) + args = parser.parse_args(argv) + args.func(args) + + +def _read_file(path: pathlib.Path, seen_files: typing.Set[pathlib.Path]): + if path in seen_files: + return + + names = set() + seen_files.add(path) + paren = False + from_ = None + for line in path.open(): + if paren: + if ')' in line: + line = line.split(')', 1)[1] + paren = False + continue + + match = _NAMES_RE.match(line) + else: + match = _RELATIVE_IMPORT_RE.match(line) + + if match: + if not paren: + paren = bool(match.group('paren')) + from_ = match.group('from') + + if from_: + names.add(from_) + yield from _read_file(src_path / f'{from_}.py', seen_files) + else: + for name in match.group('names').split(','): + name = name.strip() + names.add(name) + yield from _read_file(src_path / f'{name}.py', seen_files) + else: + yield _clean_line(line, names) + + +def _clean_line(line, names): + # Replace `some_import.spam` with `spam` + if names: + joined_names = '|'.join(names) + line = re.sub(fr'\b({joined_names})\.', '', line) + + # Replace useless assignments (e.g. `spam = spam`) + return _USELESS_ASSIGNMENT_RE.sub('', line) + + +def combine(args): + output_file = args.output_file + pathlib.Path(output_file.name).parent.mkdir(parents=True, exist_ok=True) + + output_file.write( + _TEXT_TEMPLATE.format((base_path / 'README.rst').read_text()), + ) + output_file.write( + _TEXT_TEMPLATE.format((base_path / 'LICENSE').read_text()), + ) + + seen_files: typing.Set[pathlib.Path] = set() + for line in _read_file(src_path / '__init__.py', seen_files): + output_file.write(line) + + output_file.flush() + output_file.close() + + logger.info(f'Wrote combined file to {output_file.name}') + # Run black and ruff if available. If not then just run the file. + os.system(f'black {output_file.name}') + os.system(f'ruff --fix {output_file.name}') + os.system(f'python3 {output_file.name}') + + +if __name__ == '__main__': + logging.basicConfig(level=logging.INFO) + main() diff --git a/parrot/lib/python3.10/site-packages/portalocker/__pycache__/__init__.cpython-310.pyc b/parrot/lib/python3.10/site-packages/portalocker/__pycache__/__init__.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..8f99a505a97cf0d7ec123a393423a9ae5ac8811d Binary files /dev/null and b/parrot/lib/python3.10/site-packages/portalocker/__pycache__/__init__.cpython-310.pyc differ diff --git a/parrot/lib/python3.10/site-packages/portalocker/__pycache__/exceptions.cpython-310.pyc b/parrot/lib/python3.10/site-packages/portalocker/__pycache__/exceptions.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..76d84ee18c691074f5113ed9fed493f6a8242571 Binary files /dev/null and b/parrot/lib/python3.10/site-packages/portalocker/__pycache__/exceptions.cpython-310.pyc differ diff --git a/parrot/lib/python3.10/site-packages/portalocker/__pycache__/redis.cpython-310.pyc b/parrot/lib/python3.10/site-packages/portalocker/__pycache__/redis.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..1521513eec317756d361435b38ef7b84b3fe9dad Binary files /dev/null and b/parrot/lib/python3.10/site-packages/portalocker/__pycache__/redis.cpython-310.pyc differ diff --git a/parrot/lib/python3.10/site-packages/portalocker/constants.py b/parrot/lib/python3.10/site-packages/portalocker/constants.py new file mode 100644 index 0000000000000000000000000000000000000000..2099f1fbcc7f01727d186381fd0837bb674dff79 --- /dev/null +++ b/parrot/lib/python3.10/site-packages/portalocker/constants.py @@ -0,0 +1,59 @@ +''' +Locking constants + +Lock types: + +- `EXCLUSIVE` exclusive lock +- `SHARED` shared lock + +Lock flags: + +- `NON_BLOCKING` non-blocking + +Manually unlock, only needed internally + +- `UNBLOCK` unlock +''' + +import enum +import os + +# The actual tests will execute the code anyhow so the following code can +# safely be ignored from the coverage tests +if os.name == 'nt': # pragma: no cover + import msvcrt + + #: exclusive lock + LOCK_EX = 0x1 + #: shared lock + LOCK_SH = 0x2 + #: non-blocking + LOCK_NB = 0x4 + #: unlock + LOCK_UN = msvcrt.LK_UNLCK # type: ignore + +elif os.name == 'posix': # pragma: no cover + import fcntl + + #: exclusive lock + LOCK_EX = fcntl.LOCK_EX + #: shared lock + LOCK_SH = fcntl.LOCK_SH + #: non-blocking + LOCK_NB = fcntl.LOCK_NB + #: unlock + LOCK_UN = fcntl.LOCK_UN + +else: # pragma: no cover + raise RuntimeError('PortaLocker only defined for nt and posix platforms') + + +class LockFlags(enum.IntFlag): + #: exclusive lock + EXCLUSIVE = LOCK_EX + #: shared lock + SHARED = LOCK_SH + #: non-blocking + NON_BLOCKING = LOCK_NB + #: unlock + UNBLOCK = LOCK_UN diff --git a/parrot/lib/python3.10/site-packages/portalocker/exceptions.py b/parrot/lib/python3.10/site-packages/portalocker/exceptions.py new file mode 100644 index 0000000000000000000000000000000000000000..e871d13acbf6deb057c2e09d5e0fbd9404891f76 --- /dev/null +++ b/parrot/lib/python3.10/site-packages/portalocker/exceptions.py @@ -0,0 +1,27 @@ +import typing + + +class BaseLockException(Exception): # noqa: N818 + # Error codes: + LOCK_FAILED = 1 + + def __init__( + self, + *args: typing.Any, + fh: typing.Union[typing.IO, None, int] = None, + **kwargs: typing.Any, + ) -> None: + self.fh = fh + Exception.__init__(self, *args) + + +class LockException(BaseLockException): + pass + + +class AlreadyLocked(LockException): + pass + + +class FileToLarge(LockException): + pass diff --git a/parrot/lib/python3.10/site-packages/portalocker/py.typed b/parrot/lib/python3.10/site-packages/portalocker/py.typed new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/parrot/lib/python3.10/site-packages/portalocker/redis.py b/parrot/lib/python3.10/site-packages/portalocker/redis.py new file mode 100644 index 0000000000000000000000000000000000000000..11ee8767581d41005ae6371b8377153e42632677 --- /dev/null +++ b/parrot/lib/python3.10/site-packages/portalocker/redis.py @@ -0,0 +1,236 @@ +import _thread +import json +import logging +import random +import time +import typing + +from redis import client + +from . import exceptions, utils + +logger = logging.getLogger(__name__) + +DEFAULT_UNAVAILABLE_TIMEOUT = 1 +DEFAULT_THREAD_SLEEP_TIME = 0.1 + + +class PubSubWorkerThread(client.PubSubWorkerThread): # type: ignore + def run(self): + try: + super().run() + except Exception: # pragma: no cover + _thread.interrupt_main() + raise + + +class RedisLock(utils.LockBase): + ''' + An extremely reliable Redis lock based on pubsub with a keep-alive thread + + As opposed to most Redis locking systems based on key/value pairs, + this locking method is based on the pubsub system. The big advantage is + that if the connection gets killed due to network issues, crashing + processes or otherwise, it will still immediately unlock instead of + waiting for a lock timeout. + + To make sure both sides of the lock know about the connection state it is + recommended to set the `health_check_interval` when creating the redis + connection.. + + Args: + channel: the redis channel to use as locking key. + connection: an optional redis connection if you already have one + or if you need to specify the redis connection + timeout: timeout when trying to acquire a lock + check_interval: check interval while waiting + fail_when_locked: after the initial lock failed, return an error + or lock the file. This does not wait for the timeout. + thread_sleep_time: sleep time between fetching messages from redis to + prevent a busy/wait loop. In the case of lock conflicts this + increases the time it takes to resolve the conflict. This should + be smaller than the `check_interval` to be useful. + unavailable_timeout: If the conflicting lock is properly connected + this should never exceed twice your redis latency. Note that this + will increase the wait time possibly beyond your `timeout` and is + always executed if a conflict arises. + redis_kwargs: The redis connection arguments if no connection is + given. The `DEFAULT_REDIS_KWARGS` are used as default, if you want + to override these you need to explicitly specify a value (e.g. + `health_check_interval=0`) + + ''' + + redis_kwargs: typing.Dict[str, typing.Any] + thread: typing.Optional[PubSubWorkerThread] + channel: str + timeout: float + connection: typing.Optional[client.Redis] + pubsub: typing.Optional[client.PubSub] = None + close_connection: bool + + DEFAULT_REDIS_KWARGS: typing.ClassVar[typing.Dict[str, typing.Any]] = dict( + health_check_interval=10, + ) + + def __init__( + self, + channel: str, + connection: typing.Optional[client.Redis] = None, + timeout: typing.Optional[float] = None, + check_interval: typing.Optional[float] = None, + fail_when_locked: typing.Optional[bool] = False, + thread_sleep_time: float = DEFAULT_THREAD_SLEEP_TIME, + unavailable_timeout: float = DEFAULT_UNAVAILABLE_TIMEOUT, + redis_kwargs: typing.Optional[typing.Dict] = None, + ): + # We don't want to close connections given as an argument + self.close_connection = not connection + + self.thread = None + self.channel = channel + self.connection = connection + self.thread_sleep_time = thread_sleep_time + self.unavailable_timeout = unavailable_timeout + self.redis_kwargs = redis_kwargs or dict() + + for key, value in self.DEFAULT_REDIS_KWARGS.items(): + self.redis_kwargs.setdefault(key, value) + + super().__init__( + timeout=timeout, + check_interval=check_interval, + fail_when_locked=fail_when_locked, + ) + + def get_connection(self) -> client.Redis: + if not self.connection: + self.connection = client.Redis(**self.redis_kwargs) + + return self.connection + + def channel_handler(self, message): + if message.get('type') != 'message': # pragma: no cover + return + + try: + data = json.loads(message.get('data')) + except TypeError: # pragma: no cover + logger.debug('TypeError while parsing: %r', message) + return + + assert self.connection is not None + self.connection.publish(data['response_channel'], str(time.time())) + + @property + def client_name(self): + return f'{self.channel}-lock' + + def acquire( # type: ignore[override] + self, + timeout: typing.Optional[float] = None, + check_interval: typing.Optional[float] = None, + fail_when_locked: typing.Optional[bool] = None, + ) -> 'RedisLock': + timeout = utils.coalesce(timeout, self.timeout, 0.0) + check_interval = utils.coalesce( + check_interval, + self.check_interval, + 0.0, + ) + fail_when_locked = utils.coalesce( + fail_when_locked, + self.fail_when_locked, + ) + + assert not self.pubsub, 'This lock is already active' + connection = self.get_connection() + + timeout_generator = self._timeout_generator(timeout, check_interval) + for _ in timeout_generator: # pragma: no branch + subscribers = connection.pubsub_numsub(self.channel)[0][1] + + if subscribers: + logger.debug( + 'Found %d lock subscribers for %s', + subscribers, + self.channel, + ) + + if self.check_or_kill_lock( + connection, + self.unavailable_timeout, + ): # pragma: no branch + continue + else: # pragma: no cover + subscribers = 0 + + # Note: this should not be changed to an elif because the if + # above can still end up here + if not subscribers: + connection.client_setname(self.client_name) + self.pubsub = connection.pubsub() + self.pubsub.subscribe(**{self.channel: self.channel_handler}) + self.thread = PubSubWorkerThread( + self.pubsub, + sleep_time=self.thread_sleep_time, + ) + self.thread.start() + + subscribers = connection.pubsub_numsub(self.channel)[0][1] + if subscribers == 1: # pragma: no branch + return self + else: # pragma: no cover + # Race condition, let's try again + self.release() + + if fail_when_locked: # pragma: no cover + raise exceptions.AlreadyLocked(exceptions) + + raise exceptions.AlreadyLocked(exceptions) + + def check_or_kill_lock(self, connection, timeout): + # Random channel name to get messages back from the lock + response_channel = f'{self.channel}-{random.random()}' + + pubsub = connection.pubsub() + pubsub.subscribe(response_channel) + connection.publish( + self.channel, + json.dumps( + dict( + response_channel=response_channel, + message='ping', + ), + ), + ) + + check_interval = min(self.thread_sleep_time, timeout / 10) + for _ in self._timeout_generator( + timeout, + check_interval, + ): # pragma: no branch + if pubsub.get_message(timeout=check_interval): + pubsub.close() + return True + + for client_ in connection.client_list('pubsub'): # pragma: no cover + if client_.get('name') == self.client_name: + logger.warning('Killing unavailable redis client: %r', client_) + connection.client_kill_filter(client_.get('id')) + return None + + def release(self): + if self.thread: # pragma: no branch + self.thread.stop() + self.thread.join() + self.thread = None + time.sleep(0.01) + + if self.pubsub: # pragma: no branch + self.pubsub.unsubscribe(self.channel) + self.pubsub.close() + self.pubsub = None + + def __del__(self): + self.release() diff --git a/parrot/lib/python3.10/site-packages/portalocker/utils.py b/parrot/lib/python3.10/site-packages/portalocker/utils.py new file mode 100644 index 0000000000000000000000000000000000000000..5115b0e4a254d120e232a7b61ac3cccb294814f6 --- /dev/null +++ b/parrot/lib/python3.10/site-packages/portalocker/utils.py @@ -0,0 +1,569 @@ +import abc +import atexit +import contextlib +import logging +import os +import pathlib +import random +import tempfile +import time +import typing +import warnings + +from . import constants, exceptions, portalocker + +logger = logging.getLogger(__name__) + +DEFAULT_TIMEOUT = 5 +DEFAULT_CHECK_INTERVAL = 0.25 +DEFAULT_FAIL_WHEN_LOCKED = False +LOCK_METHOD = constants.LockFlags.EXCLUSIVE | constants.LockFlags.NON_BLOCKING + +__all__ = [ + 'Lock', + 'open_atomic', +] + +Filename = typing.Union[str, pathlib.Path] + + +def coalesce(*args: typing.Any, test_value: typing.Any = None) -> typing.Any: + '''Simple coalescing function that returns the first value that is not + equal to the `test_value`. Or `None` if no value is valid. Usually this + means that the last given value is the default value. + + Note that the `test_value` is compared using an identity check + (i.e. `value is not test_value`) so changing the `test_value` won't work + for all values. + + >>> coalesce(None, 1) + 1 + >>> coalesce() + + >>> coalesce(0, False, True) + 0 + >>> coalesce(0, False, True, test_value=0) + False + + # This won't work because of the `is not test_value` type testing: + >>> coalesce([], dict(spam='eggs'), test_value=[]) + [] + ''' + return next((arg for arg in args if arg is not test_value), None) + + +@contextlib.contextmanager +def open_atomic( + filename: Filename, + binary: bool = True, +) -> typing.Iterator[typing.IO]: + '''Open a file for atomic writing. Instead of locking this method allows + you to write the entire file and move it to the actual location. Note that + this makes the assumption that a rename is atomic on your platform which + is generally the case but not a guarantee. + + http://docs.python.org/library/os.html#os.rename + + >>> filename = 'test_file.txt' + >>> if os.path.exists(filename): + ... os.remove(filename) + + >>> with open_atomic(filename) as fh: + ... written = fh.write(b'test') + >>> assert os.path.exists(filename) + >>> os.remove(filename) + + >>> import pathlib + >>> path_filename = pathlib.Path('test_file.txt') + + >>> with open_atomic(path_filename) as fh: + ... written = fh.write(b'test') + >>> assert path_filename.exists() + >>> path_filename.unlink() + ''' + # `pathlib.Path` cast in case `path` is a `str` + path: pathlib.Path = pathlib.Path(filename) + + assert not path.exists(), f'{path!r} exists' + + # Create the parent directory if it doesn't exist + path.parent.mkdir(parents=True, exist_ok=True) + + temp_fh = tempfile.NamedTemporaryFile( + mode=binary and 'wb' or 'w', + dir=str(path.parent), + delete=False, + ) + yield temp_fh + temp_fh.flush() + os.fsync(temp_fh.fileno()) + temp_fh.close() + try: + os.rename(temp_fh.name, path) + finally: + with contextlib.suppress(Exception): + os.remove(temp_fh.name) + + +class LockBase(abc.ABC): # pragma: no cover + #: timeout when trying to acquire a lock + timeout: float + #: check interval while waiting for `timeout` + check_interval: float + #: skip the timeout and immediately fail if the initial lock fails + fail_when_locked: bool + + def __init__( + self, + timeout: typing.Optional[float] = None, + check_interval: typing.Optional[float] = None, + fail_when_locked: typing.Optional[bool] = None, + ): + self.timeout = coalesce(timeout, DEFAULT_TIMEOUT) + self.check_interval = coalesce(check_interval, DEFAULT_CHECK_INTERVAL) + self.fail_when_locked = coalesce( + fail_when_locked, + DEFAULT_FAIL_WHEN_LOCKED, + ) + + @abc.abstractmethod + def acquire( + self, + timeout: typing.Optional[float] = None, + check_interval: typing.Optional[float] = None, + fail_when_locked: typing.Optional[bool] = None, + ) -> typing.IO[typing.AnyStr]: ... + + def _timeout_generator( + self, + timeout: typing.Optional[float], + check_interval: typing.Optional[float], + ) -> typing.Iterator[int]: + f_timeout = coalesce(timeout, self.timeout, 0.0) + f_check_interval = coalesce(check_interval, self.check_interval, 0.0) + + yield 0 + i = 0 + + start_time = time.perf_counter() + while start_time + f_timeout > time.perf_counter(): + i += 1 + yield i + + # Take low lock checks into account to stay within the interval + since_start_time = time.perf_counter() - start_time + time.sleep(max(0.001, (i * f_check_interval) - since_start_time)) + + @abc.abstractmethod + def release(self): ... + + def __enter__(self) -> typing.IO[typing.AnyStr]: + return self.acquire() + + def __exit__( + self, + exc_type: typing.Optional[typing.Type[BaseException]], + exc_value: typing.Optional[BaseException], + traceback: typing.Any, # Should be typing.TracebackType + ) -> typing.Optional[bool]: + self.release() + return None + + def __delete__(self, instance): + instance.release() + + +class Lock(LockBase): + '''Lock manager with built-in timeout + + Args: + filename: filename + mode: the open mode, 'a' or 'ab' should be used for writing. When mode + contains `w` the file will be truncated to 0 bytes. + timeout: timeout when trying to acquire a lock + check_interval: check interval while waiting + fail_when_locked: after the initial lock failed, return an error + or lock the file. This does not wait for the timeout. + **file_open_kwargs: The kwargs for the `open(...)` call + + fail_when_locked is useful when multiple threads/processes can race + when creating a file. If set to true than the system will wait till + the lock was acquired and then return an AlreadyLocked exception. + + Note that the file is opened first and locked later. So using 'w' as + mode will result in truncate _BEFORE_ the lock is checked. + ''' + + def __init__( + self, + filename: Filename, + mode: str = 'a', + timeout: typing.Optional[float] = None, + check_interval: float = DEFAULT_CHECK_INTERVAL, + fail_when_locked: bool = DEFAULT_FAIL_WHEN_LOCKED, + flags: constants.LockFlags = LOCK_METHOD, + **file_open_kwargs, + ): + if 'w' in mode: + truncate = True + mode = mode.replace('w', 'a') + else: + truncate = False + + if timeout is None: + timeout = DEFAULT_TIMEOUT + elif not (flags & constants.LockFlags.NON_BLOCKING): + warnings.warn( + 'timeout has no effect in blocking mode', + stacklevel=1, + ) + + self.fh: typing.Optional[typing.IO] = None + self.filename: str = str(filename) + self.mode: str = mode + self.truncate: bool = truncate + self.timeout: float = timeout + self.check_interval: float = check_interval + self.fail_when_locked: bool = fail_when_locked + self.flags: constants.LockFlags = flags + self.file_open_kwargs = file_open_kwargs + + def acquire( + self, + timeout: typing.Optional[float] = None, + check_interval: typing.Optional[float] = None, + fail_when_locked: typing.Optional[bool] = None, + ) -> typing.IO[typing.AnyStr]: + '''Acquire the locked filehandle''' + + fail_when_locked = coalesce(fail_when_locked, self.fail_when_locked) + + if ( + not (self.flags & constants.LockFlags.NON_BLOCKING) + and timeout is not None + ): + warnings.warn( + 'timeout has no effect in blocking mode', + stacklevel=1, + ) + + # If we already have a filehandle, return it + fh: typing.Optional[typing.IO] = self.fh + if fh: + return fh + + # Get a new filehandler + fh = self._get_fh() + + def try_close(): # pragma: no cover + # Silently try to close the handle if possible, ignore all issues + if fh is not None: + with contextlib.suppress(Exception): + fh.close() + + exception = None + # Try till the timeout has passed + for _ in self._timeout_generator(timeout, check_interval): + exception = None + try: + # Try to lock + fh = self._get_lock(fh) + break + except exceptions.LockException as exc: + # Python will automatically remove the variable from memory + # unless you save it in a different location + exception = exc + + # We already tried to the get the lock + # If fail_when_locked is True, stop trying + if fail_when_locked: + try_close() + raise exceptions.AlreadyLocked(exception) from exc + except Exception as exc: + # Something went wrong with the locking mechanism. + # Wrap in a LockException and re-raise: + try_close() + raise exceptions.LockException(exc) from exc + + # Wait a bit + + if exception: + try_close() + # We got a timeout... reraising + raise exception + + # Prepare the filehandle (truncate if needed) + fh = self._prepare_fh(fh) + + self.fh = fh + return fh + + def __enter__(self) -> typing.IO[typing.AnyStr]: + return self.acquire() + + def release(self): + '''Releases the currently locked file handle''' + if self.fh: + portalocker.unlock(self.fh) + self.fh.close() + self.fh = None + + def _get_fh(self) -> typing.IO: + '''Get a new filehandle''' + return open( # noqa: SIM115 + self.filename, + self.mode, + **self.file_open_kwargs, + ) + + def _get_lock(self, fh: typing.IO) -> typing.IO: + ''' + Try to lock the given filehandle + + returns LockException if it fails''' + portalocker.lock(fh, self.flags) + return fh + + def _prepare_fh(self, fh: typing.IO) -> typing.IO: + ''' + Prepare the filehandle for usage + + If truncate is a number, the file will be truncated to that amount of + bytes + ''' + if self.truncate: + fh.seek(0) + fh.truncate(0) + + return fh + + +class RLock(Lock): + ''' + A reentrant lock, functions in a similar way to threading.RLock in that it + can be acquired multiple times. When the corresponding number of release() + calls are made the lock will finally release the underlying file lock. + ''' + + def __init__( + self, + filename, + mode='a', + timeout=DEFAULT_TIMEOUT, + check_interval=DEFAULT_CHECK_INTERVAL, + fail_when_locked=False, + flags=LOCK_METHOD, + ): + super().__init__( + filename, + mode, + timeout, + check_interval, + fail_when_locked, + flags, + ) + self._acquire_count = 0 + + def acquire( + self, + timeout: typing.Optional[float] = None, + check_interval: typing.Optional[float] = None, + fail_when_locked: typing.Optional[bool] = None, + ) -> typing.IO: + if self._acquire_count >= 1: + fh = self.fh + else: + fh = super().acquire(timeout, check_interval, fail_when_locked) + self._acquire_count += 1 + assert fh + return fh + + def release(self): + if self._acquire_count == 0: + raise exceptions.LockException( + 'Cannot release more times than acquired', + ) + + if self._acquire_count == 1: + super().release() + self._acquire_count -= 1 + + +class TemporaryFileLock(Lock): + def __init__( + self, + filename='.lock', + timeout=DEFAULT_TIMEOUT, + check_interval=DEFAULT_CHECK_INTERVAL, + fail_when_locked=True, + flags=LOCK_METHOD, + ): + Lock.__init__( + self, + filename=filename, + mode='w', + timeout=timeout, + check_interval=check_interval, + fail_when_locked=fail_when_locked, + flags=flags, + ) + atexit.register(self.release) + + def release(self): + Lock.release(self) + if os.path.isfile(self.filename): # pragma: no branch + os.unlink(self.filename) + + +class BoundedSemaphore(LockBase): + ''' + Bounded semaphore to prevent too many parallel processes from running + + This method is deprecated because multiple processes that are completely + unrelated could end up using the same semaphore. To prevent this, + use `NamedBoundedSemaphore` instead. The + `NamedBoundedSemaphore` is a drop-in replacement for this class. + + >>> semaphore = BoundedSemaphore(2, directory='') + >>> str(semaphore.get_filenames()[0]) + 'bounded_semaphore.00.lock' + >>> str(sorted(semaphore.get_random_filenames())[1]) + 'bounded_semaphore.01.lock' + ''' + + lock: typing.Optional[Lock] + + def __init__( + self, + maximum: int, + name: str = 'bounded_semaphore', + filename_pattern: str = '{name}.{number:02d}.lock', + directory: str = tempfile.gettempdir(), + timeout: typing.Optional[float] = DEFAULT_TIMEOUT, + check_interval: typing.Optional[float] = DEFAULT_CHECK_INTERVAL, + fail_when_locked: typing.Optional[bool] = True, + ): + self.maximum = maximum + self.name = name + self.filename_pattern = filename_pattern + self.directory = directory + self.lock: typing.Optional[Lock] = None + super().__init__( + timeout=timeout, + check_interval=check_interval, + fail_when_locked=fail_when_locked, + ) + + if not name or name == 'bounded_semaphore': + warnings.warn( + '`BoundedSemaphore` without an explicit `name` ' + 'argument is deprecated, use NamedBoundedSemaphore', + DeprecationWarning, + stacklevel=1, + ) + + def get_filenames(self) -> typing.Sequence[pathlib.Path]: + return [self.get_filename(n) for n in range(self.maximum)] + + def get_random_filenames(self) -> typing.Sequence[pathlib.Path]: + filenames = list(self.get_filenames()) + random.shuffle(filenames) + return filenames + + def get_filename(self, number) -> pathlib.Path: + return pathlib.Path(self.directory) / self.filename_pattern.format( + name=self.name, + number=number, + ) + + def acquire( # type: ignore[override] + self, + timeout: typing.Optional[float] = None, + check_interval: typing.Optional[float] = None, + fail_when_locked: typing.Optional[bool] = None, + ) -> typing.Optional[Lock]: + assert not self.lock, 'Already locked' + + filenames = self.get_filenames() + + for n in self._timeout_generator(timeout, check_interval): # pragma: + logger.debug('trying lock (attempt %d) %r', n, filenames) + # no branch + if self.try_lock(filenames): # pragma: no branch + return self.lock # pragma: no cover + + if fail_when_locked := coalesce( + fail_when_locked, + self.fail_when_locked, + ): + raise exceptions.AlreadyLocked() + + return None + + def try_lock(self, filenames: typing.Sequence[Filename]) -> bool: + filename: Filename + for filename in filenames: + logger.debug('trying lock for %r', filename) + self.lock = Lock(filename, fail_when_locked=True) + try: + self.lock.acquire() + except exceptions.AlreadyLocked: + self.lock = None + else: + logger.debug('locked %r', filename) + return True + + return False + + def release(self): # pragma: no cover + if self.lock is not None: + self.lock.release() + self.lock = None + + +class NamedBoundedSemaphore(BoundedSemaphore): + ''' + Bounded semaphore to prevent too many parallel processes from running + + It's also possible to specify a timeout when acquiring the lock to wait + for a resource to become available. This is very similar to + `threading.BoundedSemaphore` but works across multiple processes and across + multiple operating systems. + + Because this works across multiple processes it's important to give the + semaphore a name. This name is used to create the lock files. If you + don't specify a name, a random name will be generated. This means that + you can't use the same semaphore in multiple processes unless you pass the + semaphore object to the other processes. + + >>> semaphore = NamedBoundedSemaphore(2, name='test') + >>> str(semaphore.get_filenames()[0]) + '...test.00.lock' + + >>> semaphore = NamedBoundedSemaphore(2) + >>> 'bounded_semaphore' in str(semaphore.get_filenames()[0]) + True + + ''' + + def __init__( + self, + maximum: int, + name: typing.Optional[str] = None, + filename_pattern: str = '{name}.{number:02d}.lock', + directory: str = tempfile.gettempdir(), + timeout: typing.Optional[float] = DEFAULT_TIMEOUT, + check_interval: typing.Optional[float] = DEFAULT_CHECK_INTERVAL, + fail_when_locked: typing.Optional[bool] = True, + ): + if name is None: + name = 'bounded_semaphore.%d' % random.randint(0, 1000000) + super().__init__( + maximum, + name, + filename_pattern, + directory, + timeout, + check_interval, + fail_when_locked, + ) diff --git a/parrot/lib/python3.10/site-packages/python_dateutil-2.9.0.post0.dist-info/INSTALLER b/parrot/lib/python3.10/site-packages/python_dateutil-2.9.0.post0.dist-info/INSTALLER new file mode 100644 index 0000000000000000000000000000000000000000..a1b589e38a32041e49332e5e81c2d363dc418d68 --- /dev/null +++ b/parrot/lib/python3.10/site-packages/python_dateutil-2.9.0.post0.dist-info/INSTALLER @@ -0,0 +1 @@ +pip diff --git a/parrot/lib/python3.10/site-packages/python_dateutil-2.9.0.post0.dist-info/LICENSE b/parrot/lib/python3.10/site-packages/python_dateutil-2.9.0.post0.dist-info/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..1e65815cf0b3132689485874a93034ede7206bf4 --- /dev/null +++ b/parrot/lib/python3.10/site-packages/python_dateutil-2.9.0.post0.dist-info/LICENSE @@ -0,0 +1,54 @@ +Copyright 2017- Paul Ganssle +Copyright 2017- dateutil contributors (see AUTHORS file) + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + +The above license applies to all contributions after 2017-12-01, as well as +all contributions that have been re-licensed (see AUTHORS file for the list of +contributors who have re-licensed their code). +-------------------------------------------------------------------------------- +dateutil - Extensions to the standard Python datetime module. + +Copyright (c) 2003-2011 - Gustavo Niemeyer +Copyright (c) 2012-2014 - Tomi Pieviläinen +Copyright (c) 2014-2016 - Yaron de Leeuw +Copyright (c) 2015- - Paul Ganssle +Copyright (c) 2015- - dateutil contributors (see AUTHORS file) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of the copyright holder nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR +CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +The above BSD License Applies to all code, even that also covered by Apache 2.0. \ No newline at end of file diff --git a/parrot/lib/python3.10/site-packages/python_dateutil-2.9.0.post0.dist-info/METADATA b/parrot/lib/python3.10/site-packages/python_dateutil-2.9.0.post0.dist-info/METADATA new file mode 100644 index 0000000000000000000000000000000000000000..577f2bf2b7749e1b123b8225d610b1b257e430cc --- /dev/null +++ b/parrot/lib/python3.10/site-packages/python_dateutil-2.9.0.post0.dist-info/METADATA @@ -0,0 +1,204 @@ +Metadata-Version: 2.1 +Name: python-dateutil +Version: 2.9.0.post0 +Summary: Extensions to the standard Python datetime module +Home-page: https://github.com/dateutil/dateutil +Author: Gustavo Niemeyer +Author-email: gustavo@niemeyer.net +Maintainer: Paul Ganssle +Maintainer-email: dateutil@python.org +License: Dual License +Project-URL: Documentation, https://dateutil.readthedocs.io/en/stable/ +Project-URL: Source, https://github.com/dateutil/dateutil +Classifier: Development Status :: 5 - Production/Stable +Classifier: Intended Audience :: Developers +Classifier: License :: OSI Approved :: BSD License +Classifier: License :: OSI Approved :: Apache Software License +Classifier: Programming Language :: Python +Classifier: Programming Language :: Python :: 2 +Classifier: Programming Language :: Python :: 2.7 +Classifier: Programming Language :: Python :: 3 +Classifier: Programming Language :: Python :: 3.3 +Classifier: Programming Language :: Python :: 3.4 +Classifier: Programming Language :: Python :: 3.5 +Classifier: Programming Language :: Python :: 3.6 +Classifier: Programming Language :: Python :: 3.7 +Classifier: Programming Language :: Python :: 3.8 +Classifier: Programming Language :: Python :: 3.9 +Classifier: Programming Language :: Python :: 3.10 +Classifier: Programming Language :: Python :: 3.11 +Classifier: Programming Language :: Python :: 3.12 +Classifier: Topic :: Software Development :: Libraries +Requires-Python: !=3.0.*,!=3.1.*,!=3.2.*,>=2.7 +Description-Content-Type: text/x-rst +License-File: LICENSE +Requires-Dist: six >=1.5 + +dateutil - powerful extensions to datetime +========================================== + +|pypi| |support| |licence| + +|gitter| |readthedocs| + +|travis| |appveyor| |pipelines| |coverage| + +.. |pypi| image:: https://img.shields.io/pypi/v/python-dateutil.svg?style=flat-square + :target: https://pypi.org/project/python-dateutil/ + :alt: pypi version + +.. |support| image:: https://img.shields.io/pypi/pyversions/python-dateutil.svg?style=flat-square + :target: https://pypi.org/project/python-dateutil/ + :alt: supported Python version + +.. |travis| image:: https://img.shields.io/travis/dateutil/dateutil/master.svg?style=flat-square&label=Travis%20Build + :target: https://travis-ci.org/dateutil/dateutil + :alt: travis build status + +.. |appveyor| image:: https://img.shields.io/appveyor/ci/dateutil/dateutil/master.svg?style=flat-square&logo=appveyor + :target: https://ci.appveyor.com/project/dateutil/dateutil + :alt: appveyor build status + +.. |pipelines| image:: https://dev.azure.com/pythondateutilazure/dateutil/_apis/build/status/dateutil.dateutil?branchName=master + :target: https://dev.azure.com/pythondateutilazure/dateutil/_build/latest?definitionId=1&branchName=master + :alt: azure pipelines build status + +.. |coverage| image:: https://codecov.io/gh/dateutil/dateutil/branch/master/graphs/badge.svg?branch=master + :target: https://codecov.io/gh/dateutil/dateutil?branch=master + :alt: Code coverage + +.. |gitter| image:: https://badges.gitter.im/dateutil/dateutil.svg + :alt: Join the chat at https://gitter.im/dateutil/dateutil + :target: https://gitter.im/dateutil/dateutil + +.. |licence| image:: https://img.shields.io/pypi/l/python-dateutil.svg?style=flat-square + :target: https://pypi.org/project/python-dateutil/ + :alt: licence + +.. |readthedocs| image:: https://img.shields.io/readthedocs/dateutil/latest.svg?style=flat-square&label=Read%20the%20Docs + :alt: Read the documentation at https://dateutil.readthedocs.io/en/latest/ + :target: https://dateutil.readthedocs.io/en/latest/ + +The `dateutil` module provides powerful extensions to +the standard `datetime` module, available in Python. + +Installation +============ +`dateutil` can be installed from PyPI using `pip` (note that the package name is +different from the importable name):: + + pip install python-dateutil + +Download +======== +dateutil is available on PyPI +https://pypi.org/project/python-dateutil/ + +The documentation is hosted at: +https://dateutil.readthedocs.io/en/stable/ + +Code +==== +The code and issue tracker are hosted on GitHub: +https://github.com/dateutil/dateutil/ + +Features +======== + +* Computing of relative deltas (next month, next year, + next Monday, last week of month, etc); +* Computing of relative deltas between two given + date and/or datetime objects; +* Computing of dates based on very flexible recurrence rules, + using a superset of the `iCalendar `_ + specification. Parsing of RFC strings is supported as well. +* Generic parsing of dates in almost any string format; +* Timezone (tzinfo) implementations for tzfile(5) format + files (/etc/localtime, /usr/share/zoneinfo, etc), TZ + environment string (in all known formats), iCalendar + format files, given ranges (with help from relative deltas), + local machine timezone, fixed offset timezone, UTC timezone, + and Windows registry-based time zones. +* Internal up-to-date world timezone information based on + Olson's database. +* Computing of Easter Sunday dates for any given year, + using Western, Orthodox or Julian algorithms; +* A comprehensive test suite. + +Quick example +============= +Here's a snapshot, just to give an idea about the power of the +package. For more examples, look at the documentation. + +Suppose you want to know how much time is left, in +years/months/days/etc, before the next easter happening on a +year with a Friday 13th in August, and you want to get today's +date out of the "date" unix system command. Here is the code: + +.. code-block:: python3 + + >>> from dateutil.relativedelta import * + >>> from dateutil.easter import * + >>> from dateutil.rrule import * + >>> from dateutil.parser import * + >>> from datetime import * + >>> now = parse("Sat Oct 11 17:13:46 UTC 2003") + >>> today = now.date() + >>> year = rrule(YEARLY,dtstart=now,bymonth=8,bymonthday=13,byweekday=FR)[0].year + >>> rdelta = relativedelta(easter(year), today) + >>> print("Today is: %s" % today) + Today is: 2003-10-11 + >>> print("Year with next Aug 13th on a Friday is: %s" % year) + Year with next Aug 13th on a Friday is: 2004 + >>> print("How far is the Easter of that year: %s" % rdelta) + How far is the Easter of that year: relativedelta(months=+6) + >>> print("And the Easter of that year is: %s" % (today+rdelta)) + And the Easter of that year is: 2004-04-11 + +Being exactly 6 months ahead was **really** a coincidence :) + +Contributing +============ + +We welcome many types of contributions - bug reports, pull requests (code, infrastructure or documentation fixes). For more information about how to contribute to the project, see the ``CONTRIBUTING.md`` file in the repository. + + +Author +====== +The dateutil module was written by Gustavo Niemeyer +in 2003. + +It is maintained by: + +* Gustavo Niemeyer 2003-2011 +* Tomi Pieviläinen 2012-2014 +* Yaron de Leeuw 2014-2016 +* Paul Ganssle 2015- + +Starting with version 2.4.1 and running until 2.8.2, all source and binary +distributions will be signed by a PGP key that has, at the very least, been +signed by the key which made the previous release. A table of release signing +keys can be found below: + +=========== ============================ +Releases Signing key fingerprint +=========== ============================ +2.4.1-2.8.2 `6B49 ACBA DCF6 BD1C A206 67AB CD54 FCE3 D964 BEFB`_ +=========== ============================ + +New releases *may* have signed tags, but binary and source distributions +uploaded to PyPI will no longer have GPG signatures attached. + +Contact +======= +Our mailing list is available at `dateutil@python.org `_. As it is hosted by the PSF, it is subject to the `PSF code of +conduct `_. + +License +======= + +All contributions after December 1, 2017 released under dual license - either `Apache 2.0 License `_ or the `BSD 3-Clause License `_. Contributions before December 1, 2017 - except those those explicitly relicensed - are released only under the BSD 3-Clause License. + + +.. _6B49 ACBA DCF6 BD1C A206 67AB CD54 FCE3 D964 BEFB: + https://pgp.mit.edu/pks/lookup?op=vindex&search=0xCD54FCE3D964BEFB diff --git a/parrot/lib/python3.10/site-packages/python_dateutil-2.9.0.post0.dist-info/RECORD b/parrot/lib/python3.10/site-packages/python_dateutil-2.9.0.post0.dist-info/RECORD new file mode 100644 index 0000000000000000000000000000000000000000..c76ba6962aff74746d889ebb9cb6cfca1f2a1abb --- /dev/null +++ b/parrot/lib/python3.10/site-packages/python_dateutil-2.9.0.post0.dist-info/RECORD @@ -0,0 +1,45 @@ +dateutil/__init__.py,sha256=Mqam67WO9IkTmUFyI66vS6IoSXTp9G388DadH2LCMLY,620 +dateutil/__pycache__/__init__.cpython-310.pyc,, +dateutil/__pycache__/_common.cpython-310.pyc,, +dateutil/__pycache__/_version.cpython-310.pyc,, +dateutil/__pycache__/easter.cpython-310.pyc,, +dateutil/__pycache__/relativedelta.cpython-310.pyc,, +dateutil/__pycache__/rrule.cpython-310.pyc,, +dateutil/__pycache__/tzwin.cpython-310.pyc,, +dateutil/__pycache__/utils.cpython-310.pyc,, +dateutil/_common.py,sha256=77w0yytkrxlYbSn--lDVPUMabUXRR9I3lBv_vQRUqUY,932 +dateutil/_version.py,sha256=BV031OxDDAmy58neUg5yyqLkLaqIw7ibK9As3jiMib0,166 +dateutil/easter.py,sha256=dyBi-lKvimH1u_k6p7Z0JJK72QhqVtVBsqByvpEPKvc,2678 +dateutil/parser/__init__.py,sha256=wWk6GFuxTpjoggCGtgkceJoti4pVjl4_fHQXpNOaSYg,1766 +dateutil/parser/__pycache__/__init__.cpython-310.pyc,, +dateutil/parser/__pycache__/_parser.cpython-310.pyc,, +dateutil/parser/__pycache__/isoparser.cpython-310.pyc,, +dateutil/parser/_parser.py,sha256=7klDdyicksQB_Xgl-3UAmBwzCYor1AIZqklIcT6dH_8,58796 +dateutil/parser/isoparser.py,sha256=8Fy999bnCd1frSdOYuOraWfJTtd5W7qQ51NwNuH_hXM,13233 +dateutil/relativedelta.py,sha256=IY_mglMjoZbYfrvloTY2ce02aiVjPIkiZfqgNTZRfuA,24903 +dateutil/rrule.py,sha256=KJzKlaCd1jEbu4A38ZltslaoAUh9nSbdbOFdjp70Kew,66557 +dateutil/tz/__init__.py,sha256=F-Mz13v6jYseklQf9Te9J6nzcLDmq47gORa61K35_FA,444 +dateutil/tz/__pycache__/__init__.cpython-310.pyc,, +dateutil/tz/__pycache__/_common.cpython-310.pyc,, +dateutil/tz/__pycache__/_factories.cpython-310.pyc,, +dateutil/tz/__pycache__/tz.cpython-310.pyc,, +dateutil/tz/__pycache__/win.cpython-310.pyc,, +dateutil/tz/_common.py,sha256=cgzDTANsOXvEc86cYF77EsliuSab8Puwpsl5-bX3_S4,12977 +dateutil/tz/_factories.py,sha256=unb6XQNXrPMveksTCU-Ag8jmVZs4SojoPUcAHpWnrvU,2569 +dateutil/tz/tz.py,sha256=EUnEdMfeThXiY6l4sh9yBabZ63_POzy01zSsh9thn1o,62855 +dateutil/tz/win.py,sha256=xJszWgSwE1xPx_HJj4ZkepyukC_hNy016WMcXhbRaB8,12935 +dateutil/tzwin.py,sha256=7Ar4vdQCnnM0mKR3MUjbIKsZrBVfHgdwsJZc_mGYRew,59 +dateutil/utils.py,sha256=dKCchEw8eObi0loGTx91unBxm_7UGlU3v_FjFMdqwYM,1965 +dateutil/zoneinfo/__init__.py,sha256=KYg0pthCMjcp5MXSEiBJn3nMjZeNZav7rlJw5-tz1S4,5889 +dateutil/zoneinfo/__pycache__/__init__.cpython-310.pyc,, +dateutil/zoneinfo/__pycache__/rebuild.cpython-310.pyc,, +dateutil/zoneinfo/dateutil-zoneinfo.tar.gz,sha256=0-pS57bpaN4NiE3xKIGTWW-pW4A9tPkqGCeac5gARHU,156400 +dateutil/zoneinfo/rebuild.py,sha256=MiqYzCIHvNbMH-LdRYLv-4T0EIA7hDKt5GLR0IRTLdI,2392 +python_dateutil-2.9.0.post0.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4 +python_dateutil-2.9.0.post0.dist-info/LICENSE,sha256=ugD1Gg2SgjtaHN4n2LW50jIeZ-2NqbwWPv-W1eF-V34,2889 +python_dateutil-2.9.0.post0.dist-info/METADATA,sha256=qdQ22jIr6AgzL5jYgyWZjofLaTpniplp_rTPrXKabpM,8354 +python_dateutil-2.9.0.post0.dist-info/RECORD,, +python_dateutil-2.9.0.post0.dist-info/REQUESTED,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +python_dateutil-2.9.0.post0.dist-info/WHEEL,sha256=-G_t0oGuE7UD0DrSpVZnq1hHMBV9DD2XkS5v7XpmTnk,110 +python_dateutil-2.9.0.post0.dist-info/top_level.txt,sha256=4tjdWkhRZvF7LA_BYe_L9gB2w_p2a-z5y6ArjaRkot8,9 +python_dateutil-2.9.0.post0.dist-info/zip-safe,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1 diff --git a/parrot/lib/python3.10/site-packages/python_dateutil-2.9.0.post0.dist-info/REQUESTED b/parrot/lib/python3.10/site-packages/python_dateutil-2.9.0.post0.dist-info/REQUESTED new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/parrot/lib/python3.10/site-packages/python_dateutil-2.9.0.post0.dist-info/WHEEL b/parrot/lib/python3.10/site-packages/python_dateutil-2.9.0.post0.dist-info/WHEEL new file mode 100644 index 0000000000000000000000000000000000000000..4724c45738f6ac125bb3a21787855562e6870440 --- /dev/null +++ b/parrot/lib/python3.10/site-packages/python_dateutil-2.9.0.post0.dist-info/WHEEL @@ -0,0 +1,6 @@ +Wheel-Version: 1.0 +Generator: bdist_wheel (0.42.0) +Root-Is-Purelib: true +Tag: py2-none-any +Tag: py3-none-any + diff --git a/parrot/lib/python3.10/site-packages/python_dateutil-2.9.0.post0.dist-info/top_level.txt b/parrot/lib/python3.10/site-packages/python_dateutil-2.9.0.post0.dist-info/top_level.txt new file mode 100644 index 0000000000000000000000000000000000000000..66501480ba5b63f98ee9a59c1f99e5e6917da6d9 --- /dev/null +++ b/parrot/lib/python3.10/site-packages/python_dateutil-2.9.0.post0.dist-info/top_level.txt @@ -0,0 +1 @@ +dateutil diff --git a/parrot/lib/python3.10/site-packages/python_dateutil-2.9.0.post0.dist-info/zip-safe b/parrot/lib/python3.10/site-packages/python_dateutil-2.9.0.post0.dist-info/zip-safe new file mode 100644 index 0000000000000000000000000000000000000000..8b137891791fe96927ad78e64b0aad7bded08bdc --- /dev/null +++ b/parrot/lib/python3.10/site-packages/python_dateutil-2.9.0.post0.dist-info/zip-safe @@ -0,0 +1 @@ + diff --git a/parrot/lib/python3.10/tkinter/__pycache__/__init__.cpython-310.pyc b/parrot/lib/python3.10/tkinter/__pycache__/__init__.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c4e738cb692541ea7aa3d6c8518dd74e2b74a842 --- /dev/null +++ b/parrot/lib/python3.10/tkinter/__pycache__/__init__.cpython-310.pyc @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b158d2aa89e34fa95e53e17d29794fb111f70a3d9b32e894074df6a257c5dd5c +size 169622