Snake case

merge-requests/30/head
Bob Mottram 2021-12-26 10:11:18 +00:00
parent efa481ad39
commit a047d9785b
1 changed files with 3 additions and 3 deletions

View File

@ -23,7 +23,7 @@ from followingCalendar import addPersonToCalendar
# posts containing these strings will always get screened out, # posts containing these strings will always get screened out,
# both incoming and outgoing. # both incoming and outgoing.
# Could include dubious clacks or admin dogwhistles # Could include dubious clacks or admin dogwhistles
invalidCharacters = ( INVALID_CHARACTERS = (
'', '', '', '', '', '', 'ϟϟ', '🏳️‍🌈🚫', '⚡⚡' '', '', '', '', '', '', 'ϟϟ', '🏳️‍🌈🚫', '⚡⚡'
) )
@ -766,7 +766,7 @@ def isEvil(domain: str) -> bool:
def containsInvalidChars(jsonStr: str) -> bool: def containsInvalidChars(jsonStr: str) -> bool:
"""Does the given json string contain invalid characters? """Does the given json string contain invalid characters?
""" """
for isInvalid in invalidCharacters: for isInvalid in INVALID_CHARACTERS:
if isInvalid in jsonStr: if isInvalid in jsonStr:
return True return True
return False return False
@ -775,7 +775,7 @@ def containsInvalidChars(jsonStr: str) -> bool:
def removeInvalidChars(text: str) -> str: def removeInvalidChars(text: str) -> str:
"""Removes any invalid characters from a string """Removes any invalid characters from a string
""" """
for isInvalid in invalidCharacters: for isInvalid in INVALID_CHARACTERS:
if isInvalid not in text: if isInvalid not in text:
continue continue
text = text.replace(isInvalid, '') text = text.replace(isInvalid, '')