factory
factory
¶
Session-bus probing factory + the no-op fallback notifier.
Thin convenience: try a real DbusNotifier,
fall back to a NullNotifier if no
session bus is reachable. Lives at the same layer as the concrete
backends so CLI / consumer code can reach it without importing the
package root (which causes a layering circularity — interface → interface).
The no-op NullNotifier is co-located here because it has no
state of its own and the factory is its only constructor in
production code — keeping both in one module reduces the notifier
surface to factory + desktop + protocol + callback instead of
five files.
NullNotifier
¶
Silent fallback that satisfies the Notifier protocol.
Every method is a no-op. notify always returns 0. Every
method accepts **_ rather than spelling each protocol parameter:
the no-op fallback discards every argument and the duck-typed match
against Notifier
is what matters at call sites, not the impl signature.
create_notifier(app_name='terok')
async
¶
Return a connected DbusNotifier, or a NullNotifier on failure.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
app_name
|
str
|
Application name sent with every notification. |
'terok'
|
Returns:
| Type | Description |
|---|---|
Notifier
|
A |