mirror of https://gitlab.com/bashrc2/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
|
||||||
|
|
Loading…
Reference in New Issue