From 96316c8be7bc21617ec5333f87864a0f002ebaa4 Mon Sep 17 00:00:00 2001 From: Cody Logan Date: Wed, 8 Nov 2023 12:53:25 -0800 Subject: Add and refine docstrings in src folder --- src/wikiget/validations.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/wikiget/validations.py') diff --git a/src/wikiget/validations.py b/src/wikiget/validations.py index 18c1f86..c7cc2dd 100644 --- a/src/wikiget/validations.py +++ b/src/wikiget/validations.py @@ -25,7 +25,7 @@ from wikiget import BLOCKSIZE def valid_file(search_string: str) -> re.Match | None: - """Determines if the given string contains a valid file name + """Determine if the given string contains a valid file name. A valid file name is a string that begins with 'File:' or 'Image:' (the standard file prefixes in MediaWiki), includes a period, and has at least one character @@ -43,7 +43,7 @@ def valid_file(search_string: str) -> re.Match | None: def valid_site(search_string: str) -> re.Match | None: - """Determines if the given string contains a valid site name + """Determine if the given string contains a valid site name. A valid site name is a string ending with 'wikipedia.org' or 'wikimedia.org'. This covers all subdomains of those domains. @@ -61,7 +61,7 @@ def valid_site(search_string: str) -> re.Match | None: def verify_hash(filename: str) -> str: - """Calculates the SHA1 hash of the given file for comparison with a known value. + """Calculate the SHA1 hash of the given file for comparison with a known value. Despite being insecure, SHA1 is used since that's what the MediaWiki API returns for the file hash. -- cgit v1.2.3