diff --git a/CloudFlare/cloudflare.py b/CloudFlare/cloudflare.py index c1c8fbe..c5f72e5 100644 --- a/CloudFlare/cloudflare.py +++ b/CloudFlare/cloudflare.py @@ -884,7 +884,7 @@ def add(self, t, p1, p2=None, p3=None, p4=None, p5=None): raise CloudFlareAPIError(0, 'api load type mismatch') if keyword.iskeyword(name): - ## add an extra keywork prefix'ed with underscore so it can used with Python code + ## add an extra keyword postfix'ed with underscore so it can used with Python code setattr(branch, name + '_', f) if '-' in name: # dashes (vs underscores) cause issues in Python and other languages @@ -911,9 +911,13 @@ def api_list(self, m=None, s=''): if 'delete' in d or 'get' in d or 'patch' in d or 'post' in d or 'put' in d: # 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]) - ## w.append(str(a)[1:-1].replace('/:id/','/')) + if n[-1] == '_' and keyword.iskeyword(n[:-1]): + # remove the extra keyword postfix'ed with underscore + pass + 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/','/')) w = w + self.api_list(a, s + '/' + n) return w