Skip to content

Commit

Permalink
Merge pull request #2003 from dhermes/no-more-private-members
Browse files Browse the repository at this point in the history
Replacing private members with protected members in gcloud.streaming.
  • Loading branch information
dhermes authored Jul 20, 2016
2 parents b213cb8 + d28d323 commit 8e3caf9
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions gcloud/streaming/http_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,8 @@ def __init__(self, url='', http_method='GET', headers=None, body=''):
self.url = url
self.http_method = http_method
self.headers = headers or {}
self.__body = None
self.__loggable_body = None
self._body = None
self._loggable_body = None
self.body = body

@property
Expand All @@ -142,7 +142,7 @@ def loggable_body(self):
:rtype: str
:returns: The body to be logged.
"""
return self.__loggable_body
return self._loggable_body

@loggable_body.setter
def loggable_body(self, value):
Expand All @@ -156,7 +156,7 @@ def loggable_body(self, value):
if self.body is None:
raise RequestError(
'Cannot set loggable body on request with no body')
self.__loggable_body = value
self._loggable_body = value

@property
def body(self):
Expand All @@ -165,7 +165,7 @@ def body(self):
:rtype: str
:returns: The body of the request.
"""
return self.__body
return self._body

@body.setter
def body(self, value):
Expand All @@ -176,11 +176,11 @@ def body(self, value):
:type value: str
:param value: updated body
"""
self.__body = value
self._body = value
if value is not None:
# Avoid calling len() which cannot exceed 4GiB in 32-bit python.
body_length = getattr(
self.__body, 'length', None) or len(self.__body)
self._body, 'length', None) or len(self._body)
self.headers['content-length'] = str(body_length)
else:
self.headers.pop('content-length', None)
Expand Down

0 comments on commit 8e3caf9

Please sign in to comment.