Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
J
jpush-api-python-client
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
钟尚武
jpush-api-python-client
Commits
210f8430
Commit
210f8430
authored
May 11, 2016
by
fendouai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add status_code to push api
parent
fc8ac49d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
6 deletions
+9
-6
.travis.yml
.travis.yml
+3
-3
core.py
jpush/core.py
+0
-2
core.py
jpush/push/core.py
+6
-1
No files found.
.travis.yml
View file @
210f8430
...
...
@@ -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
:
...
...
jpush/core.py
View file @
210f8430
...
...
@@ -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'
...
...
jpush/push/core.py
View file @
210f8430
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
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment