Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions aioaria2/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,7 @@ async def jsonrpc(self, method: str, params: Optional[List[Any]] = None, prefix:
if self.mode == 'batch':
await self.queue.put(req_obj)
return None
if self.mode == 'format':
return req_obj
return await self.send_request(req_obj)
return req_obj if self.mode == 'format' else await self.send_request(req_obj)
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function _Aria2BaseClient.jsonrpc refactored with the following changes:


async def send_request(self, req_obj: Dict[str, Any]) -> Union[Dict[str, Any], Any]:
raise NotImplementedError
Expand Down
2 changes: 1 addition & 1 deletion aioaria2/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ def read_configfile(path: str, prefix: str = "--") -> Generator[str, None, None]
:return:
"""
with open(path, "r") as f:
for line in f.readlines():
for line in f:
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function read_configfile refactored with the following changes:

line = line.strip()
if line and not line.startswith("#"):
yield prefix + line
Expand Down