def user_ready(username):
    if username.endswith(".php"):
        return False
    
    uh = UserHistory(username)
    
    # First, check to see if the file is fresh
    uh.load_if_possible()
    if uh.data_age() < settings.HISTORY_TTL:
        return uh.num_weeks()
    
    # Then, do a quick weeklist fetch to compare
    try:
        weeks = list(fetcher.weeks(username))
    except __HOLE__:  # They probably don't exist
        return None
    
    present = True
    for start, end in weeks:
        if not uh.has_week(start):
            present = False
            break
    
    # If all weeks were present, update the timestamp
    if present:
        uh.set_timestamp()
        uh.save_default()
        return len(weeks)
    else:
        return False
dataset/ETHPy150Open andrewgodwin/lastgraph/lastgui/views.py/user_ready