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
af69dfb1
Commit
af69dfb1
authored
Jun 02, 2014
by
hupantingxue
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add options object;
parent
5b8d8f98
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
10 deletions
+6
-10
audience.py
jpush/push/audience.py
+1
-8
payload.py
jpush/push/payload.py
+5
-2
No files found.
jpush/push/audience.py
View file @
af69dfb1
import
re
DEVICE_TOKEN_FORMAT
=
re
.
compile
(
r'^[0-9a-fA-F]{64}$'
)
PIN_FORMAT
=
re
.
compile
(
r'^[0-9a-fA-F]{8}$'
)
UUID_FORMAT
=
re
.
compile
(
r'^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}'
r'-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$'
)
# Value selectors; device IDs, aliases, tags, etc.
# Value selectors; aliases, tags, etc.
def
tag
(
tag
):
"""Select a single tag."""
...
...
jpush/push/payload.py
View file @
af69dfb1
...
...
@@ -3,7 +3,6 @@ import re
# Valid autobadge values: auto, +N, -N
VALID_AUTOBADGE
=
re
.
compile
(
r'^(auto|[+-][\d]+)$'
)
def
notification
(
alert
=
None
,
ios
=
None
,
android
=
None
,
winphone
=
None
):
"""Create a notification payload.
...
...
@@ -137,7 +136,7 @@ def platform(*types):
>>> platform('ios', 'symbian')
Traceback (most recent call last):
...
ValueError: Invalid
device type
'symbian'
ValueError: Invalid
platform
'symbian'
"""
if
len
(
types
)
==
1
and
types
[
0
]
==
'all'
:
...
...
@@ -146,3 +145,7 @@ def platform(*types):
if
t
not
in
(
'ios'
,
'android'
,
'winphone'
):
raise
ValueError
(
"Invalid platform '
%
s'"
%
t
)
return
[
t
for
t
in
types
]
def
options
(
options
):
"""Create options object."""
return
{
"options"
:
options
}
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