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

Commit e44bf75

Browse files
committed
lint found minor stuff
1 parent 0ac418b commit e44bf75

8 files changed

+14
-17
lines changed

examples/example_ai_images.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
def find_call(cf, verbs):
1010
# So we walk over the @ via a getattr() call.
1111
# We also have to deal with a . in a verb - that does not work in Python. So sad.
12-
# Also, the - is actually an _ in this Python library.
12+
# Also, the - is actually an _ in this Python library.
1313
# This is not normally needed for other calls
1414
m = cf
1515
for verb in verbs.split('/'):
@@ -27,7 +27,7 @@ def doit(account_name, prompt_text):
2727
cf = CloudFlare.CloudFlare(global_request_timeout=120)
2828

2929
try:
30-
if account_name == None or account_name == '':
30+
if account_name is None or account_name == '':
3131
params = {'per_page': 1}
3232
else:
3333
params = {'name': account_name, 'per_page': 1}

examples/example_ai_speechrecognition.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
def find_call(cf, verbs):
1313
# So we walk over the @ via a getattr() call.
1414
# We also have to deal with a . in a verb - that does not work in Python. So sad.
15-
# Also, the - is actually an _ in this Python library.
15+
# Also, the - is actually an _ in this Python library.
1616
# This is not normally needed for other calls
1717
m = cf
1818
for verb in verbs.split('/'):
@@ -39,7 +39,7 @@ def doit(account_name, mp3_data):
3939
cf = CloudFlare.CloudFlare(global_request_timeout=120)
4040

4141
try:
42-
if account_name == None or account_name == '':
42+
if account_name is None or account_name == '':
4343
params = {'per_page': 1}
4444
else:
4545
params = {'name': account_name, 'per_page': 1}
@@ -78,7 +78,7 @@ def download_file(url, referer, n_requested):
7878
# NOTE the stream=True parameter below
7979
with requests.get(url, headers=headers, stream=True) as r:
8080
r.raise_for_status()
81-
for chunk in r.iter_content(chunk_size=16*1024):
81+
for chunk in r.iter_content(chunk_size=16*1024):
8282
fp.write(chunk)
8383
n_received += len(chunk)
8484
if n_received > n_requested:

examples/example_ai_translate.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
def find_call(cf, verbs):
1010
# So we walk over the @ via a getattr() call.
1111
# We also have to deal with a . in a verb - that does not work in Python. So sad.
12-
# Also, the - is actually an _ in this Python library.
12+
# Also, the - is actually an _ in this Python library.
1313
# This is not normally needed for other calls
1414
m = cf
1515
for verb in verbs.split('/'):
@@ -27,7 +27,7 @@ def doit(account_name, english_text):
2727
cf = CloudFlare.CloudFlare(global_request_timeout=120)
2828

2929
try:
30-
if account_name == None or account_name == '':
30+
if account_name is None or account_name == '':
3131
params = {'per_page': 1}
3232
else:
3333
params = {'name': account_name, 'per_page': 1}

examples/example_custom_hostnames.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def main():
4747
print('\t%s %-30s %s' % (hostname_info['id'], hostname_info['hostname'], hostname_info['created_at']))
4848

4949
for s in sorted(hostname_info.keys()):
50-
if s in ['id', 'hostname', 'created_at'] or hostname_info[s] == None:
50+
if s in ['id', 'hostname', 'created_at'] or hostname_info[s] is None:
5151
continue
5252
print('\t%-15s = %s' % (s, hostname_info[s]))
5353

examples/example_paging_thru_zones.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ def main():
1111
cf = CloudFlare.CloudFlare(raw=True)
1212

1313
page_number = 0
14-
while True:
14+
while True:
1515
page_number += 1
1616
try:
1717
raw_results = cf.zones.get(params={'per_page':5,'page':page_number})

examples/example_update_dynamic_dns.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ def do_dns_update(cf, zone_name, zone_id, dns_name, ip_address, ip_address_type)
6262
continue
6363

6464
proxied_state = dns_record['proxied']
65-
65+
6666
# Yes, we need to update this record - we know it's the same address type
6767

6868
dns_record_id = dns_record['id']
@@ -135,4 +135,3 @@ def main():
135135

136136
if __name__ == '__main__':
137137
main()
138-

examples/example_user_tokens.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def main():
3939
v = None
4040
except Exception as e:
4141
exit('/user.tokens.get - %s - api call failed' % (e))
42-
42+
4343
if v:
4444
print('TOKENS:')
4545
for t in v:
@@ -54,12 +54,12 @@ def main():
5454
v = None
5555
except Exception as e:
5656
exit('/user.tokens.verify.get - %s - api call failed' % (e))
57-
57+
5858
if v:
5959
print('VERIFYED TOKENS')
6060
print(' %s %-10s [%-20s %-20s]' % (
6161
v['id'],
62-
v['status'],
62+
v['status'],
6363
v['not_before'] if 'not_before' in v else '',
6464
v['expires_on'] if 'expires_on' in v else ''
6565
))
@@ -70,4 +70,3 @@ def main():
7070

7171
if __name__ == '__main__':
7272
main()
73-

examples/example_zone_purge_cache.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def main():
1818
method = 'DELETE'
1919
except IndexError:
2020
pass
21-
21+
2222
try:
2323
zone_name = sys.argv[1]
2424
except IndexError:
@@ -74,4 +74,3 @@ def main():
7474

7575
if __name__ == '__main__':
7676
main()
77-

0 commit comments

Comments
 (0)