Skip to content

Commit

Permalink
cleaner and easier way to find missing api calls - this changes --dum…
Browse files Browse the repository at this point in the history
…p/--api for the better
  • Loading branch information
mahtin committed Aug 4, 2020
1 parent 21649a9 commit ef9a5f3
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
4 changes: 2 additions & 2 deletions CloudFlare/api_decode_from_web.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ def do_section(section):
if action == '' or action not in API_TYPES:
continue
cmd = ''.join(cmd[1:])
if cmd[0] == '/':
cmd = cmd[1:]
if cmd[0] != '/':
cmd = '/' + cmd
v = {'action': action, 'cmd': cmd, 'deprecated': deprecated, 'deprecated_date': deprecated_date, 'deprecated_already': deprecated_already}
cmds.append(v)
return cmds
Expand Down
3 changes: 2 additions & 1 deletion CloudFlare/cloudflare.py
Original file line number Diff line number Diff line change
Expand Up @@ -885,7 +885,8 @@ def api_list(self, m=None, s=''):
# only show the result if a call exists for this part
if '_parts' in d:
# handle underscores by returning the actual API call vs the method name
w.append(str(a)[1:-1].replace('/:id/','/'))
w.append(str(a)[1:-1])
## w.append(str(a)[1:-1].replace('/:id/','/'))
w = w + self.api_list(a, s + '/' + n)
return w

Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ lint:

api:
@tmp=/tmp/_$$$$_ ; \
python -m cli4 --dump | sed -e 's/^\///' | sort > $$tmp.1 ; \
python -m cli4 --api | sed -e 's/^[A-Z][A-Z]* *//' -e 's/\/:[a-z_]*//g' -e 's/^\///' | sort | uniq > $$tmp.2 ; \
python -m cli4 --dump | sort > $$tmp.1 ; \
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 ; \
egrep -v '; deprecated' < $$tmp.2 | diff $$tmp.1 - > $$tmp.3 ; \
echo "In code:" ; \
egrep '< ' < $$tmp.3 | sed -e 's/< / /' | sort | tee $$tmp.4 ; \
Expand Down

0 comments on commit ef9a5f3

Please sign in to comment.