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
2a55b955
Commit
2a55b955
authored
May 18, 2017
by
Helperhaps
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add tag_not in audience
parent
9f3aafe5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
23 additions
and
2 deletions
+23
-2
push.md
docs/push/push.md
+12
-0
__init__.py
jpush/__init__.py
+3
-1
__init__.py
jpush/push/__init__.py
+2
-0
audience.py
jpush/push/audience.py
+5
-0
payload.py
jpush/push/payload.py
+1
-1
No files found.
docs/push/push.md
View file @
2a55b955
...
...
@@ -55,6 +55,18 @@ tags 例如:tag_and("tag1", "tag2")
返回值
> payload 字典
##### tag_not 设置
```
tag_not(*tag_nots)
```
参数说明
tags 例如:tag_not("tag1", "tag2")
返回值
> payload 字典
##### alias 设置
```
alias(*alias)
...
...
jpush/__init__.py
View file @
2a55b955
...
...
@@ -7,6 +7,7 @@ from .push import (
all_
,
tag
,
tag_and
,
tag_not
,
alias
,
registration_id
,
notification
,
...
...
@@ -48,6 +49,7 @@ __all__ = [
Push
,
tag
,
tag_and
,
tag_not
,
alias
,
registration_id
,
notification
,
...
...
@@ -71,7 +73,7 @@ __all__ = [
schedulepayload
,
]
__version__
=
'3.2.
5
'
__version__
=
'3.2.
6
'
VERSION
=
tuple
(
map
(
int
,
__version__
.
split
(
'.'
)))
# Silence urllib3 INFO logging by default
...
...
jpush/push/__init__.py
View file @
2a55b955
...
...
@@ -3,6 +3,7 @@ from .core import Push
from
.audience
import
(
tag
,
tag_and
,
tag_not
,
alias
,
registration_id
,
)
...
...
@@ -32,6 +33,7 @@ __all__ = [
Push
,
tag
,
tag_and
,
tag_not
,
alias
,
registration_id
,
notification
,
...
...
jpush/push/audience.py
View file @
2a55b955
...
...
@@ -12,6 +12,11 @@ def tag_and(*tag_ands):
vtag_and
=
[
t
for
t
in
tag_ands
]
return
{
"tag_and"
:
vtag_and
}
def
tag_not
(
*
tag_nots
):
"""Select a (list of) tag_not(s)."""
vtag_not
=
[
t
for
t
in
tag_nots
]
return
{
"tag_not"
:
vtag_not
}
def
alias
(
*
alias
):
"""Select a (list of) alias(es)."""
valias
=
[
t
for
t
in
alias
]
...
...
jpush/push/payload.py
View file @
2a55b955
...
...
@@ -196,7 +196,7 @@ def audience(*types):
audience
=
{}
for
t
in
types
:
for
key
in
t
:
if
key
not
in
(
'tag'
,
'tag_and'
,
'alias'
,
'registration_id'
):
if
key
not
in
(
'tag'
,
'tag_and'
,
'
tag_not'
,
'
alias'
,
'registration_id'
):
raise
ValueError
(
"Invalid audience '
%
s'"
%
t
)
audience
[
key
]
=
t
[
key
]
return
audience
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