aboutsummaryrefslogtreecommitdiff
path: root/src/wikiget/validations.py
diff options
context:
space:
mode:
authorCody Logan <cody@lokken.dev>2023-11-08 12:53:25 -0800
committerCody Logan <cody@lokken.dev>2023-11-08 12:53:25 -0800
commit96316c8be7bc21617ec5333f87864a0f002ebaa4 (patch)
treebc42d19c3656203700dd322a73f0a73fe798c0b1 /src/wikiget/validations.py
parent2df37a4157763fdad816b7641714ed0478351794 (diff)
downloadwikiget-96316c8be7bc21617ec5333f87864a0f002ebaa4.tar.gz
wikiget-96316c8be7bc21617ec5333f87864a0f002ebaa4.zip
Add and refine docstrings in src folder
Diffstat (limited to 'src/wikiget/validations.py')
-rw-r--r--src/wikiget/validations.py6
1 files changed, 3 insertions, 3 deletions
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.