cloudflare-2.8.14/ 0000755 0000767 0000024 00000000000 13762262673 014363 5 ustar martin staff 0000000 0000000 cloudflare-2.8.14/CloudFlare/ 0000755 0000767 0000024 00000000000 13762262673 016403 5 ustar martin staff 0000000 0000000 cloudflare-2.8.14/CloudFlare/__init__.py 0000644 0000767 0000024 00000000226 13762262437 020512 0 ustar martin staff 0000000 0000000 """ 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.py 0000644 0000767 0000024 00000004616 13712346713 022711 0 ustar martin staff 0000000 0000000 """ 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'): #
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