- Pass this method the 2-tuple returned by httplib2.Http.request. It
- returns True if the response indicates success, None if it indicates
- temporary failure, and False otherwise. You can use this as the
+ def attempts_str(self):
+ """Human-readable attempts(): 'N attempts' or '1 attempt'"""
+ if self._attempts == 1:
+ return '1 attempt'
+ else:
+ return '{} attempts'.format(self._attempts)
+
+
+def check_http_response_success(status_code):
+ """Convert an HTTP status code to a loop control flag.
+
+ Pass this method a numeric HTTP status code. It returns True if
+ the code indicates success, None if it indicates temporary
+ failure, and False otherwise. You can use this as the