minor/docstring

This commit is contained in:
codey 2025-02-16 09:37:47 -05:00
parent c83746c510
commit f61c437bf5

View File

@ -21,18 +21,27 @@ class JesusMemeGenerator():
self.MEMESTORAGEDIR = os.path.join(os.path.expanduser("~"), self.MEMESTORAGEDIR = os.path.join(os.path.expanduser("~"),
"memes") "memes")
self.top_line_regex: Pattern = regex.compile( self.top_line_regex: Pattern = regex.compile(
r'[^\p{Letter}\p{Number}\p{Punctuation}\p{Horiz_Space}\p{Currency_Symbol}]') r'[^\p{Letter}\p{Number}\p{Punctuation}\p{Horiz_Space}\p{Currency_Symbol}]'
)
self.bottom_line_regex: Pattern = regex.compile( self.bottom_line_regex: Pattern = regex.compile(
r'[^\p{Letter}\p{Number}\p{Punctuation}\p{Horiz_Space}\p{Currency_Symbol}]') r'[^\p{Letter}\p{Number}\p{Punctuation}\p{Horiz_Space}\p{Currency_Symbol}]'
)
self.url_regex_1: Pattern = regex.compile( self.url_regex_1: Pattern = regex.compile(
r'\p{Horiz_Space}' r'\p{Horiz_Space}')
)
self.url_regex_2: Pattern = regex.compile( self.url_regex_2: Pattern = regex.compile(
r'#' r'#')
)
async def create_meme(self, top_line: str, bottom_line: str, async def create_meme(self, top_line: str, bottom_line: str,
meme="Jesus-Talking-To-Cool-Dude") -> Optional[str]: meme="Jesus-Talking-To-Cool-Dude") -> Optional[str]:
"""
Create Meme
Args:
top_line (str): Top line of meme
bottom_line (str): Bottom line of meme
meme (str): The meme to use, defaults to Jesus-Talking-To-Cool-Dude
Returns:
Optional[str]
"""
try: try:
if not top_line or not bottom_line: if not top_line or not bottom_line:
return None return None