projects/ctan: make Python happy
parent
612ec9d04b
commit
0571f7353a
|
@ -7,7 +7,7 @@ from project import Project
|
|||
from shared import CSC_MIRROR
|
||||
import requests
|
||||
import datefinder # another date finding library
|
||||
from datetime import timedelta
|
||||
from datetime import datetime, timedelta
|
||||
import re
|
||||
import pandas as pd
|
||||
|
||||
|
@ -20,7 +20,8 @@ class ctan(Project):
|
|||
|
||||
m = re.search(r'(\d+ hour)|(\d+ hours)|(\d+(\.)?\d+ days)', page[indexOfFile:]) # solution from: https://stackoverflow.com/questions/21074100/how-to-convert-standard-timedelta-string-to-timedelta-object/21074460
|
||||
|
||||
|
||||
duration = pd.to_timedelta(m.group(0))
|
||||
data[project]["out_of_sync_since"] = datetime.now() - duration.total_seconds()
|
||||
data[project]["out_of_sync_since"] = datetime.now() - duration
|
||||
|
||||
return duration <= pd.to_timedelta(data[project]["out_of_sync_interval"], unit='s')
|
||||
|
|
Loading…
Reference in New Issue