Skip to content

Commit 7dab8f4

Browse files
Merge pull request #87 from vkmrishad/vkmrishad-fix
PEP8 fix
2 parents 97cca34 + 8b3b31e commit 7dab8f4

File tree

5 files changed

+14
-6
lines changed

5 files changed

+14
-6
lines changed

examples/example.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
if __name__ == '__main__' and __package__ is None:
88
from os import sys, path
9+
910
sys.path.append(path.dirname(path.dirname(path.abspath(__file__))))
1011
from smtpapi import SMTPAPIHeader
1112

@@ -21,7 +22,7 @@
2122

2223
# [Unique Arguments](http://sendgrid.com/docs/API_Reference/SMTP_API/unique_arguments.html)
2324
# header.add_unique_arg('key', 'value')
24-
header.set_unique_args({'key':'value'})
25+
header.set_unique_args({'key': 'value'})
2526

2627
# [Categories](http://sendgrid.com/docs/API_Reference/SMTP_API/categories.html)
2728
# header.add_category('category')
@@ -43,6 +44,6 @@
4344
# [Scheduling Parameters](https://sendgrid.com/docs/API_Reference/SMTP_API/scheduling_parameters.html)
4445
# header.add_send_each_at(unix_timestamp) # must be a unix timestamp
4546
# header.set_send_each_at([]) # must be a unix timestamp
46-
header.set_send_at(int(time.time())) # must be a unix timestamp
47+
header.set_send_at(int(time.time())) # must be a unix timestamp
4748

4849
print(header.json_string())

smtpapi/__init__.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
import json
33
import os
44

5-
65
dir_path = os.path.dirname(os.path.realpath(__file__))
76
if os.path.isfile(os.path.join(dir_path, 'VERSION.txt')):
87
__version__ = open(os.path.join(dir_path, 'VERSION.txt')).read().strip()
98

9+
1010
class _CustomJSONEncoder(json.JSONEncoder):
1111

1212
def default(self, o):
@@ -15,6 +15,7 @@ def default(self, o):
1515
# Provide a fallback to the default encoder if we haven't implemented special support for the object's class
1616
return super(_CustomJSONEncoder, self).default(o)
1717

18+
1819
class SMTPAPIHeader(object):
1920

2021
def __init__(self):
@@ -67,14 +68,14 @@ def set_sections(self, value):
6768

6869
def add_send_each_at(self, time):
6970
if 'send_each_at' not in self.data:
70-
self.data['send_each_at'] = []
71+
self.data['send_each_at'] = []
7172
self.data['send_each_at'].append(time)
7273

7374
def set_send_each_at(self, time):
74-
self.data['send_each_at'] = time
75+
self.data['send_each_at'] = time
7576

7677
def set_send_at(self, time):
77-
self.data['send_at'] = time
78+
self.data['send_at'] = time
7879

7980
def add_filter(self, app, setting, val):
8081
if 'filters' not in self.data:

test/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ def test_license_year(self):
8787
break
8888
self.assertEqual('Copyright (c) 2013-%s SendGrid, Inc.' % datetime.datetime.now().year, copyright_line)
8989

90+
9091
class TestRepository(unittest.TestCase):
9192

9293
def setUp(self):
@@ -122,5 +123,6 @@ def test_repository_files_exists(self):
122123
else:
123124
self.assertTrue(os.path.exists(file_path), msg=self.file_not_found_message.format(file_path))
124125

126+
125127
if __name__ == '__main__':
126128
unittest.main()

test/test_lisence.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import sendgrid
22
from sendgrid.helpers.mail import *
33
from sendgrid.version import __version__
4+
45
try:
56
import unittest2 as unittest
67
except ImportError:
@@ -13,6 +14,7 @@
1314

1415
host = "http://localhost:4010"
1516

17+
1618
def test_license_year(self):
1719
LICENSE_FILE = 'license.txt'
1820
with open(LICENSE_FILE, 'r') as f:

test/test_project.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
except ImportError:
66
import unittest
77

8+
89
class ProjectTests(unittest.TestCase):
910

1011
# ./Docker or docker/Docker
@@ -71,5 +72,6 @@ def test_usage(self):
7172
def test_use_cases(self):
7273
self.assertEqual(True, os.path.isfile('./VERSION.txt'))
7374

75+
7476
if __name__ == '__main__':
7577
unittest.main()

0 commit comments

Comments
 (0)