MCPcopy Create free account
hub / github.com/celery/celery / callback

Method callback

celery/events/cursesmon.py:193–216  ·  view source on GitHub ↗
(my, mx, xs)

Source from the content-addressed store, hash-verified

191 def alert_remote_control_reply(self, reply):
192
193 def callback(my, mx, xs):
194 y = count(xs)
195 if not reply:
196 self.win.addstr(
197 next(y), 3, 'No replies received in 1s deadline.',
198 curses.A_BOLD + curses.color_pair(2),
199 )
200 return
201
202 for subreply in reply:
203 curline = next(y)
204
205 host, response = next(subreply.items())
206 host = f'{host}: '
207 self.win.addstr(curline, 3, host, curses.A_BOLD)
208 attr = curses.A_NORMAL
209 text = ''
210 if 'error' in response:
211 text = response['error']
212 attr |= curses.color_pair(2)
213 elif 'ok' in response:
214 text = response['ok']
215 attr |= curses.color_pair(3)
216 self.win.addstr(curline, 3 + len(host), text, attr)
217
218 return self.alert(callback, 'Remote Control Command Replies')
219

Callers 1

dataMethod · 0.45

Calls 1

itemsMethod · 0.45

Tested by

no test coverage detected