every libs/*.py and hooks/*.py now starts with a one-line module docstring; every bin/* script starts with a `# purpose:` header. discovery-by-`ls`-and-read instead of by index. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
15 lines
505 B
Python
15 lines
505 B
Python
"""wol: trigger a `wol-sleeper` waker node to run its configured wake command."""
|
|
|
|
from bundlewrap.utils.ui import io
|
|
from bundlewrap.utils.text import yellow, bold
|
|
|
|
def wake(node):
|
|
if node.has_bundle('wol-sleeper'):
|
|
io.stdout('{x} {node} waking up...'.format(
|
|
x=yellow('!'),
|
|
node=bold(node.name)
|
|
))
|
|
node\
|
|
.repo\
|
|
.get_node(node.metadata.get('wol-sleeper/waker'))\
|
|
.run(node.metadata.get('wol-sleeper/wake_command'))
|