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
cf31124d
Commit
cf31124d
authored
Sep 01, 2014
by
hupantingxue
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Modify the way to import device module;
parent
f560aba0
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
19 additions
and
7 deletions
+19
-7
example_device.py
examples/example_device.py
+1
-1
__init__.py
jpush/__init__.py
+7
-1
core.py
jpush/core.py
+1
-1
__init__.py
jpush/device/__init__.py
+3
-2
core.py
jpush/device/core.py
+7
-2
No files found.
examples/example_device.py
View file @
cf31124d
...
@@ -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
)
jpush/__init__.py
View file @
cf31124d
...
@@ -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
...
...
jpush/core.py
View file @
cf31124d
...
@@ -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'
)
...
...
jpush/device/__init__.py
View file @
cf31124d
from
.core
import
Device
from
core
import
Device
from
.entity
import
(
from
entity
import
(
add
,
add
,
remove
,
remove
,
device_tag
,
device_tag
,
...
...
jpush/device/core.py
View file @
cf31124d
#!/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
...
...
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