Skip to content

Commit

Permalink
Improve class attr name: '_SUBKEY'->'_URL_PATH_ELEM'.
Browse files Browse the repository at this point in the history
  • Loading branch information
tseaver committed Nov 3, 2014
1 parent 5689c02 commit bb9a3a8
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions gcloud/storage/acl.py
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ def clear(self):
class BucketACL(ACL):
"""An ACL specifically for a bucket."""

_SUBKEY = 'acl'
_URL_PATH_ELEM = 'acl'

def __init__(self, bucket):
"""
Expand All @@ -379,7 +379,7 @@ def reload(self):
"""
self.entities.clear()

url_path = '%s/%s' % (self.bucket.path, self._SUBKEY)
url_path = '%s/%s' % (self.bucket.path, self._URL_PATH_ELEM)
found = self.bucket.connection.api_request(method='GET', path=url_path)
for entry in found['items']:
self.add_entity(self.entity_from_dict(entry))
Expand Down Expand Up @@ -425,10 +425,10 @@ def save(self, acl=None):
if save_to_backend:
result = self.bucket.connection.api_request(
method='PATCH', path=self.bucket.path,
data={self._SUBKEY: list(acl)},
data={self._URL_PATH_ELEM: list(acl)},
query_params={'projection': 'full'})
self.entities.clear()
for entry in result[self._SUBKEY]:
for entry in result[self._URL_PATH_ELEM]:
self.add_entity(self.entity_from_dict(entry))
self.loaded = True

Expand Down Expand Up @@ -465,7 +465,7 @@ def clear(self):
class DefaultObjectACL(BucketACL):
"""A class representing the default object ACL for a bucket."""

_SUBKEY = 'defaultObjectAcl'
_URL_PATH_ELEM = 'defaultObjectAcl'


class ObjectACL(ACL):
Expand Down

0 comments on commit bb9a3a8

Please sign in to comment.