/usr/lib/python3/dist-packages/CloudFlare
NameSizeModeActions
__pycache__/-0755rm
api_decode_from_web.py24460644editdlrm
api_extras.py17730644editdlrm
api_v4.py193450644editdlrm
cloudflare.py425780644editdlrm
exceptions.py20550644editdlrm
logging_helper.py13740644editdlrm
network.py25460644editdlrm
read_configs.py32310644editdlrm
utils.py21690644editdlrm
__init__.py1500644editdlrm
Edit: /usr/lib/python3/dist-packages/CloudFlare/api_decode_from_web.py (2446B)
""" API extras for Cloudflare API""" import datetime from bs4 import BeautifulSoup, Comment API_TYPES = ['GET', 'POST', 'PATCH', 'PUT', 'DELETE'] def do_section(section): """ API extras for Cloudflare API""" cmds = [] # look for deprecated first in section deprecated = False deprecated_date = '' deprecated_already = False for tag2 in section.find_all('h3'): #

Deprecation Warning

if 'Deprecation Warning' in str(tag2): deprecated = True break for tag2 in section.find_all('p'): #

End of life Date: November 2, 2020

if 'End of life Date:' in str(tag2): for child in tag2.children: deprecated_date = str(child).replace('End of life Date:','').strip() try: # clean up date d = datetime.datetime.strptime(deprecated_date, '%B %d, %Y') if d <= datetime.datetime.now(): # already done! deprecated_already = True deprecated_date = d.strftime('%Y-%m-%d') except ValueError: # Lets not worry about all the date formats that could show-up. Leave as a string pass break if deprecated_date != '': break # look for all API calls in section for tag2 in section.find_all('pre'): cmd = [] for child in tag2.children: if isinstance(child, Comment): # remove