Commit 5f5ae14
committed
BaseProxyObject: lazily introspect children as needed
The D-Bus specification says:
“If a child <node> has any sub-elements, then they must represent a
complete introspection of the child. If a child <node> is empty, then
it may or may not have sub-elements; the child must be introspected
in order to find out. The intent is that if an object knows that its
children are "fast" to introspect it can go ahead and return their
information, but otherwise it can omit it.”
However, BaseProxyObject.get_children() has been assuming that all child
<node> elements provide a complete introspection of their corresponding
child objects. This causes child objects to appear to have no interfaces
or children of their own, even when they in fact do.
To implement the spec, replace BaseProxyObject.introspection with a
lazily-computed property whose value is initialized as the intr.Node
passed to the BaseProxyObject constructor (or parsed by it), if one was
specified, or is otherwise computed upon first use by introspecting the
child object (synchronously). The synchronous introspection required
pulling the introspect_sync method up from glib.MessageBus into
BaseMessageBus as an abstract method and then implementing it in
aio.MessageBus by using asyncio.loop.run_until_complete(…).1 parent d39fd5d commit 5f5ae14
File tree
6 files changed
+53
-12
lines changed- src/dbus_fast
- aio
- glib
- tests
6 files changed
+53
-12
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
318 | 318 | | |
319 | 319 | | |
320 | 320 | | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
321 | 331 | | |
322 | 332 | | |
323 | 333 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
195 | 195 | | |
196 | 196 | | |
197 | 197 | | |
198 | | - | |
| 198 | + | |
199 | 199 | | |
200 | 200 | | |
201 | 201 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
307 | 307 | | |
308 | 308 | | |
309 | 309 | | |
310 | | - | |
| 310 | + | |
311 | 311 | | |
312 | 312 | | |
313 | 313 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
309 | 309 | | |
310 | 310 | | |
311 | 311 | | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
312 | 315 | | |
313 | 316 | | |
314 | 317 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
234 | 234 | | |
235 | 235 | | |
236 | 236 | | |
| 237 | + | |
| 238 | + | |
237 | 239 | | |
238 | 240 | | |
239 | 241 | | |
| |||
252 | 254 | | |
253 | 255 | | |
254 | 256 | | |
255 | | - | |
| 257 | + | |
256 | 258 | | |
257 | 259 | | |
258 | 260 | | |
| |||
264 | 266 | | |
265 | 267 | | |
266 | 268 | | |
267 | | - | |
268 | | - | |
| 269 | + | |
| 270 | + | |
269 | 271 | | |
270 | | - | |
| 272 | + | |
271 | 273 | | |
272 | | - | |
| 274 | + | |
273 | 275 | | |
274 | 276 | | |
275 | 277 | | |
| |||
279 | 281 | | |
280 | 282 | | |
281 | 283 | | |
282 | | - | |
| 284 | + | |
283 | 285 | | |
284 | 286 | | |
285 | 287 | | |
286 | 288 | | |
287 | 289 | | |
288 | 290 | | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
289 | 317 | | |
290 | 318 | | |
291 | 319 | | |
| |||
352 | 380 | | |
353 | 381 | | |
354 | 382 | | |
355 | | - | |
| 383 | + | |
| 384 | + | |
356 | 385 | | |
357 | 386 | | |
358 | 387 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
| 13 | + | |
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| |||
200 | 200 | | |
201 | 201 | | |
202 | 202 | | |
203 | | - | |
| 203 | + | |
204 | 204 | | |
205 | 205 | | |
206 | 206 | | |
| |||
254 | 254 | | |
255 | 255 | | |
256 | 256 | | |
257 | | - | |
258 | 257 | | |
259 | 258 | | |
260 | 259 | | |
| |||
0 commit comments