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
3380379e
Commit
3380379e
authored
Jun 03, 2014
by
hupantingxue
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
JPush python client 3.0: fix python indient issue;
parent
25a32298
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
11 deletions
+11
-11
audience.py
jpush/push/audience.py
+1
-1
payload.py
jpush/push/payload.py
+9
-9
test_audience.py
tests/push/test_audience.py
+1
-1
No files found.
jpush/push/audience.py
View file @
3380379e
...
...
@@ -25,4 +25,4 @@ def audience(*children):
{'audience': {'tag': 'sports'}, {'tag_and': 'business'}}
"""
return
{
"audience"
:
{
child
for
child
in
children
}
}
return
{
"audience"
:
[
child
for
child
in
children
]
}
jpush/push/payload.py
View file @
3380379e
...
...
@@ -20,7 +20,7 @@ def notification(alert=None, ios=None, android=None, winphone=None):
if
android
is
not
None
:
payload
[
'android'
]
=
android
if
winphone
is
not
None
:
payload
[
'winphone'
]
=
winphone
payload
[
'winphone'
]
=
winphone
if
not
payload
:
raise
ValueError
(
"Notification body may not be empty"
)
return
payload
...
...
@@ -57,7 +57,7 @@ def ios(alert=None, badge=None, sound=None, content_available=False,
if
sound
is
not
None
:
payload
[
'sound'
]
=
sound
else
:
payload
[
'sound'
]
=
'default'
payload
[
'sound'
]
=
'default'
if
content_available
:
payload
[
'content-available'
]
=
1
if
extra
is
not
None
:
...
...
@@ -83,7 +83,7 @@ def android(alert, title=None, builder_id=None, extras=None):
if
title
is
not
None
:
payload
[
'title'
]
=
collapse_key
if
builder_id
is
not
None
:
payload
[
'builder_id'
]
=
builder_id
payload
[
'builder_id'
]
=
builder_id
if
extra
is
not
None
:
payload
[
'extra'
]
=
extra
return
payload
...
...
@@ -101,11 +101,11 @@ def winphone(alert, title=None, _open_page=None, extras=None):
if
alert
is
not
None
:
payload
[
'alert'
]
=
alert
if
title
is
not
None
:
payload
[
'title'
]
=
title
payload
[
'title'
]
=
title
if
_open_page
is
not
None
:
payload
[
'_open_page'
]
=
_open_page
payload
[
'_open_page'
]
=
_open_page
if
extras
is
not
None
:
payload
[
'extras'
]
=
extras
payload
[
'extras'
]
=
extras
return
payload
def
message
(
msg_content
,
title
=
None
,
content_type
=
None
,
extras
=
None
):
...
...
@@ -121,11 +121,11 @@ def message(msg_content, title=None, content_type=None, extras=None):
'msg_content'
:
msg_content
,
}
if
title
is
not
None
:
payload
[
'title'
]
=
title
payload
[
'title'
]
=
title
if
content_type
is
not
None
:
payload
[
'content_type'
]
=
content_type
if
extras
is
not
None
:
payload
[
'extras'
]
=
extras
payload
[
'extras'
]
=
extras
return
payload
def
platform
(
*
types
):
...
...
@@ -148,4 +148,4 @@ def platform(*types):
def
options
(
options
):
"""Create options object."""
return
{
"options"
:
options
}
return
{
"options"
:
options
}
tests/push/test_audience.py
View file @
3380379e
...
...
@@ -2,7 +2,7 @@ import unittest
import
sys
sys
.
path
.
append
(
'../..'
)
import
jpush
as
jpush
import
jpush
as
jpush
class
TestAudience
(
unittest
.
TestCase
):
...
...
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