(msg)
| 98 | |
| 99 | @itchat.msg_register(itchat.content.TEXT) |
| 100 | def text_reply(msg): |
| 101 | res_txt = None |
| 102 | cmd_dict = { |
| 103 | 'sq' : 'squeue -p VI_Face_V100', |
| 104 | 'sq1': 'squeue -p VI_Face_1080TI' |
| 105 | } |
| 106 | if msg.text in cmd_dict: |
| 107 | cmd = cmd_dict[msg.text] |
| 108 | res_txt = run_and_get(cmd) |
| 109 | elif msg.text.startswith('exec:'): |
| 110 | cmd = msg.text.replace('exec:', '') |
| 111 | if os.system(cmd) == 0: |
| 112 | res_txt = 'exec successed!' |
| 113 | else: |
| 114 | res_txt = 'exec failed!' |
| 115 | elif msg.text.startswith('getinfo:'): |
| 116 | cmd = msg.text.replace('getinfo:', '') |
| 117 | res_txt = run_and_get(cmd) |
| 118 | |
| 119 | if res_txt is not None: |
| 120 | itchat.send(res_txt, toUserName='filehelper') |
| 121 | |
| 122 | itchat.auto_login(enableCmdQR=2, hotReload=True) |
| 123 | itchat.run(True) |
nothing calls this directly
no test coverage detected