Skip to content

Conversation

@lordlabuckdas
Copy link
Contributor

No description provided.

"""Base class for all core functions of the cloner
:param root: Website root URL
:type root: str
Copy link
Collaborator

Choose a reason for hiding this comment

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

do we need type if the type annotated in function definition?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, Sphinx mandates it and the type disappears from the parameter description in docs when we remove its :type from the docstring.


def convert(self, path):
def convert(self, path: str) -> None:
"""Convert all pages to a Snare-friendly form and write meta info
Copy link
Collaborator

Choose a reason for hiding this comment

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

what is Snare-friendly format? :)

Copy link
Contributor Author

@lordlabuckdas lordlabuckdas Aug 24, 2021

Choose a reason for hiding this comment

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

I meant to convey the renaming of files to their hashes but I now realize it sounds very vague. I have clarified it in 58eafef.

snare/cloner.py Outdated

async def replace_links(self, data, level):
async def replace_links(self, data: Union[bytes, str], level: int) -> BeautifulSoup:
"""Replace website links to make them suitable for serving
Copy link
Collaborator

Choose a reason for hiding this comment

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

what does it mean "suitable"? try to be more concrete, maybe even with example

Copy link
Contributor Author

@lordlabuckdas lordlabuckdas Aug 24, 2021

Choose a reason for hiding this comment

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

Have clarified it in 58eafef. Will add detailed descriptions to this and other functions in the next series of commits.


class HeadlessCloner(BaseCloner):
async def fetch_data(self, browser, current_url, level, try_count):
async def fetch_data(
Copy link
Collaborator

Choose a reason for hiding this comment

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

consider adding the docstring for the class as well

@lordlabuckdas lordlabuckdas requested a review from afeena October 13, 2021 09:48
@lordlabuckdas lordlabuckdas marked this pull request as ready for review October 13, 2021 09:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants