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

Commit ef9a5f3

Browse files
committed
cleaner and easier way to find missing api calls - this changes --dump/--api for the better
1 parent 21649a9 commit ef9a5f3

3 files changed

Lines changed: 6 additions & 5 deletions

File tree

CloudFlare/api_decode_from_web.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ def do_section(section):
5151
if action == '' or action not in API_TYPES:
5252
continue
5353
cmd = ''.join(cmd[1:])
54-
if cmd[0] == '/':
55-
cmd = cmd[1:]
54+
if cmd[0] != '/':
55+
cmd = '/' + cmd
5656
v = {'action': action, 'cmd': cmd, 'deprecated': deprecated, 'deprecated_date': deprecated_date, 'deprecated_already': deprecated_already}
5757
cmds.append(v)
5858
return cmds

CloudFlare/cloudflare.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -885,7 +885,8 @@ def api_list(self, m=None, s=''):
885885
# only show the result if a call exists for this part
886886
if '_parts' in d:
887887
# handle underscores by returning the actual API call vs the method name
888-
w.append(str(a)[1:-1].replace('/:id/','/'))
888+
w.append(str(a)[1:-1])
889+
## w.append(str(a)[1:-1].replace('/:id/','/'))
889890
w = w + self.api_list(a, s + '/' + n)
890891
return w
891892

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,8 @@ lint:
7878

7979
api:
8080
@tmp=/tmp/_$$$$_ ; \
81-
python -m cli4 --dump | sed -e 's/^\///' | sort > $$tmp.1 ; \
82-
python -m cli4 --api | sed -e 's/^[A-Z][A-Z]* *//' -e 's/\/:[a-z_]*//g' -e 's/^\///' | sort | uniq > $$tmp.2 ; \
81+
python -m cli4 --dump | sort > $$tmp.1 ; \
82+
python -m cli4 --api | sed -e 's/^[A-Z][A-Z]* *//' -e 's/\/:[a-z_]*/\/:id/g' -e 's/\/:id$$//' -e 's/\/:id ;/ ;/' | sort | uniq > $$tmp.2 ; \
8383
egrep -v '; deprecated' < $$tmp.2 | diff $$tmp.1 - > $$tmp.3 ; \
8484
echo "In code:" ; \
8585
egrep '< ' < $$tmp.3 | sed -e 's/< / /' | sort | tee $$tmp.4 ; \

0 commit comments

Comments
 (0)