Skip to content

Commit 210f843

Browse files
committed
add status_code to push api
1 parent fc8ac49 commit 210f843

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

.travis.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ language: python
22
python:
33
- "2.6"
44
- "2.7"
5-
# - "3.2"
6-
# - "3.3"
7-
# - "3.4"
5+
# - "3.2"
6+
# - "3.3"
7+
# - "3.4"
88

99
# command to install dependencies
1010
install:

jpush/core.py

-2
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,10 @@ class JPush(object):
1717
def __init__(self, key, secret):
1818
self.key = key
1919
self.secret = secret
20-
2120
self.session = requests.Session()
2221
self.session.auth = (key, secret)
2322

2423
def _request(self, method, body, url, content_type=None, version=None, params=None):
25-
2624
headers = {}
2725
headers['user-agent'] = 'jpush-api-python-client'
2826
headers['connection'] = 'keep-alive'

jpush/push/core.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import json
22
import logging
3-
3+
from jpush import core
44
from jpush import common
55

66
logger = logging.getLogger('jpush')
@@ -77,10 +77,15 @@ class PushResponse(object):
7777
7878
"""
7979
payload = None
80+
status_code = None
8081

8182
def __init__(self, response):
83+
self.status_code = response.status_code
8284
data = response.json()
8385
self.payload = data
8486

87+
def get_status_code(self):
88+
return self.status_code
89+
8590
def __str__(self):
8691
return "Response Payload: {0}".format(self.payload)

0 commit comments

Comments
 (0)