cloudflare-2.8.14/0000755000076700000240000000000013762262673014363 5ustar martinstaff00000000000000cloudflare-2.8.14/CloudFlare/0000755000076700000240000000000013762262673016403 5ustar martinstaff00000000000000cloudflare-2.8.14/CloudFlare/__init__.py0000644000076700000240000000022613762262437020512 0ustar martinstaff00000000000000""" Cloudflare v4 API""" from __future__ import absolute_import __version__ = '2.8.14' from .cloudflare import CloudFlare __all__ = ['CloudFlare'] cloudflare-2.8.14/CloudFlare/api_decode_from_web.py0000644000076700000240000000461613712346713022711 0ustar martinstaff00000000000000""" 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