mirror of https://gitlab.com/bashrc2/epicyon
Snake case
parent
821af94f59
commit
ad28291208
|
@ -24,7 +24,7 @@ from session import postImage
|
||||||
from session import createSession
|
from session import createSession
|
||||||
from utils import has_object_stringType
|
from utils import has_object_stringType
|
||||||
from utils import dateStringToSeconds
|
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_config_param
|
||||||
from utils import get_full_domain
|
from utils import get_full_domain
|
||||||
from utils import validNickname
|
from utils import validNickname
|
||||||
|
@ -1314,8 +1314,8 @@ def sharesCatalogEndpoint(base_dir: str, http_prefix: str,
|
||||||
if not re.match(matchPattern, description):
|
if not re.match(matchPattern, description):
|
||||||
continue
|
continue
|
||||||
|
|
||||||
startDateStr = dateSecondsToString(item['published'])
|
startDateStr = date_seconds_to_string(item['published'])
|
||||||
expireDateStr = dateSecondsToString(item['expire'])
|
expireDateStr = date_seconds_to_string(item['expire'])
|
||||||
shareId = _getValidSharedItemID(owner, item['displayName'])
|
shareId = _getValidSharedItemID(owner, item['displayName'])
|
||||||
if item['dfcId'].startswith('epicyon#'):
|
if item['dfcId'].startswith('epicyon#'):
|
||||||
dfcId = "epicyon:" + item['dfcId'].split('#')[1]
|
dfcId = "epicyon:" + item['dfcId'].split('#')[1]
|
||||||
|
|
4
tests.py
4
tests.py
|
@ -64,7 +64,7 @@ from utils import get_supported_languages
|
||||||
from utils import setConfigParam
|
from utils import setConfigParam
|
||||||
from utils import is_group_actor
|
from utils import is_group_actor
|
||||||
from utils import dateStringToSeconds
|
from utils import dateStringToSeconds
|
||||||
from utils import dateSecondsToString
|
from utils import date_seconds_to_string
|
||||||
from utils import validPassword
|
from utils import validPassword
|
||||||
from utils import userAgentDomain
|
from utils import userAgentDomain
|
||||||
from utils import camelCaseSplit
|
from utils import camelCaseSplit
|
||||||
|
@ -5675,7 +5675,7 @@ def _testDateConversions() -> None:
|
||||||
print('testDateConversions')
|
print('testDateConversions')
|
||||||
dateStr = "2021-05-16T14:37:41Z"
|
dateStr = "2021-05-16T14:37:41Z"
|
||||||
dateSec = dateStringToSeconds(dateStr)
|
dateSec = dateStringToSeconds(dateStr)
|
||||||
dateStr2 = dateSecondsToString(dateSec)
|
dateStr2 = date_seconds_to_string(dateSec)
|
||||||
assert dateStr == dateStr2
|
assert dateStr == dateStr2
|
||||||
|
|
||||||
|
|
||||||
|
|
6
utils.py
6
utils.py
|
@ -2981,11 +2981,11 @@ def dateStringToSeconds(dateStr: str) -> int:
|
||||||
return int(datetime.datetime.timestamp(expiryTime))
|
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
|
"""Converts a date in seconds since epoch to a string
|
||||||
"""
|
"""
|
||||||
thisDate = datetime.datetime.fromtimestamp(dateSec)
|
this_date = datetime.datetime.fromtimestamp(date_sec)
|
||||||
return thisDate.strftime("%Y-%m-%dT%H:%M:%SZ")
|
return this_date.strftime("%Y-%m-%dT%H:%M:%SZ")
|
||||||
|
|
||||||
|
|
||||||
def has_group_type(base_dir: str, actor: str, person_cache: {},
|
def has_group_type(base_dir: str, actor: str, person_cache: {},
|
||||||
|
|
Loading…
Reference in New Issue