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

Commit f1e3531

Browse files
committed
keyword handling still needed fixes
1 parent 1ca59e8 commit f1e3531

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

CloudFlare/cloudflare.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -884,7 +884,7 @@ def add(self, t, p1, p2=None, p3=None, p4=None, p5=None):
884884
raise CloudFlareAPIError(0, 'api load type mismatch')
885885

886886
if keyword.iskeyword(name):
887-
## add an extra keywork prefix'ed with underscore so it can used with Python code
887+
## add an extra keyword postfix'ed with underscore so it can used with Python code
888888
setattr(branch, name + '_', f)
889889
if '-' in name:
890890
# dashes (vs underscores) cause issues in Python and other languages
@@ -911,9 +911,13 @@ def api_list(self, m=None, s=''):
911911
if 'delete' in d or 'get' in d or 'patch' in d or 'post' in d or 'put' in d:
912912
# only show the result if a call exists for this part
913913
if '_parts' in d:
914-
# handle underscores by returning the actual API call vs the method name
915-
w.append(str(a)[1:-1])
916-
## w.append(str(a)[1:-1].replace('/:id/','/'))
914+
if n[-1] == '_' and keyword.iskeyword(n[:-1]):
915+
# remove the extra keyword postfix'ed with underscore
916+
pass
917+
else:
918+
# handle underscores by returning the actual API call vs the method name
919+
w.append(str(a)[1:-1])
920+
## w.append(str(a)[1:-1].replace('/:id/','/'))
917921
w = w + self.api_list(a, s + '/' + n)
918922
return w
919923

0 commit comments

Comments
 (0)