Commit cf31124d authored by hupantingxue's avatar hupantingxue

Modify the way to import device module;

parent f560aba0
......@@ -4,4 +4,4 @@ _jpush = jpush.JPush(app_key, master_secret)
device = _jpush.create_device()
reg_id = '090c1f59f89'
device.get_deviceinfo()
device.get_deviceinfo(reg_id)
......@@ -22,7 +22,7 @@ from .push import (
message,
)
from .device import (
from device import (
Device,
add,
remove,
......@@ -49,6 +49,12 @@ __all__ = [
platform,
audience,
options,
Device,
add,
remove,
device_tag,
device_alias,
device_regid,
]
# Silence urllib3 INFO logging by default
......
......@@ -6,7 +6,7 @@ import requests
from . import common
from .push import Push
from .device import Device
from device import Device
logger = logging.getLogger('jpush')
......
from .core import Device
from .entity import (
from core import Device
from entity import (
add,
remove,
device_tag,
......
#!/usr/bin/env python
from jpush import common
#from jpush import common
DEVICE_BASEURL = "https://device.jpush.cn/"
DEVICE_URL = DEVICE_BASEURL + "v3/device/"
TAG_URL = DEVICE_BASEURL + "v3/tag/"
ALIAS_URL = DEVICE_BASEURL + "v3/alias/"
class Device(object):
"""Device info query/update..
......@@ -21,7 +26,7 @@ class Device(object):
def get_deviceinfo(self, registration_id):
"""Get deviceinfo with registration id
"""
url = common.DEVICE_URL + registration_id
url = DEVICE_URL + registration_id
info = self.send("GET", None, None)
print info
......
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