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