Exemplo n.º 1
0
    def update_hooks(pid_file, pids):
        pids = ' '.join(pids)
        command = command_template + pids

        pid_file.seek(0)
        pid_file.truncate()
        pid_file.write(pids)
        pid_file.flush()

        for event in events:
            if pids:
                tmux_util.register_hook(event, command)
            else:
                tmux_util.unregister_hook(event)
Exemplo n.º 2
0
 def remove_hooks():
     """Removes the hooks registered by the outer function."""
     for event in events:
         tmux_util.unregister_hook(event)