anonstream/anonstream/control/spec/methods/exit.py

23 行
549 B
Python
Raw 通常表示 履歴

2022-06-16 10:23:11 +09:00
# SPDX-FileCopyrightText: 2022 n9k <https://git.076.ne.jp/ninya9k>
# SPDX-License-Identifier: AGPL-3.0-or-later
from anonstream.control.spec.common import Str, End
2022-06-16 10:05:18 +09:00
from anonstream.control.exceptions import ControlSocketExit
async def cmd_exit():
2022-06-16 10:05:18 +09:00
raise ControlSocketExit
async def cmd_exit_help():
normal = ['exit', 'help']
response = (
'Usage: exit\n'
2022-07-24 14:18:25 +09:00
'Commands:\n'
' exit......close the connection\n'
)
return normal, response
SPEC = Str({
None: End(cmd_exit),
'help': End(cmd_exit_help),
})