Commit 2fbc680c authored by linbo's avatar linbo

1. Fix username issue 2. Keep client version accordance with API version

parent b15642a2
......@@ -6,11 +6,10 @@ from jpush import JPushClient
sendno = int(time.time())
username = 'username'
app_key = 'appkey'
master_secret = 'master_secret'
jpush_client = JPushClient(username, master_secret)
jpush_client = JPushClient(master_secret)
# Send message by tag
jpush_client.send_notification_by_tag('tagapi', app_key, sendno, 'des',
......
from .client import JPushClient
__version__ = '0.1.2'
__version__ = '2.0.0'
VERSION = tuple(map(int, __version__.split('.')))
__all__ = ['JPushClient']
......@@ -21,15 +21,13 @@ KEY_PARAMS = [
class JPushClient:
"""JPush Python Client Class"""
def __init__(self, username, master_secret, callback_url=""):
self.username = username
def __init__(self, master_secret, callback_url=""):
self.master_secret = master_secret
self.callback_url = callback_url
def _gen_params(self, kargs):
"""Generate Post params"""
params = {}
params["username"] = self.username
params["callback_url"] = self.callback_url
for k in KEY_PARAMS:
params[k] = kargs.get(k)
......
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