From 2008a534891191ca37154f78aed1fd7de18aa5e6 Mon Sep 17 00:00:00 2001 From: Martin Levy Date: Sun, 30 Oct 2016 16:18:23 -0700 Subject: [PATCH] flushed out tabs, converted print to print() - all python3 stuff --- CloudFlare/cloudflare.py | 18 +++++++++--------- cli4/cli4.py | 12 ++++++------ examples/example_paging_thru_zones.py | 2 +- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/CloudFlare/cloudflare.py b/CloudFlare/cloudflare.py index c5fe2de..65b6aec 100644 --- a/CloudFlare/cloudflare.py +++ b/CloudFlare/cloudflare.py @@ -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""" @@ -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""" diff --git a/cli4/cli4.py b/cli4/cli4.py index ba1ebef..afaae99 100644 --- a/cli4/cli4.py +++ b/cli4/cli4.py @@ -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']: @@ -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): @@ -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)) diff --git a/examples/example_paging_thru_zones.py b/examples/example_paging_thru_zones.py index f9bfb4b..cb3ee09 100644 --- a/examples/example_paging_thru_zones.py +++ b/examples/example_paging_thru_zones.py @@ -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