Skip to content

Commit e48ce64

Browse files
authored
Fix: RST document format error (#357)
* fix: rst format
1 parent 2d5c6d0 commit e48ce64

File tree

2 files changed

+20
-10
lines changed

2 files changed

+20
-10
lines changed

README.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1245,6 +1245,7 @@ The LINE Messaging API SDK for Python includes experimental asyncio support.
12451245
(API may change without notice in a future version)
12461246

12471247
.. code:: python
1248+
12481249
import os
12491250
import sys
12501251
from argparse import ArgumentParser

setup.py

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -83,16 +83,19 @@ def run(self):
8383
import re
8484

8585
async_source = header + source
86-
async_source = re.sub(" def (?!__init__|__check_error)", " async def ", async_source)
87-
async_source = re.sub("from .http_client import HttpClient, RequestsHttpClient", "", async_source)
86+
async_source = re.sub(" def (?!__init__|__check_error)", " async def ",
87+
async_source)
88+
async_source = re.sub("from .http_client import HttpClient, RequestsHttpClient", "",
89+
async_source)
8890

8991
# Change the signature of the __init__.
9092
# self, channel_access_token
9193
async_source = re.sub(r"def __init__\(self, channel_access_token,",
9294
"def __init__(self, channel_access_token, async_http_client,",
9395
async_source)
94-
async_source = re.sub(r",\s*timeout=HttpClient.DEFAULT_TIMEOUT, http_client=RequestsHttpClient",
95-
"", async_source)
96+
async_source = re.sub(
97+
r",\s*timeout=HttpClient.DEFAULT_TIMEOUT, http_client=RequestsHttpClient",
98+
"", async_source)
9699
async_source = re.sub(
97100
r"if http_client:\n"
98101
+ r"\s*self.http_client = http_client\(timeout=timeout\)\n"
@@ -107,21 +110,26 @@ def run(self):
107110
+ " :param str data_endpoint: (optional) Default is https://api-data.line.me\n"
108111
+ "\n\"\"\"\n"
109112
, async_source, flags=re.DOTALL)
110-
async_source = re.sub("'line-bot-sdk-python/'", '"line-bot-sdk-python-async/"', async_source)
113+
async_source = re.sub("'line-bot-sdk-python/'", '"line-bot-sdk-python-async/"',
114+
async_source)
111115

112-
async_source = re.sub('"""linebot.api module."""', '"""linebot.async_api module."""', async_source)
116+
async_source = re.sub('"""linebot.api module."""', '"""linebot.async_api module."""',
117+
async_source)
113118
async_source = re.sub(
114119
"self.(_get|_post|_delete|_put)", "await self.\\1", async_source
115120
)
116121
async_source = re.sub(
117-
"self.http_client.(get|post|delete|put)", "await self.async_http_client.\\1", async_source
122+
"self.http_client.(get|post|delete|put)", "await self.async_http_client.\\1",
123+
async_source
118124
)
119125
async_source = re.sub(
120126
"from .http_client import HttpClient, RequestsHttpClient",
121-
"from .async_http_client import AsyncHttpClient, AiohttpAsyncHttpClient", async_source
127+
"from .async_http_client import AsyncHttpClient, AiohttpAsyncHttpClient",
128+
async_source
122129
)
123130
async_source = re.sub(
124-
"linebot.http_client.RequestsHttpClient", "linebot.async_http_client.AiohttpAsyncHttpClient",
131+
"linebot.http_client.RequestsHttpClient",
132+
"linebot.async_http_client.AiohttpAsyncHttpClient",
125133
async_source
126134
)
127135
async_source = re.sub(
@@ -131,7 +139,8 @@ def run(self):
131139
"RequestsHttpClient", "AiohttpAsyncHttpClient", async_source
132140
)
133141
async_source = re.sub(
134-
"Default is self.http_client.timeout", "Default is self.async_http_client.timeout", async_source
142+
"Default is self.http_client.timeout", "Default is self.async_http_client.timeout",
143+
async_source
135144
)
136145
async_source = re.sub(
137146
"class LineBotApi",

0 commit comments

Comments
 (0)