mirror-checker/projects/ubuntu.py

22 lines
526 B
Python

"""
Contains ubuntu class
"""
import os
from project import Project
from shared import CSC_MIRROR
from shared import NUM_UBUNTU_RELEASES
import requests
import datefinder # another date finding library
from datetime import timedelta
from datetime import datetime
import re
import pandas as pd
class ubuntu(Project):
"""ubuntu class"""
@staticmethod
def check(data, project, current_time):
page = requests.get(data[project]["upstream"]).text
return page.count("Up to date") == NUM_UBUNTU_RELEASES