Permalink
Browse files

style fixups

  • Loading branch information...
1 parent 50e7068 commit 86c5ef7a9b5948862d40e195d8f306f442a74930 @shawnps committed Aug 7, 2012
Showing with 6 additions and 6 deletions.
  1. +6 −6 libcloud/storage/drivers/cloudfiles.py
@@ -517,19 +517,19 @@ def ex_get_container_temp_url(self, container, method, timeout=60):
path = self.connection.request_path + '/' + container.name
try:
key = self.ex_get_meta_data()['temp_url_key']
- assert(key != None)
+ assert key is not None
except:
raise KeyError("You must first set the \
X-Account-Meta-Temp-URL-Key header on your \
Cloud Files account using \
ex_set_account_metadata_temp_url_key before \
you can use this method.")
- hmac_body = "%s\n%s\n%s" % (method, expires, path)
+ hmac_body = '%s\n%s\n%s' % (method, expires, path)
sig = hmac.new(key, hmac_body, sha1).hexdigest()
params = urllib.urlencode({'temp_url_sig': sig,
'temp_url_expires': expires})
- temp_url = "https://%s/%s?%s" % \
+ temp_url = 'https://%s/%s?%s' % \
(self.connection.host + self.connection.request_path,
container.name, params)
@@ -556,19 +556,19 @@ def ex_get_object_temp_url(self, obj, method, timeout=60):
obj.container.name, obj.name)
try:
key = self.ex_get_meta_data()['temp_url_key']
- assert(key != None)
+ assert key is not None
except:
raise KeyError("You must first set the \
X-Account-Meta-Temp-URL-Key header on your \
Cloud Files account using \
ex_set_account_metadata_temp_url_key before \
you can use this method.")
- hmac_body = "%s\n%s\n%s" % (method, expires, path)
+ hmac_body = '%s\n%s\n%s' % (method, expires, path)
sig = hmac.new(key, hmac_body, sha1).hexdigest()
params = urllib.urlencode({'temp_url_sig': sig,
'temp_url_expires': expires})
- temp_url = "https://%s/%s/%s?%s" % \
+ temp_url = 'https://%s/%s/%s?%s' % \
(self.connection.host + self.connection.request_path,
obj.container.name, obj.name, params)

0 comments on commit 86c5ef7

Please sign in to comment.