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

Side by Side Diff: boto/utils.py

Issue 8669001: Pull in upstream boto from github at bcb719937de9ac2851e632d62b777352029a6d55 (Closed) Base URL: svn://svn.chromium.org/boto
Patch Set: Created 9 years 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
« no previous file with comments | « boto/storage_uri.py ('k') | tests/s3/mock_storage_service.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright (c) 2006-2010 Mitch Garnaat http://garnaat.org/ 1 # Copyright (c) 2006-2010 Mitch Garnaat http://garnaat.org/
2 # Copyright (c) 2010, Eucalyptus Systems, Inc. 2 # Copyright (c) 2010, Eucalyptus Systems, Inc.
3 # All rights reserved. 3 # All rights reserved.
4 # 4 #
5 # Permission is hereby granted, free of charge, to any person obtaining a 5 # Permission is hereby granted, free of charge, to any person obtaining a
6 # copy of this software and associated documentation files (the 6 # copy of this software and associated documentation files (the
7 # "Software"), to deal in the Software without restriction, including 7 # "Software"), to deal in the Software without restriction, including
8 # without limitation the rights to use, copy, modify, merge, publish, dis- 8 # without limitation the rights to use, copy, modify, merge, publish, dis-
9 # tribute, sublicense, and/or sell copies of the Software, and to permit 9 # tribute, sublicense, and/or sell copies of the Software, and to permit
10 # persons to whom the Software is furnished to do so, subject to the fol- 10 # persons to whom the Software is furnished to do so, subject to the fol-
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 58
59 59
60 try: 60 try:
61 import hashlib 61 import hashlib
62 _hashfn = hashlib.sha512 62 _hashfn = hashlib.sha512
63 except ImportError: 63 except ImportError:
64 import md5 64 import md5
65 _hashfn = md5.md5 65 _hashfn = md5.md5
66 66
67 # List of Query String Arguments of Interest 67 # List of Query String Arguments of Interest
68 qsa_of_interest = ['acl', 'location', 'logging', 'partNumber', 'policy', 68 qsa_of_interest = ['acl', 'defaultObjectAcl', 'location', 'logging',
69 'requestPayment', 'torrent', 'versioning', 'versionId', 69 'partNumber', 'policy', 'requestPayment', 'torrent',
70 'versions', 'website', 'uploads', 'uploadId', 70 'versioning', 'versionId', 'versions', 'website',
71 'response-content-type', 'response-content-language', 71 'uploads', 'uploadId', 'response-content-type',
72 'response-expires', 'reponse-cache-control', 72 'response-content-language', 'response-expires',
73 'response-content-disposition', 73 'reponse-cache-control', 'response-content-disposition',
74 'response-content-encoding'] 74 'response-content-encoding']
75 75
76 # generates the aws canonical string for the given parameters 76 # generates the aws canonical string for the given parameters
77 def canonical_string(method, path, headers, expires=None, 77 def canonical_string(method, path, headers, expires=None,
78 provider=None): 78 provider=None):
79 if not provider: 79 if not provider:
80 provider = boto.provider.get_default() 80 provider = boto.provider.get_default()
81 interesting_headers = {} 81 interesting_headers = {}
82 for key in headers: 82 for key in headers:
83 lk = key.lower() 83 lk = key.lower()
(...skipping 598 matching lines...) Expand 10 before | Expand all | Expand 10 after
682 '#upstart-job' : 'text/upstart-job', 682 '#upstart-job' : 'text/upstart-job',
683 '#part-handler' : 'text/part-handler', 683 '#part-handler' : 'text/part-handler',
684 '#cloud-boothook' : 'text/cloud-boothook' 684 '#cloud-boothook' : 'text/cloud-boothook'
685 } 685 }
686 rtype = deftype 686 rtype = deftype
687 for possible_type,mimetype in starts_with_mappings.items(): 687 for possible_type,mimetype in starts_with_mappings.items():
688 if content.startswith(possible_type): 688 if content.startswith(possible_type):
689 rtype = mimetype 689 rtype = mimetype
690 break 690 break
691 return(rtype) 691 return(rtype)
OLDNEW
« no previous file with comments | « boto/storage_uri.py ('k') | tests/s3/mock_storage_service.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698