mirror of https://gitlab.com/bashrc2/epicyon
Snake case
parent
b4142e9de4
commit
1129862acb
|
@ -23,7 +23,7 @@ from utils import dangerousMarkup
|
|||
from utils import isPGPEncrypted
|
||||
from utils import containsPGPPublicKey
|
||||
from utils import acct_dir
|
||||
from utils import isfloat
|
||||
from utils import is_float
|
||||
from utils import get_currencies
|
||||
from utils import removeHtml
|
||||
from petnames import getPetName
|
||||
|
@ -1225,13 +1225,13 @@ def getPriceFromString(priceStr: str) -> (str, str):
|
|||
for symbol, name in currencies.items():
|
||||
if symbol in priceStr:
|
||||
price = priceStr.replace(symbol, '')
|
||||
if isfloat(price):
|
||||
if is_float(price):
|
||||
return price, name
|
||||
elif name in priceStr:
|
||||
price = priceStr.replace(name, '')
|
||||
if isfloat(price):
|
||||
if is_float(price):
|
||||
return price, name
|
||||
if isfloat(priceStr):
|
||||
if is_float(priceStr):
|
||||
return priceStr, "EUR"
|
||||
return "0.00", "EUR"
|
||||
|
||||
|
|
|
@ -251,7 +251,7 @@ from utils import canReplyTo
|
|||
from utils import isDM
|
||||
from utils import replace_users_with_at
|
||||
from utils import local_actor_url
|
||||
from utils import isfloat
|
||||
from utils import is_float
|
||||
from utils import validPassword
|
||||
from utils import removeLineEndings
|
||||
from utils import get_base_content_from_post
|
||||
|
@ -17164,7 +17164,7 @@ class PubServer(BaseHTTPRequestHandler):
|
|||
self.server.domain)
|
||||
itemQty = 1
|
||||
if fields['itemQty']:
|
||||
if isfloat(fields['itemQty']):
|
||||
if is_float(fields['itemQty']):
|
||||
itemQty = float(fields['itemQty'])
|
||||
itemPrice = "0.00"
|
||||
itemCurrency = "EUR"
|
||||
|
|
|
@ -34,7 +34,7 @@ from utils import get_image_extensions
|
|||
from utils import removeDomainPort
|
||||
from utils import isAccountDir
|
||||
from utils import acct_dir
|
||||
from utils import isfloat
|
||||
from utils import is_float
|
||||
from utils import get_category_types
|
||||
from utils import get_shares_files_list
|
||||
from utils import local_actor_url
|
||||
|
@ -1147,10 +1147,10 @@ def _sharesCatalogParams(path: str) -> (bool, float, float, str):
|
|||
if 't' in value or 'y' in value or '1' in value:
|
||||
today = True
|
||||
elif key.startswith('min'):
|
||||
if isfloat(value):
|
||||
if is_float(value):
|
||||
minPrice = float(value)
|
||||
elif key.startswith('max'):
|
||||
if isfloat(value):
|
||||
if is_float(value):
|
||||
maxPrice = float(value)
|
||||
elif key.startswith('match'):
|
||||
matchPattern = value
|
||||
|
|
2
utils.py
2
utils.py
|
@ -2961,7 +2961,7 @@ def validPassword(password: str) -> bool:
|
|||
return True
|
||||
|
||||
|
||||
def isfloat(value):
|
||||
def is_float(value):
|
||||
try:
|
||||
float(value)
|
||||
return True
|
||||
|
|
|
@ -17,7 +17,7 @@ from utils import get_full_domain
|
|||
from utils import is_editor
|
||||
from utils import removeIdEnding
|
||||
from utils import acct_dir
|
||||
from utils import isfloat
|
||||
from utils import is_float
|
||||
from utils import local_actor_url
|
||||
from follow import followerApprovalActive
|
||||
from person import isPersonSnoozed
|
||||
|
@ -1000,7 +1000,7 @@ def htmlIndividualShare(domain: str, shareId: str,
|
|||
sharedItem['location'] + '<br>'
|
||||
contactTitleStr = translate['Contact']
|
||||
if sharedItem.get('itemPrice') and sharedItem.get('itemCurrency'):
|
||||
if isfloat(sharedItem['itemPrice']):
|
||||
if is_float(sharedItem['itemPrice']):
|
||||
if float(sharedItem['itemPrice']) > 0:
|
||||
profileStr += ' ' + \
|
||||
'<b>' + translate['Price'] + ':</b> ' + \
|
||||
|
|
|
@ -19,7 +19,7 @@ from utils import getCachedPostFilename
|
|||
from utils import get_config_param
|
||||
from utils import acct_dir
|
||||
from utils import getNicknameFromActor
|
||||
from utils import isfloat
|
||||
from utils import is_float
|
||||
from utils import get_audio_extensions
|
||||
from utils import get_video_extensions
|
||||
from utils import get_image_extensions
|
||||
|
@ -1439,7 +1439,7 @@ def htmlSearchResultShare(base_dir: str, sharedItem: {}, translate: {},
|
|||
contactTitleStr = translate['Contact']
|
||||
if sharedItem.get('itemPrice') and \
|
||||
sharedItem.get('itemCurrency'):
|
||||
if isfloat(sharedItem['itemPrice']):
|
||||
if is_float(sharedItem['itemPrice']):
|
||||
if float(sharedItem['itemPrice']) > 0:
|
||||
sharedItemsForm += \
|
||||
' <b>' + translate['Price'] + \
|
||||
|
|
Loading…
Reference in New Issue