16
16
slack_token = utils .get_token ('res/token_slack.json' )
17
17
pool = cf .ThreadPoolExecutor (4 )
18
18
19
- extension_calibration = '_calibration_full.png'
19
+ extension_gateerrors = '_gateerrors_full.png'
20
+ extension_readouterrors = '_readouterrors_full.png'
20
21
extension_jobs = '_jobs_full.png'
21
22
extension_full = '_full.png'
22
23
@@ -36,9 +37,12 @@ def confirm():
36
37
if value .endswith (extension_jobs ):
37
38
name = 'Pending jobs for {}' .format (backend )
38
39
reply = '*Pending jobs* for {} will be sent soon ...' .format (backend )
39
- elif value .endswith (extension_calibration ):
40
- name = 'Calibration info for {}' .format (backend )
41
- reply = '*Calibration info* for {} will be sent soon ...' .format (backend )
40
+ elif value .endswith (extension_gateerrors ):
41
+ name = 'Gate errors for {}' .format (backend )
42
+ reply = '*Gate errors* for {} will be sent soon ...' .format (backend )
43
+ elif value .endswith (extension_readouterrors ):
44
+ name = 'Readout errors for {}' .format (backend )
45
+ reply = '*Readout errors* for {} will be sent soon ...' .format (backend )
42
46
elif value .endswith (extension_full ):
43
47
name = 'Full statistics for {}' .format (backend )
44
48
reply = '*Full statistics* for {} will be sent soon ...' .format (backend )
@@ -52,18 +56,33 @@ def confirm():
52
56
###
53
57
# Bot Commands
54
58
###
55
- @app .route ('/calibration ' , methods = ['POST' ])
56
- def calibration ():
59
+ @app .route ('/gateerrors ' , methods = ['POST' ])
60
+ def gateerrors ():
57
61
data = request .form .to_dict ()
58
62
backend = data ['text' ].lower ()
59
63
60
64
if backend in utils .backends :
61
- name = 'Calibration info for {}' .format (backend )
62
- pool .submit (send_image , 'tmp/{}{}' .format (backend , extension_calibration ),
65
+ name = 'Gate errors for {}' .format (backend )
66
+ pool .submit (send_image , 'tmp/{}{}' .format (backend , extension_gateerrors ),
63
67
name , data ['channel_id' ])
64
68
return "Wait a sec ..."
65
69
else :
66
- send_buttons (data ["response_url" ], extension_calibration )
70
+ send_buttons (data ["response_url" ], extension_gateerrors )
71
+ return ''
72
+
73
+
74
+ @app .route ('/readouterrors' , methods = ['POST' ])
75
+ def readouterrors ():
76
+ data = request .form .to_dict ()
77
+ backend = data ['text' ].lower ()
78
+
79
+ if backend in utils .backends :
80
+ name = 'Gate errors for {}' .format (backend )
81
+ pool .submit (send_image , 'tmp/{}{}' .format (backend , extension_readouterrors ),
82
+ name , data ['channel_id' ])
83
+ return "Wait a sec ..."
84
+ else :
85
+ send_buttons (data ["response_url" ], extension_readouterrors )
67
86
return ''
68
87
69
88
0 commit comments