Skip to content

Commit 850aa7a

Browse files
authored
Refactoring comments (#217)
* fix comments * fix docstring describing module name * modify name of bug_report issue template * add rtype in docstring * fix module name description in docstring
1 parent 4a80bb7 commit 850aa7a

File tree

5 files changed

+19
-11
lines changed

5 files changed

+19
-11
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
name: Bug Report Template
2+
name: Bug Report
33
about: Create a bug report
44
labels: bug
55

linebot/api.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,7 @@ def get_message_delivery_broadcast(self, date, timeout=None):
215215
or a (connect timeout, read timeout) float tuple.
216216
Default is self.http_client.timeout
217217
:type timeout: float | tuple(float, float)
218+
:rtype: :py:class:`linebot.models.responses.MessageDeliveryBroadcastResponse`
218219
"""
219220
response = self._get(
220221
'/v2/bot/message/delivery/broadcast?date={date}'.format(date=date),
@@ -236,6 +237,7 @@ def get_message_delivery_reply(self, date, timeout=None):
236237
or a (connect timeout, read timeout) float tuple.
237238
Default is self.http_client.timeout
238239
:type timeout: float | tuple(float, float)
240+
:rtype: :py:class:`linebot.models.responses.MessageDeliveryReplyResponse`
239241
"""
240242
response = self._get(
241243
'/v2/bot/message/delivery/reply?date={date}'.format(date=date),
@@ -257,6 +259,7 @@ def get_message_delivery_push(self, date, timeout=None):
257259
or a (connect timeout, read timeout) float tuple.
258260
Default is self.http_client.timeout
259261
:type timeout: float | tuple(float, float)
262+
:rtype: :py:class:`linebot.models.responses.MessageDeliveryPushResponse`
260263
"""
261264
response = self._get(
262265
'/v2/bot/message/delivery/push?date={date}'.format(date=date),
@@ -278,6 +281,7 @@ def get_message_delivery_multicast(self, date, timeout=None):
278281
or a (connect timeout, read timeout) float tuple.
279282
Default is self.http_client.timeout
280283
:type timeout: float | tuple(float, float)
284+
:rtype: :py:class:`linebot.models.responses.MessageDeliveryMulticastResponse`
281285
"""
282286
response = self._get(
283287
'/v2/bot/message/delivery/multicast?date={date}'.format(date=date),
@@ -888,6 +892,7 @@ def get_insight_message_delivery(self, date, timeout=None):
888892
or a (connect timeout, read timeout) float tuple.
889893
Default is self.http_client.timeout
890894
:type timeout: float | tuple(float, float)
895+
:rtype: :py:class:`linebot.models.responses.InsightMessageDeliveryResponse`
891896
"""
892897
response = self._get(
893898
'/v2/bot/insight/message/delivery?date={date}'.format(date=date),
@@ -907,6 +912,7 @@ def get_insight_followers(self, date, timeout=None):
907912
or a (connect timeout, read timeout) float tuple.
908913
Default is self.http_client.timeout
909914
:type timeout: float | tuple(float, float)
915+
:rtype: :py:class:`linebot.models.responses.InsightFollowersResponse`
910916
"""
911917
response = self._get(
912918
'/v2/bot/insight/followers?date={date}'.format(date=date),
@@ -926,6 +932,7 @@ def get_insight_demographic(self, timeout=None):
926932
or a (connect timeout, read timeout) float tuple.
927933
Default is self.http_client.timeout
928934
:type timeout: float | tuple(float, float)
935+
:rtype: :py:class:`linebot.models.responses.InsightDemographicResponse`
929936
"""
930937
response = self._get(
931938
'/v2/bot/insight/demographic',
@@ -945,6 +952,7 @@ def get_insight_message_event(self, request_id, timeout=None):
945952
or a (connect timeout, read timeout) float tuple.
946953
Default is self.http_client.timeout
947954
:type timeout: float | tuple(float, float)
955+
:rtype: :py:class:`linebot.models.responses.InsightMessageEventResponse`
948956
"""
949957
response = self._get(
950958
'/v2/bot/insight/message/event?requestId={request_id}'.format(request_id=request_id),

linebot/http_client.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -193,22 +193,22 @@ def headers(self):
193193

194194
@abstractproperty
195195
def text(self):
196-
"""Get request body as text-decoded."""
196+
"""Get response body as text-decoded."""
197197
raise NotImplementedError
198198

199199
@abstractproperty
200200
def content(self):
201-
"""Get request body as binary."""
201+
"""Get response body as binary."""
202202
raise NotImplementedError
203203

204204
@abstractproperty
205205
def json(self):
206-
"""Get request body as json-decoded."""
206+
"""Get response body as json-decoded."""
207207
raise NotImplementedError
208208

209209
@abstractmethod
210210
def iter_content(self, chunk_size=1024, decode_unicode=False):
211-
"""Get request body as iterator content (stream).
211+
"""Get response body as iterator content (stream).
212212
213213
:param int chunk_size:
214214
:param bool decode_unicode:
@@ -238,21 +238,21 @@ def headers(self):
238238

239239
@property
240240
def text(self):
241-
"""Get request body as text-decoded."""
241+
"""Get response body as text-decoded."""
242242
return self.response.text
243243

244244
@property
245245
def content(self):
246-
"""Get request body as binary."""
246+
"""Get response body as binary."""
247247
return self.response.content
248248

249249
@property
250250
def json(self):
251-
"""Get request body as json-decoded."""
251+
"""Get response body as json-decoded."""
252252
return self.response.json()
253253

254254
def iter_content(self, chunk_size=1024, decode_unicode=False):
255-
"""Get request body as iterator content (stream).
255+
"""Get response body as iterator content (stream).
256256
257257
:param int chunk_size:
258258
:param bool decode_unicode:

linebot/models/actions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# License for the specific language governing permissions and limitations
1313
# under the License.
1414

15-
"""linebot.models.template module."""
15+
"""linebot.models.actions module."""
1616

1717
from __future__ import unicode_literals
1818

linebot/webhook.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# License for the specific language governing permissions and limitations
1313
# under the License.
1414

15-
"""linebot.http_client webhook."""
15+
"""linebot.webhook module."""
1616

1717
from __future__ import unicode_literals
1818

0 commit comments

Comments
 (0)