Control socket: rename method 'exit' -> 'quit'
このコミットが含まれているのは:
コミット
b9c2d89a5a
|
@ -5,14 +5,14 @@ from anonstream.control.spec import ParseException, Parsed
|
||||||
from anonstream.control.spec.common import Str
|
from anonstream.control.spec.common import Str
|
||||||
from anonstream.control.spec.methods.allowedness import SPEC as SPEC_ALLOWEDNESS
|
from anonstream.control.spec.methods.allowedness import SPEC as SPEC_ALLOWEDNESS
|
||||||
from anonstream.control.spec.methods.chat import SPEC as SPEC_CHAT
|
from anonstream.control.spec.methods.chat import SPEC as SPEC_CHAT
|
||||||
from anonstream.control.spec.methods.exit import SPEC as SPEC_EXIT
|
|
||||||
from anonstream.control.spec.methods.help import SPEC as SPEC_HELP
|
from anonstream.control.spec.methods.help import SPEC as SPEC_HELP
|
||||||
|
from anonstream.control.spec.methods.quit import SPEC as SPEC_QUIT
|
||||||
from anonstream.control.spec.methods.title import SPEC as SPEC_TITLE
|
from anonstream.control.spec.methods.title import SPEC as SPEC_TITLE
|
||||||
from anonstream.control.spec.methods.user import SPEC as SPEC_USER
|
from anonstream.control.spec.methods.user import SPEC as SPEC_USER
|
||||||
|
|
||||||
SPEC = Str({
|
SPEC = Str({
|
||||||
'help': SPEC_HELP,
|
'help': SPEC_HELP,
|
||||||
'exit': SPEC_EXIT,
|
'quit': SPEC_QUIT,
|
||||||
'title': SPEC_TITLE,
|
'title': SPEC_TITLE,
|
||||||
'chat': SPEC_CHAT,
|
'chat': SPEC_CHAT,
|
||||||
'user': SPEC_USER,
|
'user': SPEC_USER,
|
||||||
|
|
|
@ -9,7 +9,7 @@ async def cmd_help():
|
||||||
'Usage: METHOD [COMMAND | help]\n'
|
'Usage: METHOD [COMMAND | help]\n'
|
||||||
'Examples:\n'
|
'Examples:\n'
|
||||||
' help...........................show this help message\n'
|
' help...........................show this help message\n'
|
||||||
' exit...........................close the control connection\n'
|
' quit...........................close the control connection\n'
|
||||||
' title [show]...................show the stream title\n'
|
' title [show]...................show the stream title\n'
|
||||||
' title set TITLE................set the stream title\n'
|
' title set TITLE................set the stream title\n'
|
||||||
' user [show]....................show a list of users\n'
|
' user [show]....................show a list of users\n'
|
||||||
|
|
|
@ -4,19 +4,19 @@
|
||||||
from anonstream.control.spec.common import Str, End
|
from anonstream.control.spec.common import Str, End
|
||||||
from anonstream.control.exceptions import ControlSocketExit
|
from anonstream.control.exceptions import ControlSocketExit
|
||||||
|
|
||||||
async def cmd_exit():
|
async def cmd_quit():
|
||||||
raise ControlSocketExit
|
raise ControlSocketExit
|
||||||
|
|
||||||
async def cmd_exit_help():
|
async def cmd_quit_help():
|
||||||
normal = ['exit', 'help']
|
normal = ['quit', 'help']
|
||||||
response = (
|
response = (
|
||||||
'Usage: exit\n'
|
'Usage: quit\n'
|
||||||
'Commands:\n'
|
'Commands:\n'
|
||||||
' exit......close the connection\n'
|
' quit......close the connection\n'
|
||||||
)
|
)
|
||||||
return normal, response
|
return normal, response
|
||||||
|
|
||||||
SPEC = Str({
|
SPEC = Str({
|
||||||
None: End(cmd_exit),
|
None: End(cmd_quit),
|
||||||
'help': End(cmd_exit_help),
|
'help': End(cmd_quit_help),
|
||||||
})
|
})
|
読み込み中…
新しいイシューから参照