-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest-feedback
More file actions
executable file
·43 lines (26 loc) · 1.03 KB
/
Copy pathtest-feedback
File metadata and controls
executable file
·43 lines (26 loc) · 1.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/usr/bin/env python
import optparse
from tornado import ioloop
from APNsFeedBackService import APNsFeedBackService
parser = optparse.OptionParser()
parser.add_option("-c", "--cert-file",
dest="cert_file",
help="Path to .pem certificate file")
parser.add_option("-k", "--key-file",
dest="key_file",
help="Path to .pem key file")
parser.add_option("-n", "--data-num",
dest="data_num",
help="Feedback data num")
options, args = parser.parse_args()
if options.cert_file is None:
parser.error('Must provide --cert-file')
if options.key_file is None:
parser.error('Must provide --key-file')
if options.data_num is None:
parser.error('Must provide --data-num')
test_server = APNsFeedBackService(cert_file=options.cert_file,
key_file=options.key_file,
data_num=int(options.data_num))
test_server.listen(2196)
ioloop.IOLoop.instance().start()