Keep configs in ~/.config/build-release/ and tool state in ~/.local/state/build-release/, under XDG_* where set
CI / tests (pull_request) Successful in 6m34s
CI / tests (pull_request) Successful in 6m34s
This commit is contained in:
@@ -43,18 +43,18 @@ def sender_of(project: ProjectConfig, backends: typing.Mapping[Notifier, Backend
|
||||
return lambda message: backend.send(config, message, backend.http)
|
||||
|
||||
|
||||
def notify(text: str, directory: str | None, home: pathlib.Path, backends: typing.Mapping[Notifier, Backend[typing.Any]]) -> Failure | None:
|
||||
def notify(text: str, directory: str | None, home: pathlib.Path, env: typing.Mapping[str, str], backends: typing.Mapping[Notifier, Backend[typing.Any]]) -> Failure | None:
|
||||
"""Sends text through the notifier of the project whose checkout holds directory.
|
||||
|
||||
The DM is skipped where the config names no notifier, since the project hasn't asked for DMs. It is skipped too where no config can be read: build-release has stopped with that reason, and without a config there is no notifier to ask."""
|
||||
project = located(directory, home)
|
||||
project = located(directory, home, env)
|
||||
if isinstance(project, Failure) or project.notifier is None:
|
||||
return None
|
||||
sender = sender_of(project, backends)
|
||||
return sender if isinstance(sender, Failure) else sender(text)
|
||||
|
||||
|
||||
def sender_in(directory: str | None, home: pathlib.Path, backends: typing.Mapping[Notifier, Backend[typing.Any]]) -> Sender | Failure:
|
||||
def sender_in(directory: str | None, home: pathlib.Path, env: typing.Mapping[str, str], backends: typing.Mapping[Notifier, Backend[typing.Any]]) -> Sender | Failure:
|
||||
"""sender_of the project whose checkout holds directory."""
|
||||
project = located(directory, home)
|
||||
project = located(directory, home, env)
|
||||
return project if isinstance(project, Failure) else sender_of(project, backends)
|
||||
|
||||
Reference in New Issue
Block a user