Skip to content

Commit

Permalink
flushed out tabs, converted print to print() - all python3 stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
mahtin committed Oct 30, 2016
1 parent e179521 commit 2008a53
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 16 deletions.
18 changes: 9 additions & 9 deletions CloudFlare/cloudflare.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,27 +235,27 @@ def __init__(self, base, api_call_part1, api_call_part2=None, api_call_part3=Non
def get(self, identifier1=None, identifier2=None, params=None, data=None):
""" Cloudflare v4 API"""

raise CloudFlareAPIError(0, 'get() call not available for this endpoint')
raise CloudFlareAPIError(0, 'get() call not available for this endpoint')

def patch(self, identifier1=None, identifier2=None, params=None, data=None):
""" Cloudflare v4 API"""

raise CloudFlareAPIError(0, 'patch() call not available for this endpoint')
raise CloudFlareAPIError(0, 'patch() call not available for this endpoint')

def post(self, identifier1=None, identifier2=None, params=None, data=None):
""" Cloudflare v4 API"""

raise CloudFlareAPIError(0, 'post() call not available for this endpoint')
raise CloudFlareAPIError(0, 'post() call not available for this endpoint')

def put(self, identifier1=None, identifier2=None, params=None, data=None):
""" Cloudflare v4 API"""

raise CloudFlareAPIError(0, 'put() call not available for this endpoint')
raise CloudFlareAPIError(0, 'put() call not available for this endpoint')

def delete(self, identifier1=None, identifier2=None, params=None, data=None):
""" Cloudflare v4 API"""

raise CloudFlareAPIError(0, 'delete() call not available for this endpoint')
raise CloudFlareAPIError(0, 'delete() call not available for this endpoint')

class _add_noauth(object):
""" Cloudflare v4 API"""
Expand All @@ -281,22 +281,22 @@ def get(self, identifier1=None, identifier2=None, params=None, data=None):
def patch(self, identifier1=None, identifier2=None, params=None, data=None):
""" Cloudflare v4 API"""

raise CloudFlareAPIError(0, 'patch() call not available for this endpoint')
raise CloudFlareAPIError(0, 'patch() call not available for this endpoint')

def post(self, identifier1=None, identifier2=None, params=None, data=None):
""" Cloudflare v4 API"""

raise CloudFlareAPIError(0, 'post() call not available for this endpoint')
raise CloudFlareAPIError(0, 'post() call not available for this endpoint')

def put(self, identifier1=None, identifier2=None, params=None, data=None):
""" Cloudflare v4 API"""

raise CloudFlareAPIError(0, 'put() call not available for this endpoint')
raise CloudFlareAPIError(0, 'put() call not available for this endpoint')

def delete(self, identifier1=None, identifier2=None, params=None, data=None):
""" Cloudflare v4 API"""

raise CloudFlareAPIError(0, 'delete() call not available for this endpoint')
raise CloudFlareAPIError(0, 'delete() call not available for this endpoint')

class _add_with_auth(object):
""" Cloudflare v4 API"""
Expand Down
12 changes: 6 additions & 6 deletions cli4/cli4.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ def convert_virtual_dns_to_identifier(cf, virtual_dns_name):
def walk(m, s):
"""recursive walk of the tree"""
for n in sorted(dir(m)):
if n[0] == '_':
if n[0] == '_':
# internal
continue
if n in ['delete', 'get', 'patch', 'post', 'put']:
Expand All @@ -123,10 +123,10 @@ def walk(m, s):
a = getattr(m, n)
d = dir(a)
if '_base' in d:
# it's a known api call - lets print it and continue down the tree
# it's a known api call - lets show the result and continue down the tree
if 'delete' in d or 'get' in d or 'patch' in d or 'post' in d or 'put' in d:
# only print if a call exists for this part
print s + '/' + n
# only show the result if a call exists for this part
print(s + '/' + n)
walk(a, s + '/' + n)

def dump_commands(cf):
Expand Down Expand Up @@ -326,7 +326,7 @@ def cli4(args):
results = results[0]

if output == 'json':
print json.dumps(results, indent=4, sort_keys=True)
print(json.dumps(results, indent=4, sort_keys=True))
if output == 'yaml' and yaml is not None:
print yaml.safe_dump(results)
print(yaml.safe_dump(results))

2 changes: 1 addition & 1 deletion examples/example_paging_thru_zones.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def main():
total_count = raw_results['result_info']['total_count']
total_pages = raw_results['result_info']['total_pages']

print "COUNT=%d PAGE=%d PER_PAGE=%d TOTAL_COUNT=%d TOTAL_PAGES=%d -- %s" % (count, page, per_page, total_count, total_pages, domains)
print "COUNT=%d PAGE=%d PER_PAGE=%d TOTAL_COUNT=%d TOTAL_PAGES=%d -- %s" % (count, page, per_page, total_count, total_pages, domains)

if page_number == total_pages:
break
Expand Down

0 comments on commit 2008a53

Please sign in to comment.