Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(504)

Side by Side Diff: third_party/google_api_python_client/googleapiclient/http.py

Issue 1094533003: Revert of Upgrade 3rd packages (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 # Copyright 2014 Google Inc. All Rights Reserved. 1 # Copyright 2014 Google Inc. All Rights Reserved.
2 # 2 #
3 # Licensed under the Apache License, Version 2.0 (the "License"); 3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License. 4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at 5 # You may obtain a copy of the License at
6 # 6 #
7 # http://www.apache.org/licenses/LICENSE-2.0 7 # http://www.apache.org/licenses/LICENSE-2.0
8 # 8 #
9 # Unless required by applicable law or agreed to in writing, software 9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS, 10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and 12 # See the License for the specific language governing permissions and
13 # limitations under the License. 13 # limitations under the License.
14 14
15 """Classes to encapsulate a single HTTP request. 15 """Classes to encapsulate a single HTTP request.
16 16
17 The classes implement a command pattern, with every 17 The classes implement a command pattern, with every
18 object supporting an execute() method that does the 18 object supporting an execute() method that does the
19 actuall HTTP request. 19 actuall HTTP request.
20 """ 20 """
21 21
22 __author__ = 'jcgregorio@google.com (Joe Gregorio)' 22 __author__ = 'jcgregorio@google.com (Joe Gregorio)'
23 23
24 import StringIO 24 import StringIO
25 import base64 25 import base64
26 import copy 26 import copy
27 import gzip 27 import gzip
28 import httplib2
28 import json 29 import json
29 import logging 30 import logging
30 import mimeparse 31 import mimeparse
31 import mimetypes 32 import mimetypes
32 import os 33 import os
33 import random 34 import random
34 import sys 35 import sys
35 import time 36 import time
36 import urllib 37 import urllib
37 import urlparse 38 import urlparse
38 import uuid 39 import uuid
39 40
40 from email.generator import Generator 41 from email.generator import Generator
41 from email.mime.multipart import MIMEMultipart 42 from email.mime.multipart import MIMEMultipart
42 from email.mime.nonmultipart import MIMENonMultipart 43 from email.mime.nonmultipart import MIMENonMultipart
43 from email.parser import FeedParser 44 from email.parser import FeedParser
44 from errors import BatchError 45 from errors import BatchError
45 from errors import HttpError 46 from errors import HttpError
46 from errors import InvalidChunkSizeError 47 from errors import InvalidChunkSizeError
47 from errors import ResumableUploadError 48 from errors import ResumableUploadError
48 from errors import UnexpectedBodyError 49 from errors import UnexpectedBodyError
49 from errors import UnexpectedMethodError 50 from errors import UnexpectedMethodError
50 from model import JsonModel 51 from model import JsonModel
51 from third_party import httplib2 52 from ...oauth2client import util
52 from third_party.oauth2client import util
53 53
54 54
55 DEFAULT_CHUNK_SIZE = 512*1024 55 DEFAULT_CHUNK_SIZE = 512*1024
56 56
57 MAX_URI_LENGTH = 2048 57 MAX_URI_LENGTH = 2048
58 58
59 59
60 class MediaUploadProgress(object): 60 class MediaUploadProgress(object):
61 """Status of a resumable upload.""" 61 """Status of a resumable upload."""
62 62
(...skipping 1542 matching lines...) Expand 10 before | Expand all | Expand 10 after
1605 logging.warning( 1605 logging.warning(
1606 'OAuth 1.0 request made with Credentials after tunnel_patch.') 1606 'OAuth 1.0 request made with Credentials after tunnel_patch.')
1607 headers['x-http-method-override'] = "PATCH" 1607 headers['x-http-method-override'] = "PATCH"
1608 method = 'POST' 1608 method = 'POST'
1609 resp, content = request_orig(uri, method, body, headers, 1609 resp, content = request_orig(uri, method, body, headers,
1610 redirections, connection_type) 1610 redirections, connection_type)
1611 return resp, content 1611 return resp, content
1612 1612
1613 http.request = new_request 1613 http.request = new_request
1614 return http 1614 return http
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698