File tree Expand file tree Collapse file tree 2 files changed +42
-1
lines changed Expand file tree Collapse file tree 2 files changed +42
-1
lines changed Original file line number Diff line number Diff line change 1212from . import schedule_example
1313from . import group_push_example
1414from . import admin_example
15+ from . import zone_example
1516
1617__all__ = [
1718 device_example ,
1819 push_example ,
1920 report_example ,
2021 schedule_example ,
2122 group_push_example ,
22- admin_example
23+ admin_example ,
24+ zone_example ,
2325]
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