Control socket: minor help text etc. fixups

このコミットが含まれているのは:
n9k 2022-08-12 05:08:53 +00:00
コミット 071edaef3a
3個のファイルの変更12行の追加21行の削除

ファイルの表示

@ -16,7 +16,7 @@ EMOTES = current_app.emotes
async def cmd_emote_help():
normal = ['emote', 'help']
response = (
'Usage: emote [show | reload]\n'
'Usage: emote {show | reload}\n'
'Commands:\n'
' emote show........show all current emotes\n'
' emote reload......try to reload the emote schema (existing messages are not modified)\n'

ファイルの表示

@ -12,7 +12,7 @@ from anonstream.stream import get_stream_title, set_stream_title
async def cmd_title_help():
normal = ['title', 'help']
response = (
'Usage: title [show | set TITLE]\n'
'Usage: title {show | set TITLE}\n'
'Commands:\n'
' title [show].......show the stream title\n'
' title set TITLE....set the stream title to TITLE\n'

ファイルの表示

@ -58,10 +58,8 @@ async def cmd_user_get(user, attr):
except (TypeError, ValueError) as e:
raise CommandFailed('value is not representable in json') from e
normal = [
'user',
'get',
'token',
json_dumps_contiguous(user['token']),
'user', 'get',
'token', json_dumps_contiguous(user['token']),
attr,
]
response = value_json + '\n'
@ -74,10 +72,8 @@ async def cmd_user_set(user, attr, value):
if attr in USER_WEBSOCKET_ATTRS:
USERS_UPDATE_BUFFER.add(user['token'])
normal = [
'user',
'set',
'token',
json_dumps_contiguous(user['token']),
'user', 'set',
'token', json_dumps_contiguous(user['token']),
attr,
json_dumps_contiguous(value),
]
@ -86,11 +82,9 @@ async def cmd_user_set(user, attr, value):
async def cmd_user_eyes_show(user):
normal = [
'user',
'eyes',
'token',
json_dumps_contiguous(user['token']),
'show'
'user', 'eyes',
'token', json_dumps_contiguous(user['token']),
'show',
]
response = json.dumps(user['eyes']['current']) + '\n'
return normal, response
@ -101,12 +95,9 @@ async def cmd_user_eyes_delete(user, eyes_id):
except KeyError:
pass
normal = [
'user',
'eyes',
'token',
json_dumps_contiguous(user['token']),
'delete',
str(eyes_id),
'user', 'eyes',
'token', json_dumps_contiguous(user['token']),
'delete', str(eyes_id),
]
response = ''
return normal, response