Skip to content
This repository was archived by the owner on Nov 22, 2024. It is now read-only.

Commit 8a04e95

Browse files
committed
now builds TABLE-OF-COMMANDS.md
1 parent 0c85423 commit 8a04e95

1 file changed

Lines changed: 13 additions & 4 deletions

File tree

examples/example_list_api_from_web.py

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,13 @@ def main():
2121
# {"action": "GET", "cmd": "/accounts", "deprecated": false, "deprecated_date": "", "deprecated_already": false}
2222
# {"action": "DELETE", "cmd": "/accounts/:id/addressing/prefixes/:id/delegations", "deprecated": false, "deprecated_date": "", "deprecated_already": false, "content_type": "application/json"}
2323

24+
print('# cloudflare-python')
25+
print('')
26+
print('## Table of commands')
27+
print('')
28+
print('|`GET` |`PUT` |`POST` |`PATCH` |`DELETE`|API call|')
29+
print('|--------|--------|--------|--------|--------|:-------|')
30+
2431
cmds = {}
2532
for r in found_comands:
2633
if r['deprecated'] or r['deprecated_already']:
@@ -36,13 +43,15 @@ def main():
3643
# GET - PUT PATCH DELETE /zones/:zone_identifier/waiting_rooms/:waiting_room_id
3744

3845
for cmd in cmds.keys():
39-
p = ''
46+
p = '|'
4047
for method in ['GET', 'POST', 'PUT', 'PATCH', 'DELETE']:
4148
if method in cmds[cmd]:
42-
p += '%-7s' % method
49+
p += '%-8s|' % ('`' + method + '`')
4350
else:
44-
p += '%-7s' % '-'
45-
print("%s %s" % (p, cmd))
51+
p += '%-8s|' % ('-')
52+
print("%s %s |" % (p, cmd))
53+
54+
print('')
4655

4756
if __name__ == '__main__':
4857
main()

0 commit comments

Comments
 (0)