projects/ctan: make Python happy

pull/8/head
Yiao Shen 6 months ago
parent 612ec9d04b
commit 0571f7353a
Signed by: y266shen
GPG Key ID: D126FA196DA0F362
  1. 5
      projects/ctan.py

@ -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…
Cancel
Save