Snake case

main
Bob Mottram 2021-12-26 17:55:38 +00:00
parent 821af94f59
commit ad28291208
3 changed files with 8 additions and 8 deletions

View File

@ -24,7 +24,7 @@ from session import postImage
from session import createSession
from utils import has_object_stringType
from utils import dateStringToSeconds
from utils import dateSecondsToString
from utils import date_seconds_to_string
from utils import get_config_param
from utils import get_full_domain
from utils import validNickname
@ -1314,8 +1314,8 @@ def sharesCatalogEndpoint(base_dir: str, http_prefix: str,
if not re.match(matchPattern, description):
continue
startDateStr = dateSecondsToString(item['published'])
expireDateStr = dateSecondsToString(item['expire'])
startDateStr = date_seconds_to_string(item['published'])
expireDateStr = date_seconds_to_string(item['expire'])
shareId = _getValidSharedItemID(owner, item['displayName'])
if item['dfcId'].startswith('epicyon#'):
dfcId = "epicyon:" + item['dfcId'].split('#')[1]

View File

@ -64,7 +64,7 @@ from utils import get_supported_languages
from utils import setConfigParam
from utils import is_group_actor
from utils import dateStringToSeconds
from utils import dateSecondsToString
from utils import date_seconds_to_string
from utils import validPassword
from utils import userAgentDomain
from utils import camelCaseSplit
@ -5675,7 +5675,7 @@ def _testDateConversions() -> None:
print('testDateConversions')
dateStr = "2021-05-16T14:37:41Z"
dateSec = dateStringToSeconds(dateStr)
dateStr2 = dateSecondsToString(dateSec)
dateStr2 = date_seconds_to_string(dateSec)
assert dateStr == dateStr2

View File

@ -2981,11 +2981,11 @@ def dateStringToSeconds(dateStr: str) -> int:
return int(datetime.datetime.timestamp(expiryTime))
def dateSecondsToString(dateSec: int) -> str:
def date_seconds_to_string(date_sec: int) -> str:
"""Converts a date in seconds since epoch to a string
"""
thisDate = datetime.datetime.fromtimestamp(dateSec)
return thisDate.strftime("%Y-%m-%dT%H:%M:%SZ")
this_date = datetime.datetime.fromtimestamp(date_sec)
return this_date.strftime("%Y-%m-%dT%H:%M:%SZ")
def has_group_type(base_dir: str, actor: str, person_cache: {},