File tree 2 files changed +42
-1
lines changed
2 files changed +42
-1
lines changed Original file line number Diff line number Diff line change 12
12
from . import schedule_example
13
13
from . import group_push_example
14
14
from . import admin_example
15
+ from . import zone_example
15
16
16
17
__all__ = [
17
18
device_example ,
18
19
push_example ,
19
20
report_example ,
20
21
schedule_example ,
21
22
group_push_example ,
22
- admin_example
23
+ admin_example ,
24
+ zone_example ,
23
25
]
Original file line number Diff line number Diff line change
1
+ from . import jpush , app_key , master_secret
2
+
3
+ def default ():
4
+ _jpush = jpush .JPush (app_key , master_secret )
5
+ _jpush .set_logging ("DEBUG" )
6
+
7
+ push = _jpush .create_push ()
8
+ push .audience = jpush .all_
9
+ push .notification = jpush .notification (alert = "!hello python jpush api" )
10
+ push .platform = jpush .all_
11
+ try :
12
+ response = push .send ()
13
+ except common .Unauthorized :
14
+ raise common .Unauthorized ("Unauthorized" )
15
+ except common .APIConnectionException :
16
+ raise common .APIConnectionException ("conn" )
17
+ except common .JPushFailure :
18
+ print ("JPushFailure" )
19
+ except :
20
+ print ("Exception" )
21
+
22
+ def bj ():
23
+ _jpush = jpush .JPush (app_key , master_secret , zone = 'bj' )
24
+ _jpush .set_logging ("DEBUG" )
25
+
26
+ push = _jpush .create_push ()
27
+ push .audience = jpush .all_
28
+ push .notification = jpush .notification (alert = "!hello python jpush api" )
29
+ push .platform = jpush .all_
30
+ try :
31
+ response = push .send ()
32
+ except common .Unauthorized :
33
+ raise common .Unauthorized ("Unauthorized" )
34
+ except common .APIConnectionException :
35
+ raise common .APIConnectionException ("conn" )
36
+ except common .JPushFailure :
37
+ print ("JPushFailure" )
38
+ except :
39
+ print ("Exception" )
You can’t perform that action at this time.
0 commit comments