forked from indymedia/epicyon
Add space
parent
9ed343865d
commit
2127252ca0
7
utils.py
7
utils.py
|
@ -33,14 +33,11 @@ def isDormant(baseDir: str, nickname: str, domain: str, actor: str,
|
||||||
|
|
||||||
with open(lastSeenFilename, 'r') as lastSeenFile:
|
with open(lastSeenFilename, 'r') as lastSeenFile:
|
||||||
daysSinceEpochStr = lastSeenFile.read()
|
daysSinceEpochStr = lastSeenFile.read()
|
||||||
if not daysSinceEpochStr:
|
daysSinceEpoch = int(daysSinceEpoch)
|
||||||
return False
|
|
||||||
if not daysSinceEpochStr.isdigit():
|
|
||||||
return False
|
|
||||||
currTime = datetime.datetime.utcnow()
|
currTime = datetime.datetime.utcnow()
|
||||||
currDaysSinceEpoch = (currTime - datetime.datetime(1970, 1, 1)).days
|
currDaysSinceEpoch = (currTime - datetime.datetime(1970, 1, 1)).days
|
||||||
timeDiffMonths = \
|
timeDiffMonths = \
|
||||||
int((currDaysSinceEpoch - int(daysSinceEpochStr)) / 30)
|
int((currDaysSinceEpoch - daysSinceEpochStr) / 30)
|
||||||
if timeDiffMonths >= dormantMonths:
|
if timeDiffMonths >= dormantMonths:
|
||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
|
|
|
@ -115,7 +115,7 @@ def htmlPersonOptions(defaultTimeline: str,
|
||||||
handle = getNicknameFromActor(optionsActor) + '@' + optionsDomain
|
handle = getNicknameFromActor(optionsActor) + '@' + optionsDomain
|
||||||
handleShown = handle
|
handleShown = handle
|
||||||
if dormant:
|
if dormant:
|
||||||
handleShown += '💤'
|
handleShown += ' 💤'
|
||||||
optionsStr += \
|
optionsStr += \
|
||||||
' <p class="optionsText">' + translate['Options for'] + \
|
' <p class="optionsText">' + translate['Options for'] + \
|
||||||
' @' + handleShown + '</p>\n'
|
' @' + handleShown + '</p>\n'
|
||||||
|
|
|
@ -1457,7 +1457,7 @@ def individualFollowAsHtml(translate: {},
|
||||||
domain, port = getDomainFromActor(followUrl)
|
domain, port = getDomainFromActor(followUrl)
|
||||||
titleStr = '@' + nickname + '@' + domain
|
titleStr = '@' + nickname + '@' + domain
|
||||||
if dormant:
|
if dormant:
|
||||||
titleStr += '💤'
|
titleStr += ' 💤'
|
||||||
avatarUrl = getPersonAvatarUrl(baseDir, followUrl, personCache, True)
|
avatarUrl = getPersonAvatarUrl(baseDir, followUrl, personCache, True)
|
||||||
if not avatarUrl:
|
if not avatarUrl:
|
||||||
avatarUrl = followUrl + '/avatar.png'
|
avatarUrl = followUrl + '/avatar.png'
|
||||||
|
|
Loading…
Reference in New Issue