ptdata 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (64) hide show
  1. ptdata-0.1.0/.gitignore +19 -0
  2. ptdata-0.1.0/.v/lib/python3.13/site-packages/build-1.6.1.dist-info/licenses/LICENSE +20 -0
  3. ptdata-0.1.0/.v/lib/python3.13/site-packages/certifi/tests/__init__.py +0 -0
  4. ptdata-0.1.0/.v/lib/python3.13/site-packages/certifi/tests/test_certify.py +18 -0
  5. ptdata-0.1.0/.v/lib/python3.13/site-packages/certifi-2026.11.20.dist-info/licenses/LICENSE +20 -0
  6. ptdata-0.1.0/.v/lib/python3.13/site-packages/cffi-2.1.1.dist-info/licenses/LICENSE +23 -0
  7. ptdata-0.1.0/.v/lib/python3.13/site-packages/charset_normalizer-3.5.3.dist-info/licenses/LICENSE +21 -0
  8. ptdata-0.1.0/.v/lib/python3.13/site-packages/cryptography-50.0.2.dist-info/licenses/LICENSE +3 -0
  9. ptdata-0.1.0/.v/lib/python3.13/site-packages/id-1.6.1.dist-info/licenses/LICENSE +202 -0
  10. ptdata-0.1.0/.v/lib/python3.13/site-packages/jaraco.classes-3.4.0.dist-info/LICENSE +17 -0
  11. ptdata-0.1.0/.v/lib/python3.13/site-packages/jaraco_context-6.1.2.dist-info/licenses/LICENSE +18 -0
  12. ptdata-0.1.0/.v/lib/python3.13/site-packages/jaraco_functools-4.6.0.dist-info/licenses/LICENSE +18 -0
  13. ptdata-0.1.0/.v/lib/python3.13/site-packages/jeepney/io/tests/__init__.py +0 -0
  14. ptdata-0.1.0/.v/lib/python3.13/site-packages/jeepney/io/tests/conftest.py +81 -0
  15. ptdata-0.1.0/.v/lib/python3.13/site-packages/jeepney/io/tests/test_asyncio.py +95 -0
  16. ptdata-0.1.0/.v/lib/python3.13/site-packages/jeepney/io/tests/test_blocking.py +84 -0
  17. ptdata-0.1.0/.v/lib/python3.13/site-packages/jeepney/io/tests/test_threading.py +83 -0
  18. ptdata-0.1.0/.v/lib/python3.13/site-packages/jeepney/io/tests/test_trio.py +114 -0
  19. ptdata-0.1.0/.v/lib/python3.13/site-packages/jeepney/io/tests/utils.py +3 -0
  20. ptdata-0.1.0/.v/lib/python3.13/site-packages/jeepney/tests/__init__.py +0 -0
  21. ptdata-0.1.0/.v/lib/python3.13/site-packages/jeepney/tests/secrets_introspect.xml +116 -0
  22. ptdata-0.1.0/.v/lib/python3.13/site-packages/jeepney/tests/test_auth.py +24 -0
  23. ptdata-0.1.0/.v/lib/python3.13/site-packages/jeepney/tests/test_bindgen.py +28 -0
  24. ptdata-0.1.0/.v/lib/python3.13/site-packages/jeepney/tests/test_bus.py +24 -0
  25. ptdata-0.1.0/.v/lib/python3.13/site-packages/jeepney/tests/test_bus_messages.py +112 -0
  26. ptdata-0.1.0/.v/lib/python3.13/site-packages/jeepney/tests/test_fds.py +80 -0
  27. ptdata-0.1.0/.v/lib/python3.13/site-packages/jeepney/tests/test_low_level.py +101 -0
  28. ptdata-0.1.0/.v/lib/python3.13/site-packages/jeepney/tests/test_wrappers.py +74 -0
  29. ptdata-0.1.0/.v/lib/python3.13/site-packages/jeepney-0.9.0.dist-info/licenses/LICENSE +21 -0
  30. ptdata-0.1.0/.v/lib/python3.13/site-packages/keyring-25.7.0.dist-info/licenses/LICENSE +18 -0
  31. ptdata-0.1.0/.v/lib/python3.13/site-packages/markdown_it_py-4.3.0.dist-info/licenses/LICENSE +21 -0
  32. ptdata-0.1.0/.v/lib/python3.13/site-packages/mdurl-0.1.2.dist-info/LICENSE +46 -0
  33. ptdata-0.1.0/.v/lib/python3.13/site-packages/more_itertools-11.2.1.dist-info/licenses/LICENSE +19 -0
  34. ptdata-0.1.0/.v/lib/python3.13/site-packages/nh3-0.3.8.dist-info/licenses/LICENSE +21 -0
  35. ptdata-0.1.0/.v/lib/python3.13/site-packages/packaging-26.3.dist-info/licenses/LICENSE +3 -0
  36. ptdata-0.1.0/.v/lib/python3.13/site-packages/pycparser-3.12.dist-info/licenses/LICENSE +27 -0
  37. ptdata-0.1.0/.v/lib/python3.13/site-packages/pygments-2.21.0.dist-info/licenses/LICENSE +25 -0
  38. ptdata-0.1.0/.v/lib/python3.13/site-packages/pyproject_hooks-1.3.3.dist-info/licenses/LICENSE +21 -0
  39. ptdata-0.1.0/.v/lib/python3.13/site-packages/readme_renderer-46.0.dist-info/licenses/LICENSE +174 -0
  40. ptdata-0.1.0/.v/lib/python3.13/site-packages/requests-2.34.2.dist-info/licenses/LICENSE +175 -0
  41. ptdata-0.1.0/.v/lib/python3.13/site-packages/requests_toolbelt-1.0.0.dist-info/LICENSE +13 -0
  42. ptdata-0.1.0/.v/lib/python3.13/site-packages/rfc3986-2.0.0.dist-info/LICENSE +13 -0
  43. ptdata-0.1.0/.v/lib/python3.13/site-packages/rich-15.0.0.dist-info/licenses/LICENSE +19 -0
  44. ptdata-0.1.0/.v/lib/python3.13/site-packages/secretstorage-3.5.0.dist-info/licenses/LICENSE +25 -0
  45. ptdata-0.1.0/.v/lib/python3.13/site-packages/twine-7.0.0.dist-info/licenses/LICENSE +174 -0
  46. ptdata-0.1.0/LICENSE +21 -0
  47. ptdata-0.1.0/PKG-INFO +192 -0
  48. ptdata-0.1.0/README.md +169 -0
  49. ptdata-0.1.0/REPORT.md +87 -0
  50. ptdata-0.1.0/examples/look_ahead_fy2017.py +150 -0
  51. ptdata-0.1.0/pyproject.toml +57 -0
  52. ptdata-0.1.0/src/ptdata/__init__.py +25 -0
  53. ptdata-0.1.0/src/ptdata/_version.py +3 -0
  54. ptdata-0.1.0/src/ptdata/client.py +432 -0
  55. ptdata-0.1.0/src/ptdata/exceptions.py +62 -0
  56. ptdata-0.1.0/src/ptdata/frames.py +157 -0
  57. ptdata-0.1.0/src/ptdata/models.py +427 -0
  58. ptdata-0.1.0/tests/__init__.py +0 -0
  59. ptdata-0.1.0/tests/bodies.py +126 -0
  60. ptdata-0.1.0/tests/conftest.py +25 -0
  61. ptdata-0.1.0/tests/fakes.py +34 -0
  62. ptdata-0.1.0/tests/test_client.py +396 -0
  63. ptdata-0.1.0/tests/test_frames.py +136 -0
  64. ptdata-0.1.0/tests/test_live.py +26 -0
@@ -0,0 +1,19 @@
1
+ .env
2
+ .env.*
3
+ .venv/
4
+ venv/
5
+ __pycache__/
6
+ *.py[cod]
7
+ *.egg-info/
8
+ .eggs/
9
+ dist/
10
+ build/
11
+ .cache/
12
+ examples/.cache/
13
+ .pytest_cache/
14
+ .mypy_cache/
15
+ .ruff_cache/
16
+ .coverage
17
+ htmlcov/
18
+ *.tmp
19
+ *.json.tmp
@@ -0,0 +1,20 @@
1
+ Copyright © 2019 Filipe Laíns <filipe.lains@gmail.com>
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining a
4
+ copy of this software and associated documentation files (the "Software"),
5
+ to deal in the Software without restriction, including without limitation
6
+ the rights to use, copy, modify, merge, publish, distribute, sublicense,
7
+ and/or sell copies of the Software, and to permit persons to whom the
8
+ Software is furnished to do so, subject to the following conditions:
9
+
10
+ The above copyright notice and this permission notice (including the next
11
+ paragraph) shall be included in all copies or substantial portions of the
12
+ Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17
+ THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20
+ DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,18 @@
1
+ import os
2
+ import unittest
3
+
4
+ import certifi
5
+
6
+
7
+ class TestCertifi(unittest.TestCase):
8
+ def test_cabundle_exists(self) -> None:
9
+ assert os.path.exists(certifi.where())
10
+
11
+ def test_read_contents(self) -> None:
12
+ content = certifi.contents()
13
+ assert "-----BEGIN CERTIFICATE-----" in content
14
+
15
+ def test_py_typed_exists(self) -> None:
16
+ assert os.path.exists(
17
+ os.path.join(os.path.dirname(certifi.__file__), 'py.typed')
18
+ )
@@ -0,0 +1,20 @@
1
+ This package contains a modified version of ca-bundle.crt:
2
+
3
+ ca-bundle.crt -- Bundle of CA Root Certificates
4
+
5
+ This is a bundle of X.509 certificates of public Certificate Authorities
6
+ (CA). These were automatically extracted from Mozilla's root certificates
7
+ file (certdata.txt). This file can be found in the mozilla source tree:
8
+ https://hg.mozilla.org/mozilla-central/file/tip/security/nss/lib/ckfw/builtins/certdata.txt
9
+ It contains the certificates in PEM format and therefore
10
+ can be directly used with curl / libcurl / php_curl, or with
11
+ an Apache+mod_ssl webserver for SSL client authentication.
12
+ Just configure this file as the SSLCACertificateFile.#
13
+
14
+ ***** BEGIN LICENSE BLOCK *****
15
+ This Source Code Form is subject to the terms of the Mozilla Public License,
16
+ v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain
17
+ one at http://mozilla.org/MPL/2.0/.
18
+
19
+ ***** END LICENSE BLOCK *****
20
+ @(#) $RCSfile: certdata.txt,v $ $Revision: 1.80 $ $Date: 2011/11/03 15:11:58 $
@@ -0,0 +1,23 @@
1
+
2
+ Except when otherwise stated (look for LICENSE files in directories or
3
+ information at the beginning of each file) all software and
4
+ documentation is licensed as follows:
5
+
6
+ MIT No Attribution
7
+
8
+ Permission is hereby granted, free of charge, to any person
9
+ obtaining a copy of this software and associated documentation
10
+ files (the "Software"), to deal in the Software without
11
+ restriction, including without limitation the rights to use,
12
+ copy, modify, merge, publish, distribute, sublicense, and/or
13
+ sell copies of the Software, and to permit persons to whom the
14
+ Software is furnished to do so.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
17
+ OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19
+ THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22
+ DEALINGS IN THE SOFTWARE.
23
+
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 TAHRI Ahmed R.
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,3 @@
1
+ This software is made available under the terms of *either* of the licenses
2
+ found in LICENSE.APACHE or LICENSE.BSD. Contributions to cryptography are made
3
+ under the terms of *both* these licenses.
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
@@ -0,0 +1,17 @@
1
+ Permission is hereby granted, free of charge, to any person obtaining a copy
2
+ of this software and associated documentation files (the "Software"), to
3
+ deal in the Software without restriction, including without limitation the
4
+ rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
5
+ sell copies of the Software, and to permit persons to whom the Software is
6
+ furnished to do so, subject to the following conditions:
7
+
8
+ The above copyright notice and this permission notice shall be included in
9
+ all copies or substantial portions of the Software.
10
+
11
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
12
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
13
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
14
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
15
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
16
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
17
+ IN THE SOFTWARE.
@@ -0,0 +1,18 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 <copyright holders>
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
6
+ associated documentation files (the "Software"), to deal in the Software without restriction, including
7
+ without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the
9
+ following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be included in all copies or substantial
12
+ portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
15
+ LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO
16
+ EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
17
+ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
18
+ USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,18 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 <copyright holders>
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
6
+ associated documentation files (the "Software"), to deal in the Software without restriction, including
7
+ without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the
9
+ following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be included in all copies or substantial
12
+ portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
15
+ LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO
16
+ EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
17
+ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
18
+ USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,81 @@
1
+ from tempfile import TemporaryFile
2
+ import threading
3
+
4
+ import pytest
5
+
6
+ from jeepney import (
7
+ DBusAddress, HeaderFields, message_bus, MessageType, new_error,
8
+ new_method_return,
9
+ )
10
+ from jeepney.io.threading import open_dbus_connection, DBusRouter, Proxy
11
+
12
+ @pytest.fixture()
13
+ def respond_with_fd():
14
+ name = "io.gitlab.takluyver.jeepney.tests.respond_with_fd"
15
+ addr = DBusAddress(bus_name=name, object_path='/')
16
+
17
+ with open_dbus_connection(bus='SESSION', enable_fds=True) as conn:
18
+ with DBusRouter(conn) as router:
19
+ status, = Proxy(message_bus, router).RequestName(name)
20
+ assert status == 1 # DBUS_REQUEST_NAME_REPLY_PRIMARY_OWNER
21
+
22
+ def _reply_once():
23
+ while True:
24
+ msg = conn.receive()
25
+ if msg.header.message_type is MessageType.method_call:
26
+ if msg.header.fields[HeaderFields.member] == 'GetFD':
27
+ with TemporaryFile('w+') as tf:
28
+ tf.write('readme')
29
+ tf.seek(0)
30
+ rep = new_method_return(msg, 'h', (tf,))
31
+ conn.send(rep)
32
+ return
33
+ else:
34
+ conn.send(new_error(msg, 'NoMethod'))
35
+
36
+ reply_thread = threading.Thread(target=_reply_once, daemon=True)
37
+ reply_thread.start()
38
+ yield addr
39
+
40
+ reply_thread.join()
41
+
42
+
43
+ @pytest.fixture()
44
+ def read_from_fd():
45
+ name = "io.gitlab.takluyver.jeepney.tests.read_from_fd"
46
+ addr = DBusAddress(bus_name=name, object_path='/')
47
+
48
+ with open_dbus_connection(bus='SESSION', enable_fds=True) as conn:
49
+ with DBusRouter(conn) as router:
50
+ status, = Proxy(message_bus, router).RequestName(name)
51
+ assert status == 1 # DBUS_REQUEST_NAME_REPLY_PRIMARY_OWNER
52
+
53
+ def _reply_once():
54
+ while True:
55
+ msg = conn.receive()
56
+ if msg.header.message_type is MessageType.method_call:
57
+ if msg.header.fields[HeaderFields.member] == 'ReadFD':
58
+ with msg.body[0].to_file('rb') as f:
59
+ f.seek(0)
60
+ b = f.read()
61
+ conn.send(new_method_return(msg, 'ay', (b,)))
62
+ return
63
+ else:
64
+ conn.send(new_error(msg, 'NoMethod'))
65
+
66
+ reply_thread = threading.Thread(target=_reply_once, daemon=True)
67
+ reply_thread.start()
68
+ yield addr
69
+
70
+ reply_thread.join()
71
+
72
+
73
+ @pytest.fixture()
74
+ def temp_file_and_contents():
75
+ data = b'abc123'
76
+ with TemporaryFile('w+b') as tf:
77
+ tf.write(data)
78
+ tf.flush()
79
+ tf.seek(0)
80
+ yield tf, data
81
+
@@ -0,0 +1,95 @@
1
+ import asyncio
2
+ import sys
3
+
4
+ if sys.version_info >= (3, 11):
5
+ from asyncio import timeout
6
+ else:
7
+ from async_timeout import timeout
8
+ import pytest
9
+ import pytest_asyncio
10
+
11
+ from jeepney import DBusAddress, new_method_call
12
+ from jeepney.bus_messages import message_bus, MatchRule
13
+ from jeepney.io.asyncio import (
14
+ open_dbus_connection, open_dbus_router, Proxy
15
+ )
16
+ from .utils import have_session_bus
17
+
18
+ pytestmark = [
19
+ pytest.mark.asyncio,
20
+ pytest.mark.skipif(
21
+ not have_session_bus, reason="Tests require DBus session bus"
22
+ ),
23
+ ]
24
+
25
+ bus_peer = DBusAddress(
26
+ bus_name='org.freedesktop.DBus',
27
+ object_path='/org/freedesktop/DBus',
28
+ interface='org.freedesktop.DBus.Peer'
29
+ )
30
+
31
+
32
+ @pytest_asyncio.fixture()
33
+ async def connection():
34
+ async with (await open_dbus_connection(bus='SESSION')) as conn:
35
+ yield conn
36
+
37
+ async def test_connect(connection):
38
+ assert connection.unique_name.startswith(':')
39
+
40
+ @pytest_asyncio.fixture()
41
+ async def router():
42
+ async with open_dbus_router(bus='SESSION') as router:
43
+ yield router
44
+
45
+ async def test_send_and_get_reply(router):
46
+ ping_call = new_method_call(bus_peer, 'Ping')
47
+ reply = await asyncio.wait_for(
48
+ router.send_and_get_reply(ping_call), timeout=5
49
+ )
50
+ assert reply.body == ()
51
+
52
+ async def test_proxy(router):
53
+ proxy = Proxy(message_bus, router)
54
+ name = "io.gitlab.takluyver.jeepney.examples.Server"
55
+ res = await proxy.RequestName(name)
56
+ assert res in {(1,), (2,)} # 1: got the name, 2: queued
57
+
58
+ has_owner, = await proxy.NameHasOwner(name)
59
+ assert has_owner is True
60
+
61
+ async def test_filter(router):
62
+ bus = Proxy(message_bus, router)
63
+ name = "io.gitlab.takluyver.jeepney.tests.asyncio_test_filter"
64
+
65
+ match_rule = MatchRule(
66
+ type="signal",
67
+ sender=message_bus.bus_name,
68
+ interface=message_bus.interface,
69
+ member="NameOwnerChanged",
70
+ path=message_bus.object_path,
71
+ )
72
+ match_rule.add_arg_condition(0, name)
73
+
74
+ # Ask the message bus to subscribe us to this signal
75
+ await bus.AddMatch(match_rule)
76
+
77
+ with router.filter(match_rule) as queue:
78
+ res, = await bus.RequestName(name)
79
+ assert res == 1 # 1: got the name
80
+
81
+ signal_msg = await asyncio.wait_for(queue.get(), timeout=2.0)
82
+ assert signal_msg.body == (name, '', router.unique_name)
83
+
84
+ async def test_recv_after_connect():
85
+ # Can't use here:
86
+ # 1. 'connection' fixture
87
+ # 2. asyncio.wait_for()
88
+ # If (1) and/or (2) is used, the error won't be triggered.
89
+ conn = await open_dbus_connection(bus='SESSION')
90
+ try:
91
+ with pytest.raises(asyncio.TimeoutError):
92
+ async with timeout(0):
93
+ await conn.receive()
94
+ finally:
95
+ await conn.close()
@@ -0,0 +1,84 @@
1
+ import pytest
2
+
3
+ from jeepney import new_method_call, MessageType, DBusAddress
4
+ from jeepney.bus_messages import message_bus, MatchRule
5
+ from jeepney.io.blocking import open_dbus_connection, Proxy
6
+ from .utils import have_session_bus
7
+
8
+ pytestmark = pytest.mark.skipif(
9
+ not have_session_bus, reason="Tests require DBus session bus"
10
+ )
11
+
12
+ @pytest.fixture
13
+ def session_conn():
14
+ with open_dbus_connection(bus='SESSION') as conn:
15
+ yield conn
16
+
17
+
18
+ def test_connect(session_conn):
19
+ assert session_conn.unique_name.startswith(':')
20
+
21
+ bus_peer = DBusAddress(
22
+ bus_name='org.freedesktop.DBus',
23
+ object_path='/org/freedesktop/DBus',
24
+ interface='org.freedesktop.DBus.Peer'
25
+ )
26
+
27
+ def test_send_and_get_reply(session_conn):
28
+ ping_call = new_method_call(bus_peer, 'Ping')
29
+ reply = session_conn.send_and_get_reply(ping_call, timeout=5)
30
+ assert reply.header.message_type == MessageType.method_return
31
+ assert reply.body == ()
32
+
33
+ def test_proxy(session_conn):
34
+ proxy = Proxy(message_bus, session_conn, timeout=5)
35
+ name = "io.gitlab.takluyver.jeepney.examples.Server"
36
+ res = proxy.RequestName(name)
37
+ assert res in {(1,), (2,)} # 1: got the name, 2: queued
38
+
39
+ has_owner, = proxy.NameHasOwner(name, _timeout=3)
40
+ assert has_owner is True
41
+
42
+ def test_filter(session_conn):
43
+ bus = Proxy(message_bus, session_conn)
44
+ name = "io.gitlab.takluyver.jeepney.tests.blocking_test_filter"
45
+
46
+ match_rule = MatchRule(
47
+ type="signal",
48
+ sender=message_bus.bus_name,
49
+ interface=message_bus.interface,
50
+ member="NameOwnerChanged",
51
+ path=message_bus.object_path,
52
+ )
53
+ match_rule.add_arg_condition(0, name)
54
+
55
+ # Ask the message bus to subscribe us to this signal
56
+ bus.AddMatch(match_rule)
57
+
58
+ with session_conn.filter(match_rule) as matches:
59
+ res, = bus.RequestName(name)
60
+ assert res == 1 # 1: got the name
61
+
62
+ signal_msg = session_conn.recv_until_filtered(matches, timeout=2)
63
+
64
+ assert signal_msg.body == (name, '', session_conn.unique_name)
65
+
66
+
67
+ def test_recv_fd(respond_with_fd):
68
+ getfd_call = new_method_call(respond_with_fd, 'GetFD')
69
+ with open_dbus_connection(bus='SESSION', enable_fds=True) as conn:
70
+ reply = conn.send_and_get_reply(getfd_call, timeout=5)
71
+
72
+ assert reply.header.message_type is MessageType.method_return
73
+ with reply.body[0].to_file('w+') as f:
74
+ assert f.read() == 'readme'
75
+
76
+
77
+ def test_send_fd(temp_file_and_contents, read_from_fd):
78
+ temp_file, data = temp_file_and_contents
79
+ readfd_call = new_method_call(read_from_fd, 'ReadFD', 'h', (temp_file,))
80
+ with open_dbus_connection(bus='SESSION', enable_fds=True) as conn:
81
+ reply = conn.send_and_get_reply(readfd_call, timeout=5)
82
+
83
+ assert reply.header.message_type is MessageType.method_return
84
+ assert reply.body[0] == data