Commit 210f8430 authored by fendouai's avatar fendouai

add status_code to push api

parent fc8ac49d
......@@ -2,9 +2,9 @@ language: python
python:
- "2.6"
- "2.7"
# - "3.2"
# - "3.3"
# - "3.4"
# - "3.2"
# - "3.3"
# - "3.4"
# command to install dependencies
install:
......
......@@ -17,12 +17,10 @@ class JPush(object):
def __init__(self, key, secret):
self.key = key
self.secret = secret
self.session = requests.Session()
self.session.auth = (key, secret)
def _request(self, method, body, url, content_type=None, version=None, params=None):
headers = {}
headers['user-agent'] = 'jpush-api-python-client'
headers['connection'] = 'keep-alive'
......
import json
import logging
from jpush import core
from jpush import common
logger = logging.getLogger('jpush')
......@@ -77,10 +77,15 @@ class PushResponse(object):
"""
payload = None
status_code = None
def __init__(self, response):
self.status_code = response.status_code
data = response.json()
self.payload = data
def get_status_code(self):
return self.status_code
def __str__(self):
return "Response Payload: {0}".format(self.payload)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment