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

Commit 1420966

Browse files
committed
pylint work
1 parent b8fe4da commit 1420966

1 file changed

Lines changed: 11 additions & 8 deletions

File tree

CloudFlare/exceptions.py

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
class CloudFlareError(Exception):
44
""" errors for Cloudflare API"""
55

6-
class code_and_message(object):
6+
class CodeMessage(object):
77
""" a small class to save away an interger and string (the code and the message)"""
88

99
def __init__(self, code, message):
@@ -17,23 +17,24 @@ def __str__(self):
1717
def __init__(self, code, message, error_chain=None):
1818
""" errors for Cloudflare API"""
1919

20-
self.e = self.code_and_message(int(code), str(message))
20+
self.evalue = self.CodeMessage(int(code), str(message))
2121
self.error_chain = None
2222
if error_chain != None:
2323
self.error_chain = []
24-
for e in error_chain:
25-
self.error_chain.append(self.code_and_message(int(e['code']), str(e['message'])))
24+
for evalue in error_chain:
25+
self.error_chain.append(
26+
self.CodeMessage(int(evalue['code']), str(evalue['message'])))
2627
# self.error_chain.append({'code': self.code, 'message': str(self.message)})
2728

2829
def __int__(self):
2930
""" integer value for Cloudflare API errors"""
3031

31-
return int(self.e)
32+
return int(self.evalue)
3233

3334
def __str__(self):
3435
""" string value for Cloudflare API errors"""
3536

36-
return str(self.e)
37+
return str(self.evalue)
3738

3839
def __len__(self):
3940
""" Cloudflare API errors can contain a chain of errors"""
@@ -53,10 +54,12 @@ def __iter__(self):
5354

5455
if self.error_chain is None:
5556
raise StopIteration
56-
for e in self.error_chain:
57-
yield e
57+
for evalue in self.error_chain:
58+
yield evalue
5859

5960
def next(self):
61+
""" Cloudflare API errors can contain a chain of errors"""
62+
6063
if self.error_chain is None:
6164
raise StopIteration()
6265

0 commit comments

Comments
 (0)