Commit af69dfb1 authored by hupantingxue's avatar hupantingxue

Add options object;

parent 5b8d8f98
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."""
......
......@@ -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}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment