Skip to content

Commit

Permalink
pesky python keyword handling
Browse files Browse the repository at this point in the history
  • Loading branch information
mahtin committed Aug 23, 2022
1 parent 13c1681 commit 977aa24
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions CloudFlare/cloudflare.py
Original file line number Diff line number Diff line change
Expand Up @@ -884,13 +884,15 @@ def api_list(self, m=None, s=''):
# w.append(str(a)[1:-1] + ' ; UNUSED')
pass
if '_parts' in d:
if n[-1] == '_' and keyword.iskeyword(n[:-1]):
if n[-1] == '_':
if keyword.iskeyword(n[:-1]):
# should always be a keyword - but now nothing needs to be done
pass
# remove the extra keyword postfix'ed with underscore
pass
w.append(str(a)[1:-1])
else:
# handle underscores by returning the actual API call vs the method name
w.append(str(a)[1:-1])
## w.append(str(a)[1:-1].replace('/:id/','/'))
# now recurse downwards into the tree
w = w + self.api_list(a, s + '/' + n)
return w
Expand Down

0 comments on commit 977aa24

Please sign in to comment.