Skip to content

Commit 744e290

Browse files
committed
Fixed PEP8 issues except E501.
1 parent 969b4a8 commit 744e290

File tree

34 files changed

+566
-535
lines changed

34 files changed

+566
-535
lines changed

examples/accesssettings/accesssettings.py

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,17 @@
2020
# POST /access_settings/whitelist #
2121

2222
data = {
23-
"ips": [
24-
{
25-
"ip": "192.168.1.1"
26-
},
27-
{
28-
"ip": "192.*.*.*"
29-
},
30-
{
31-
"ip": "192.168.1.3/32"
32-
}
33-
]
23+
"ips": [
24+
{
25+
"ip": "192.168.1.1"
26+
},
27+
{
28+
"ip": "192.*.*.*"
29+
},
30+
{
31+
"ip": "192.168.1.3/32"
32+
}
33+
]
3434
}
3535
response = sg.client.access_settings.whitelist.post(request_body=data)
3636
print(response.status_code)
@@ -51,11 +51,11 @@
5151
# DELETE /access_settings/whitelist #
5252

5353
data = {
54-
"ids": [
55-
1,
56-
2,
57-
3
58-
]
54+
"ids": [
55+
1,
56+
2,
57+
3
58+
]
5959
}
6060
response = sg.client.access_settings.whitelist.delete(request_body=data)
6161
print(response.status_code)
@@ -81,4 +81,3 @@
8181
print(response.status_code)
8282
print(response.body)
8383
print(response.headers)
84-

examples/alerts/alerts.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010
# POST /alerts #
1111

1212
data = {
13-
"email_to": "example@example.com",
14-
"frequency": "daily",
15-
"type": "stats_notification"
13+
"email_to": "example@example.com",
14+
"frequency": "daily",
15+
"type": "stats_notification"
1616
}
1717
response = sg.client.alerts.post(request_body=data)
1818
print(response.status_code)
@@ -33,7 +33,7 @@
3333
# PATCH /alerts/{alert_id} #
3434

3535
data = {
36-
"email_to": "example@example.com"
36+
"email_to": "example@example.com"
3737
}
3838
alert_id = "test_url_param"
3939
response = sg.client.alerts._(alert_id).patch(request_body=data)
@@ -60,4 +60,3 @@
6060
print(response.status_code)
6161
print(response.body)
6262
print(response.headers)
63-

examples/apikeys/apikeys.py

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@
1010
# POST /api_keys #
1111

1212
data = {
13-
"name": "My API Key",
14-
"sample": "data",
15-
"scopes": [
16-
"mail.send",
17-
"alerts.create",
18-
"alerts.read"
19-
]
13+
"name": "My API Key",
14+
"sample": "data",
15+
"scopes": [
16+
"mail.send",
17+
"alerts.create",
18+
"alerts.read"
19+
]
2020
}
2121
response = sg.client.api_keys.post(request_body=data)
2222
print(response.status_code)
@@ -38,11 +38,11 @@
3838
# PUT /api_keys/{api_key_id} #
3939

4040
data = {
41-
"name": "A New Hope",
42-
"scopes": [
43-
"user.profile.read",
44-
"user.profile.update"
45-
]
41+
"name": "A New Hope",
42+
"scopes": [
43+
"user.profile.read",
44+
"user.profile.update"
45+
]
4646
}
4747
api_key_id = "test_url_param"
4848
response = sg.client.api_keys._(api_key_id).put(request_body=data)
@@ -55,7 +55,7 @@
5555
# PATCH /api_keys/{api_key_id} #
5656

5757
data = {
58-
"name": "A New Hope"
58+
"name": "A New Hope"
5959
}
6060
api_key_id = "test_url_param"
6161
response = sg.client.api_keys._(api_key_id).patch(request_body=data)
@@ -82,4 +82,3 @@
8282
print(response.status_code)
8383
print(response.body)
8484
print(response.headers)
85-

examples/asm/asm.py

Lines changed: 23 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010
# POST /asm/groups #
1111

1212
data = {
13-
"description": "Suggestions for products our users might like.",
14-
"is_default": True,
15-
"name": "Product Suggestions"
13+
"description": "Suggestions for products our users might like.",
14+
"is_default": True,
15+
"name": "Product Suggestions"
1616
}
1717
response = sg.client.asm.groups.post(request_body=data)
1818
print(response.status_code)
@@ -34,9 +34,9 @@
3434
# PATCH /asm/groups/{group_id} #
3535

3636
data = {
37-
"description": "Suggestions for items our users might like.",
38-
"id": 103,
39-
"name": "Item Suggestions"
37+
"description": "Suggestions for items our users might like.",
38+
"id": 103,
39+
"name": "Item Suggestions"
4040
}
4141
group_id = "test_url_param"
4242
response = sg.client.asm.groups._(group_id).patch(request_body=data)
@@ -69,13 +69,14 @@
6969
# POST /asm/groups/{group_id}/suppressions #
7070

7171
data = {
72-
"recipient_emails": [
73-
"test1@example.com",
74-
"test2@example.com"
75-
]
72+
"recipient_emails": [
73+
"test1@example.com",
74+
"test2@example.com"
75+
]
7676
}
7777
group_id = "test_url_param"
78-
response = sg.client.asm.groups._(group_id).suppressions.post(request_body=data)
78+
response = sg.client.asm.groups._(
79+
group_id).suppressions.post(request_body=data)
7980
print(response.status_code)
8081
print(response.body)
8182
print(response.headers)
@@ -95,14 +96,15 @@
9596
# POST /asm/groups/{group_id}/suppressions/search #
9697

9798
data = {
98-
"recipient_emails": [
99-
"exists1@example.com",
100-
"exists2@example.com",
101-
"doesnotexists@example.com"
102-
]
99+
"recipient_emails": [
100+
"exists1@example.com",
101+
"exists2@example.com",
102+
"doesnotexists@example.com"
103+
]
103104
}
104105
group_id = "test_url_param"
105-
response = sg.client.asm.groups._(group_id).suppressions.search.post(request_body=data)
106+
response = sg.client.asm.groups._(
107+
group_id).suppressions.search.post(request_body=data)
106108
print(response.status_code)
107109
print(response.body)
108110
print(response.headers)
@@ -132,10 +134,10 @@
132134
# POST /asm/suppressions/global #
133135

134136
data = {
135-
"recipient_emails": [
136-
"test1@example.com",
137-
"test2@example.com"
138-
]
137+
"recipient_emails": [
138+
"test1@example.com",
139+
"test2@example.com"
140+
]
139141
}
140142
response = sg.client.asm.suppressions._("global").post(request_body=data)
141143
print(response.status_code)
@@ -171,4 +173,3 @@
171173
print(response.status_code)
172174
print(response.body)
173175
print(response.headers)
174-

examples/browsers/browsers.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99
# Retrieve email statistics by browser. #
1010
# GET /browsers/stats #
1111

12-
params = {'end_date': '2016-04-01', 'aggregated_by': 'day', 'browsers': 'test_string', 'limit': 'test_string', 'offset': 'test_string', 'start_date': '2016-01-01'}
12+
params = {'end_date': '2016-04-01', 'aggregated_by': 'day', 'browsers': 'test_string',
13+
'limit': 'test_string', 'offset': 'test_string', 'start_date': '2016-01-01'}
1314
response = sg.client.browsers.stats.get(query_params=params)
1415
print(response.status_code)
1516
print(response.body)
1617
print(response.headers)
17-

examples/campaigns/campaigns.py

Lines changed: 32 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -10,24 +10,24 @@
1010
# POST /campaigns #
1111

1212
data = {
13-
"categories": [
14-
"spring line"
15-
],
16-
"custom_unsubscribe_url": "",
17-
"html_content": "<html><head><title></title></head><body><p>Check out our spring line!</p></body></html>",
18-
"ip_pool": "marketing",
19-
"list_ids": [
20-
110,
21-
124
22-
],
23-
"plain_content": "Check out our spring line!",
24-
"segment_ids": [
25-
110
26-
],
27-
"sender_id": 124451,
28-
"subject": "New Products for Spring!",
29-
"suppression_group_id": 42,
30-
"title": "March Newsletter"
13+
"categories": [
14+
"spring line"
15+
],
16+
"custom_unsubscribe_url": "",
17+
"html_content": "<html><head><title></title></head><body><p>Check out our spring line!</p></body></html>",
18+
"ip_pool": "marketing",
19+
"list_ids": [
20+
110,
21+
124
22+
],
23+
"plain_content": "Check out our spring line!",
24+
"segment_ids": [
25+
110
26+
],
27+
"sender_id": 124451,
28+
"subject": "New Products for Spring!",
29+
"suppression_group_id": 42,
30+
"title": "March Newsletter"
3131
}
3232
response = sg.client.campaigns.post(request_body=data)
3333
print(response.status_code)
@@ -49,13 +49,13 @@
4949
# PATCH /campaigns/{campaign_id} #
5050

5151
data = {
52-
"categories": [
53-
"summer line"
54-
],
55-
"html_content": "<html><head><title></title></head><body><p>Check out our summer line!</p></body></html>",
56-
"plain_content": "Check out our summer line!",
57-
"subject": "New Products for Summer!",
58-
"title": "May Newsletter"
52+
"categories": [
53+
"summer line"
54+
],
55+
"html_content": "<html><head><title></title></head><body><p>Check out our summer line!</p></body></html>",
56+
"plain_content": "Check out our summer line!",
57+
"subject": "New Products for Summer!",
58+
"title": "May Newsletter"
5959
}
6060
campaign_id = "test_url_param"
6161
response = sg.client.campaigns._(campaign_id).patch(request_body=data)
@@ -88,10 +88,11 @@
8888
# PATCH /campaigns/{campaign_id}/schedules #
8989

9090
data = {
91-
"send_at": 1489451436
91+
"send_at": 1489451436
9292
}
9393
campaign_id = "test_url_param"
94-
response = sg.client.campaigns._(campaign_id).schedules.patch(request_body=data)
94+
response = sg.client.campaigns._(
95+
campaign_id).schedules.patch(request_body=data)
9596
print(response.status_code)
9697
print(response.body)
9798
print(response.headers)
@@ -101,7 +102,7 @@
101102
# POST /campaigns/{campaign_id}/schedules #
102103

103104
data = {
104-
"send_at": 1489771528
105+
"send_at": 1489771528
105106
}
106107
campaign_id = "test_url_param"
107108
response = sg.client.campaigns._(campaign_id).schedules.post(request_body=data)
@@ -144,11 +145,11 @@
144145
# POST /campaigns/{campaign_id}/schedules/test #
145146

146147
data = {
147-
"to": "your.email@example.com"
148+
"to": "your.email@example.com"
148149
}
149150
campaign_id = "test_url_param"
150-
response = sg.client.campaigns._(campaign_id).schedules.test.post(request_body=data)
151+
response = sg.client.campaigns._(
152+
campaign_id).schedules.test.post(request_body=data)
151153
print(response.status_code)
152154
print(response.body)
153155
print(response.headers)
154-

examples/categories/categories.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@
1919
# Retrieve Email Statistics for Categories #
2020
# GET /categories/stats #
2121

22-
params = {'end_date': '2016-04-01', 'aggregated_by': 'day', 'limit': 1, 'offset': 1, 'start_date': '2016-01-01', 'categories': 'test_string'}
22+
params = {'end_date': '2016-04-01', 'aggregated_by': 'day', 'limit': 1,
23+
'offset': 1, 'start_date': '2016-01-01', 'categories': 'test_string'}
2324
response = sg.client.categories.stats.get(query_params=params)
2425
print(response.status_code)
2526
print(response.body)
@@ -29,9 +30,9 @@
2930
# Retrieve sums of email stats for each category [Needs: Stats object defined, has category ID?] #
3031
# GET /categories/stats/sums #
3132

32-
params = {'end_date': '2016-04-01', 'aggregated_by': 'day', 'limit': 1, 'sort_by_metric': 'test_string', 'offset': 1, 'start_date': '2016-01-01', 'sort_by_direction': 'asc'}
33+
params = {'end_date': '2016-04-01', 'aggregated_by': 'day', 'limit': 1,
34+
'sort_by_metric': 'test_string', 'offset': 1, 'start_date': '2016-01-01', 'sort_by_direction': 'asc'}
3335
response = sg.client.categories.stats.sums.get(query_params=params)
3436
print(response.status_code)
3537
print(response.body)
3638
print(response.headers)
37-

examples/clients/clients.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
# Retrieve email statistics by client type. #
1010
# GET /clients/stats #
1111

12-
params = {'aggregated_by': 'day', 'start_date': '2016-01-01', 'end_date': '2016-04-01'}
12+
params = {'aggregated_by': 'day',
13+
'start_date': '2016-01-01', 'end_date': '2016-04-01'}
1314
response = sg.client.clients.stats.get(query_params=params)
1415
print(response.status_code)
1516
print(response.body)
@@ -19,10 +20,10 @@
1920
# Retrieve stats by a specific client type. #
2021
# GET /clients/{client_type}/stats #
2122

22-
params = {'aggregated_by': 'day', 'start_date': '2016-01-01', 'end_date': '2016-04-01'}
23+
params = {'aggregated_by': 'day',
24+
'start_date': '2016-01-01', 'end_date': '2016-04-01'}
2325
client_type = "test_url_param"
2426
response = sg.client.clients._(client_type).stats.get(query_params=params)
2527
print(response.status_code)
2628
print(response.body)
2729
print(response.headers)
28-

0 commit comments

Comments
 (0)