Skip to content

Commit 2a55b95

Browse files
author
Helperhaps
committed
add tag_not in audience
1 parent 9f3aafe commit 2a55b95

File tree

5 files changed

+23
-2
lines changed

5 files changed

+23
-2
lines changed

Diff for: docs/push/push.md

+12
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,18 @@ tags 例如:tag_and("tag1", "tag2")
5555
返回值
5656
> payload 字典
5757
58+
##### tag_not 设置
59+
```
60+
tag_not(*tag_nots)
61+
```
62+
63+
参数说明
64+
65+
tags 例如:tag_not("tag1", "tag2")
66+
67+
返回值
68+
> payload 字典
69+
5870
##### alias 设置
5971
```
6072
alias(*alias)

Diff for: jpush/__init__.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
all_,
88
tag,
99
tag_and,
10+
tag_not,
1011
alias,
1112
registration_id,
1213
notification,
@@ -48,6 +49,7 @@
4849
Push,
4950
tag,
5051
tag_and,
52+
tag_not,
5153
alias,
5254
registration_id,
5355
notification,
@@ -71,7 +73,7 @@
7173
schedulepayload,
7274
]
7375

74-
__version__ = '3.2.5'
76+
__version__ = '3.2.6'
7577
VERSION = tuple(map(int, __version__.split('.')))
7678

7779
# Silence urllib3 INFO logging by default

Diff for: jpush/push/__init__.py

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
from .audience import (
44
tag,
55
tag_and,
6+
tag_not,
67
alias,
78
registration_id,
89
)
@@ -32,6 +33,7 @@
3233
Push,
3334
tag,
3435
tag_and,
36+
tag_not,
3537
alias,
3638
registration_id,
3739
notification,

Diff for: jpush/push/audience.py

+5
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@ def tag_and(*tag_ands):
1212
vtag_and = [t for t in tag_ands]
1313
return {"tag_and": vtag_and}
1414

15+
def tag_not(*tag_nots):
16+
"""Select a (list of) tag_not(s)."""
17+
vtag_not = [t for t in tag_nots]
18+
return {"tag_not": vtag_not}
19+
1520
def alias(*alias):
1621
"""Select a (list of) alias(es)."""
1722
valias = [t for t in alias]

Diff for: jpush/push/payload.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ def audience(*types):
196196
audience = {}
197197
for t in types:
198198
for key in t:
199-
if key not in ('tag', 'tag_and', 'alias', 'registration_id'):
199+
if key not in ('tag', 'tag_and', 'tag_not', 'alias', 'registration_id'):
200200
raise ValueError("Invalid audience '%s'" % t)
201201
audience[key] = t[key]
202202
return audience

0 commit comments

Comments
 (0)