Skip to content

Commit

Permalink
doing that python3 thingy
Browse files Browse the repository at this point in the history
  • Loading branch information
mahtin committed Feb 7, 2018
1 parent 73d6386 commit 25e3193
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions examples/example_zones.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#!/usr/bin/env python
"""Cloudflare API code - example"""

from __future__ import print_function

import os
import sys
import re
Expand Down Expand Up @@ -43,7 +45,7 @@ def main():
except CloudFlare.exceptions.CloudFlareAPIError as e:
exit('/zones/dns_records %d %s - api call failed' % (e, e))

print zone_id, zone_name, zone_owner, zone_plan
print(zone_id, zone_name, zone_owner, zone_plan)

prog = re.compile('\.*'+zone_name+'$')
dns_records = sorted(dns_records, key=lambda v: prog.sub('', v['name']) + '_' + v['type'])
Expand All @@ -53,9 +55,9 @@ def main():
r_value = dns_record['content']
r_ttl = dns_record['ttl']
r_id = dns_record['id']
print '\t%s %60s %6d %-5s %s' % (r_id, r_name, r_ttl, r_type, r_value)
print('\t%s %60s %6d %-5s %s' % (r_id, r_name, r_ttl, r_type, r_value))

print ''
print('')

exit(0)

Expand Down

0 comments on commit 25e3193

Please sign in to comment.