Skip to content

Commit 45f9c93

Browse files
Version Bump v3.2.1: pep8, PyPi fixes
1 parent 658f6ca commit 45f9c93

File tree

7 files changed

+30
-11
lines changed

7 files changed

+30
-11
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Change Log
22
All notable changes to this project will be documented in this file.
3+
## [3.2.1] - 2016-08-17 ##
4+
### Fixed
5+
- pep8 formatting
6+
- include Heroku config files in PyPi
37

48
## [3.2.0] - 2016-08-17 ##
59
### Added

MANIFEST.in

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
include README.rst
22
include LICENSE.txt
3+
include app.json
4+
include Procfile
5+
include requirements.txt
36
recursive-exclude test *

sendgrid/helpers/inbound/app.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,13 @@
1717
app = Flask(__name__)
1818
config = Config()
1919

20-
@app.route ('/', methods =['GET'])
20+
21+
@app.route('/', methods=['GET'])
2122
def index():
2223
return render_template('index.html')
2324

24-
@app.route (config.endpoint, methods =['POST'])
25+
26+
@app.route(config.endpoint, methods=['POST'])
2527
def inbound_parse():
2628
parse = Parse(config, request)
2729
# Sample proccessing action
@@ -30,9 +32,10 @@ def inbound_parse():
3032
# Everything is 200 OK :)
3133
return "OK"
3234

33-
if __name__=='__main__':
35+
36+
if __name__ == '__main__':
3437
# Be sure to set config.debug_mode to False in production
3538
port = int(os.environ.get("PORT", config.port))
3639
if port != config.port:
3740
config.debug = False
38-
app.run(host = '0.0.0.0', debug=config.debug_mode, port=port)
41+
app.run(host='0.0.0.0', debug=config.debug_mode, port=port)

sendgrid/helpers/inbound/config.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import os
33
import yaml
44

5+
56
class Config(object):
67
"""All configuration for this app is loaded here"""
78
def __init__(self):

sendgrid/helpers/inbound/parse.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import mimetypes
55
from werkzeug.utils import secure_filename
66

7+
78
class Parse(object):
89
def __init__(self, config, request):
910
self._keys = config.keys
@@ -12,7 +13,8 @@ def __init__(self, config, request):
1213
self._payload = request.form
1314
self._raw_payload = request.data
1415

15-
"""Return a dictionary of key/values in the payload received from the webhook"""
16+
"""Return a dictionary of key/values in the payload received from
17+
the webhook"""
1618
def key_values(self):
1719
key_values = {}
1820
for key in self.keys:
@@ -49,7 +51,7 @@ def attachments(self):
4951
# Check if we have a raw message
5052
attachments = []
5153
raw_email = self.get_raw_email()
52-
if raw_email != None:
54+
if raw_email is not None:
5355
counter = 1
5456
for part in raw_email.walk():
5557
attachment = {}
@@ -83,4 +85,4 @@ def payload(self):
8385

8486
@property
8587
def raw_payload(self):
86-
return self._raw_payload
88+
return self._raw_payload

sendgrid/helpers/inbound/send.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
from sendgrid.helpers.inbound.config import Config
1111
from python_http_client import Client
1212

13+
1314
class Send(object):
1415
def __init__(self, url):
1516
self._url = url
@@ -30,11 +31,16 @@ def url(self):
3031

3132
config = Config()
3233
parser = argparse.ArgumentParser(description='Test data and optional host.')
33-
parser.add_argument('data', type=str, help='path to the sample data')
34-
parser.add_argument('-host', type=str, help='name of host to send the sample data to', default=config.host, required=False)
34+
parser.add_argument('data',
35+
type=str,
36+
help='path to the sample data')
37+
parser.add_argument('-host',
38+
type=str,
39+
help='name of host to send the sample data to',
40+
default=config.host, required=False)
3541
args = parser.parse_args()
3642
send = Send(args.host)
3743
response = send.test_payload(sys.argv[1])
3844
print(response.status_code)
3945
print(response.headers)
40-
print(response.body)
46+
print(response.body)

sendgrid/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
version_info = (3, 2, 0)
1+
version_info = (3, 2, 1)
22
__version__ = '.'.join(str(v) for v in version_info)

0 commit comments

Comments
 (0)