Skip to content

Commit 2fd6290

Browse files
pep8
1 parent a945dcf commit 2fd6290

61 files changed

Lines changed: 978 additions & 782 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

sendgrid/helpers/endpoints/ip/unassigned.py

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,18 +20,24 @@ def unassigned(data, as_json=False):
2020
The /ips rest endpoint returns information about the IP addresses
2121
and the usernames assigned to an IP
2222
23-
unassigned returns a listing of the IP addresses that are allocated
23+
unassigned returns a listing of the IP addresses that are allocated
2424
but have 0 users assigned
2525
26-
27-
data (response.body from sg.client.ips.get())
26+
27+
data (response.body from sg.client.ips.get())
2828
as_json False -> get list of dicts
2929
True -> get json object
3030
3131
example:
32-
sg = sendgrid.SendGridAPIClient(apikey=os.environ.get('SENDGRID_API_KEY'))
33-
34-
params = {'subuser': 'test_string', 'ip': 'test_string', 'limit': 1, 'exclude_whitelabels': 'true', 'offset': 1}
32+
sg = sendgrid.SendGridAPIClient(os.environ.get('SENDGRID_API_KEY'))
33+
34+
params = {
35+
'subuser': 'test_string',
36+
'ip': 'test_string',
37+
'limit': 1,
38+
'exclude_whitelabels':
39+
'true', 'offset': 1
40+
}
3541
response = sg.client.ips.get(query_params=params)
3642
if response.status_code == 201:
3743
data = response.body
@@ -49,4 +55,4 @@ def unassigned(data, as_json=False):
4955
no_subusers.add(current_ip)
5056

5157
ret_val = format_ret(no_subusers, as_json=as_json)
52-
return ret_val
58+
return ret_val

sendgrid/helpers/inbound/send.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@ def url(self):
4040

4141
def main():
4242
config = Config()
43-
parser = argparse.ArgumentParser(description='Test data and optional host.')
43+
parser = argparse.ArgumentParser(
44+
description='Test data and optional host.')
4445
parser.add_argument('data',
4546
type=str,
4647
help='path to the sample data')

sendgrid/helpers/mail/asm.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
from .group_id import GroupId
22
from .groups_to_display import GroupsToDisplay
33

4+
45
class Asm(object):
56
"""An object specifying unsubscribe behavior."""
67

@@ -52,8 +53,8 @@ def groups_to_display(self):
5253

5354
@groups_to_display.setter
5455
def groups_to_display(self, value):
55-
"""An array containing the unsubscribe groups that you would like to be displayed on the
56-
unsubscribe preferences page. Max of 25 groups.
56+
"""An array containing the unsubscribe groups that you would like to
57+
be displayed on the unsubscribe preferences page. Max of 25 groups.
5758
5859
:param groups_to_display: Unsubscribe groups to display
5960
:type groups_to_display: GroupsToDisplay, list(int), optional

sendgrid/helpers/mail/attachment.py

Lines changed: 38 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,17 @@
44
from .disposition import Disposition
55
from .content_id import ContentId
66

7+
78
class Attachment(object):
89
"""An attachment to be included with an email."""
910

10-
def __init__(self, file_content=None, file_name=None, file_type=None, disposition=None, content_id=None):
11+
def __init__(
12+
self,
13+
file_content=None,
14+
file_name=None,
15+
file_type=None,
16+
disposition=None,
17+
content_id=None):
1118
"""Create an Attachment
1219
1320
:param file_content: The Base64 encoded content of the attachment
@@ -16,17 +23,21 @@ def __init__(self, file_content=None, file_name=None, file_type=None, dispositi
1623
:type file_name: FileName, string
1724
:param file_type: The MIME type of the content you are attaching
1825
:type file_type FileType, string, optional
19-
:param disposition: The content-disposition of the attachment, specifying display style.
20-
Specifies how you would like the attachment to be displayed.
21-
- "inline" results in the attached file being displayed automatically
22-
within the message.
23-
- "attachment" results in the attached file requiring some action to
24-
display (e.g. opening or downloading the file).
25-
If unspecified, "attachment" is used. Must be one of the two choices.
26+
:param disposition: The content-disposition of the attachment,
27+
specifying display style. Specifies how you
28+
would like the attachment to be displayed.
29+
- "inline" results in the attached file being
30+
displayed automatically within the message.
31+
- "attachment" results in the attached file
32+
requiring some action to display (e.g. opening
33+
or downloading the file).
34+
If unspecified, "attachment" is used. Must be one
35+
of the two choices.
2636
:type disposition: Disposition, string, optional
2737
:param content_id: The content id for the attachment.
28-
This is used when the Disposition is set to "inline" and the attachment
29-
is an image, allowing the file to be displayed within the email body.
38+
This is used when the Disposition is set to
39+
"inline" and the attachment is an image, allowing
40+
the file to be displayed within the email body.
3041
:type content_id: ContentId, string, optional
3142
"""
3243
self._file_content = None
@@ -37,16 +48,16 @@ def __init__(self, file_content=None, file_name=None, file_type=None, dispositi
3748

3849
if file_content is not None:
3950
self.file_content = file_content
40-
51+
4152
if file_type is not None:
4253
self.file_type = file_type
43-
54+
4455
if file_name is not None:
4556
self.file_name = file_name
46-
57+
4758
if disposition is not None:
4859
self.disposition = disposition
49-
60+
5061
if content_id is not None:
5162
self.content_id = content_id
5263

@@ -136,13 +147,16 @@ def disposition(self, value):
136147
display (e.g. opening or downloading the file).
137148
If unspecified, "attachment" is used. Must be one of the two choices.
138149
139-
:param disposition: The content-disposition of the attachment, specifying display style.
140-
Specifies how you would like the attachment to be displayed.
141-
- "inline" results in the attached file being displayed automatically
142-
within the message.
143-
- "attachment" results in the attached file requiring some action to
144-
display (e.g. opening or downloading the file).
145-
If unspecified, "attachment" is used. Must be one of the two choices.
150+
:param disposition: The content-disposition of the attachment,
151+
specifying display style. Specifies how you would
152+
like the attachment to be displayed.
153+
- "inline" results in the attached file being
154+
displayed automatically within the message.
155+
- "attachment" results in the attached file
156+
requiring some action to display (e.g. opening
157+
or downloading the file).
158+
If unspecified, "attachment" is used. Must be one
159+
of the two choices.
146160
:type disposition: Disposition, string, optional
147161
"""
148162
if isinstance(value, Disposition):
@@ -169,8 +183,9 @@ def content_id(self, value):
169183
is an image, allowing the file to be displayed within the email body.
170184
171185
:param content_id: The content id for the attachment.
172-
This is used when the Disposition is set to "inline" and the attachment
173-
is an image, allowing the file to be displayed within the email body.
186+
This is used when the Disposition is set to "inline"
187+
and the attachment is an image, allowing the file to
188+
be displayed within the email body.
174189
:type content_id: ContentId, string, optional
175190
"""
176191
if isinstance(value, ContentId):

sendgrid/helpers/mail/batch_id.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
class BatchId(object):
2-
"""This ID represents a batch of emails to be sent at the same time. Including a batch_id in your
3-
request allows you include this email in that batch, and also enables you to cancel or pause the
4-
delivery of that batch. For more information,
5-
see https://sendgrid.com/docs/API_Reference/Web_API_v3/cancel_schedule_send."""
2+
"""This ID represents a batch of emails to be sent at the same time.
3+
Including a batch_id in your request allows you include this email
4+
in that batch, and also enables you to cancel or pause the delivery
5+
of that batch. For more information, see
6+
https://sendgrid.com/docs/API_Reference/Web_API_v3/cancel_schedule_send.
7+
"""
68
def __init__(self, batch_id=None):
79
"""Create a batch ID.
810

sendgrid/helpers/mail/bcc_settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def __init__(self, enable=None, email=None):
1818

1919
if enable is not None:
2020
self.enable = enable
21-
21+
2222
if email is not None:
2323
self.email = email
2424

sendgrid/helpers/mail/bcc_settings_email.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,12 @@ class BccSettingsEmail(object):
44
def __init__(self, bcc_settings_email=None):
55
"""Create a BccSettingsEmail object
66
7-
:param bcc_settings_email: The email address that you would like to receive the BCC
7+
:param bcc_settings_email: The email address that you would like to
8+
receive the BCC
89
:type bcc_settings_email: string, optional
910
"""
1011
self._bcc_settings_email = None
11-
12+
1213
if bcc_settings_email is not None:
1314
self.bcc_settings_email = bcc_settings_email
1415

sendgrid/helpers/mail/category.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ def name(self):
2424
def name(self, value):
2525
"""The name of this Category. Must be less than 255 characters.
2626
27-
:param value: The name of this Category. Must be less than 255 characters.
27+
:param value: The name of this Category. Must be less than 255
28+
characters.
2829
:type value: string
2930
"""
3031
self._name = value

sendgrid/helpers/mail/click_tracking.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ def __init__(self, enable=None, enable_text=None):
1414

1515
if enable is not None:
1616
self.enable = enable
17-
17+
1818
if enable_text is not None:
1919
self.enable_text = enable_text
2020

@@ -39,7 +39,7 @@ def enable(self, value):
3939
def enable_text(self):
4040
"""Indicates if this setting should be included in the text/plain
4141
portion of your email.
42-
42+
4343
:rtype: boolean
4444
"""
4545
return self._enable_text
@@ -48,8 +48,8 @@ def enable_text(self):
4848
def enable_text(self, value):
4949
"""Indicates if this setting should be included in the text/plain
5050
portion of your email.
51-
52-
:param value: Indicates if this setting should be included in the
51+
52+
:param value: Indicates if this setting should be included in the
5353
text/plain portion of your email.
5454
:type value: boolean
5555
"""

sendgrid/helpers/mail/content.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ def mime_type(self, value):
3939
"""The MIME type of the content you are including in your email.
4040
For example, "text/plain" or "text/html".
4141
42-
:param value: The MIME type of the content you are including in your email.
42+
:param value: The MIME type of the content you are including in your
43+
email.
4344
For example, "text/plain" or "text/html".
4445
:type value: string
4546
"""

0 commit comments

Comments
 (0)