| 71 | |
| 72 | |
| 73 | def _HandlePollResponse( response, diagnostics_handler ): |
| 74 | if isinstance( response, list ): |
| 75 | for notification in response: |
| 76 | if 'message' in notification: |
| 77 | PostVimMessage( notification[ 'message' ], |
| 78 | warning = False, |
| 79 | truncate = True ) |
| 80 | elif 'diagnostics' in notification: |
| 81 | diagnostics_handler.UpdateWithNewDiagnosticsForFile( |
| 82 | notification[ 'filepath' ], |
| 83 | notification[ 'diagnostics' ] ) |
| 84 | elif response is False: |
| 85 | # Don't keep polling for this file |
| 86 | return False |
| 87 | # else any truthy response means "nothing to see here; poll again in a |
| 88 | # while" |
| 89 | |
| 90 | # Start the next poll (only if the last poll didn't raise an exception) |
| 91 | return True |