snake case

main
Bob Mottram 2024-02-26 19:22:25 +00:00
parent 78c23e9caa
commit b7ae8adebe
1 changed files with 9 additions and 9 deletions

View File

@ -863,11 +863,11 @@ def _add_emoji(base_dir: str, word_str: str,
return True return True
def post_tag_exists(tagType: str, tagName: str, tags: {}) -> bool: def post_tag_exists(tag_type: str, tag_name: str, tags: {}) -> bool:
"""Returns true if a tag exists in the given dict """Returns true if a tag exists in the given dict
""" """
for tag in tags: for tag in tags:
if tag['name'] == tagName and tag['type'] == tagType: if tag['name'] == tag_name and tag['type'] == tag_type:
return True return True
return False return False
@ -1818,21 +1818,21 @@ def limit_repeated_words(text: str, max_repeats: int) -> str:
return text return text
def get_price_from_string(priceStr: str) -> (str, str): def get_price_from_string(price_str: str) -> (str, str):
"""Returns the item price and currency """Returns the item price and currency
""" """
currencies = get_currencies() currencies = get_currencies()
for symbol, name in currencies.items(): for symbol, name in currencies.items():
if symbol in priceStr: if symbol in price_str:
price = priceStr.replace(symbol, '') price = price_str.replace(symbol, '')
if is_float(price): if is_float(price):
return price, name return price, name
elif name in priceStr: elif name in price_str:
price = priceStr.replace(name, '') price = price_str.replace(name, '')
if is_float(price): if is_float(price):
return price, name return price, name
if is_float(priceStr): if is_float(price_str):
return priceStr, "EUR" return price_str, "EUR"
return "0.00", "EUR" return "0.00", "EUR"