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
b52d7285
Commit
b52d7285
authored
Apr 25, 2016
by
fendouai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix logging
parent
94c3a9d9
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
12 additions
and
5 deletions
+12
-5
.gitignore
.gitignore
+2
-1
example_updevice.py
examples/device/example_updevice.py
+0
-1
example_all.py
examples/push/example_all.py
+3
-2
core.py
jpush/core.py
+7
-1
No files found.
.gitignore
View file @
b52d7285
...
...
@@ -3,4 +3,4 @@ build/
dist/
jpush.egg-info/
.idea/
jpush.log
\ No newline at end of file
examples/device/example_updevice.py
View file @
b52d7285
...
...
@@ -5,5 +5,4 @@ _jpush = jpush.JPush(app_key, master_secret)
device
=
_jpush
.
create_device
()
reg_id
=
'1507bfd3f7c466c355c'
entity
=
jpush
.
device_tag
(
jpush
.
add
(
"ddd"
,
"tageee"
))
#entity = jpush.device_tag("")
device
.
set_devicemobile
(
reg_id
,
entity
)
examples/push/example_all.py
View file @
b52d7285
import
jpush
as
jpush
from
jpush
import
core
from
conf
import
app_key
,
master_secret
_jpush
=
jpush
.
JPush
(
app_key
,
master_secret
)
push
=
_jpush
.
create_push
()
push
.
audience
=
jpush
.
all_
push
.
notification
=
jpush
.
notification
(
alert
=
"Hello,
world
!"
)
push
.
notification
=
jpush
.
notification
(
alert
=
"Hello,
python sdk
!"
)
push
.
platform
=
jpush
.
all_
core
.
logger
.
debug
(
'logger debug message test'
)
push
.
send
()
jpush/core.py
View file @
b52d7285
...
...
@@ -9,10 +9,16 @@ from .push import Push
from
.device
import
Device
from
.report
import
Report
from
.schedule
import
Schedule
logger
=
logging
.
getLogger
(
'jpush'
)
logging
.
basicConfig
(
level
=
logging
.
DEBUG
,
format
=
'
%(asctime)
s
%(filename)
s[line:
%(lineno)
d]
%(levelname)
s
%(message)
s'
,
datefmt
=
'
%
a,
%
d
%
b
%
Y
%
H:
%
M:
%
S'
,
filename
=
'log/jpush.log'
,
filemode
=
'w'
)
class
JPush
(
object
):
def
__init__
(
self
,
key
,
secret
):
self
.
key
=
key
self
.
secret
=
secret
...
...
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