From f33baacd02203a0fec15316d1fd6789de47a8e92 Mon Sep 17 00:00:00 2001 From: Abhijeet Kaur Date: Tue, 23 May 2017 03:13:12 +0530 Subject: [PATCH] Updates get_help() function in 'virtual_fs' bot. Update example commands from calling by keyword 'fs' (As was done previously) to calling by at-mention of the bot. Updates '/contrib_bots/bots/virtual_fs/virtual_fs.py' by correcting instructions on how to call 'virtual_fs' bot. --- .../bots/virtual_fs/test_virtual_fs.py | 44 +++++++++---------- contrib_bots/bots/virtual_fs/virtual_fs.py | 22 +++++----- 2 files changed, 33 insertions(+), 33 deletions(-) diff --git a/contrib_bots/bots/virtual_fs/test_virtual_fs.py b/contrib_bots/bots/virtual_fs/test_virtual_fs.py index a7295eb..2252f17 100644 --- a/contrib_bots/bots/virtual_fs/test_virtual_fs.py +++ b/contrib_bots/bots/virtual_fs/test_virtual_fs.py @@ -30,21 +30,21 @@ class TestVirtualFsBot(BotTestCase): ) self.assert_bot_output( {'content': "help", 'type': "stream", 'display_recipient': "foo", 'subject': "foo", 'sender_email': "foo_sender@zulip.com"}, - ('foo_sender@zulip.com:\n\nThe "fs" commands implement a virtual file system for a stream.\n' + ('foo_sender@zulip.com:\n\nThis bot implements a virtual file system for a stream.\n' 'The locations of text are persisted for the lifetime of the bot\n' 'running, and if you rename a stream, you will lose the info.\n' 'Example commands:\n\n```\n' - 'fs sample_conversation: sample conversation with the bot\n' - 'fs mkdir: create a directory\n' - 'fs ls: list a directory\n' - 'fs cd: change directory\n' - 'fs pwd: show current path\n' - 'fs write: write text\n' - 'fs read: read text\n' - 'fs rm: remove a file\n' - 'fs rmdir: remove a directory\n' + '@mention-bot sample_conversation: sample conversation with the bot\n' + '@mention-bot mkdir: create a directory\n' + '@mention-bot ls: list a directory\n' + '@mention-bot cd: change directory\n' + '@mention-bot pwd: show current path\n' + '@mention-bot write: write text\n' + '@mention-bot read: read text\n' + '@mention-bot rm: remove a file\n' + '@mention-bot rmdir: remove a directory\n' '```\n' - 'Use commands like `fs help write` for more details on specific\ncommands.\n'), + 'Use commands like `@mention-bot help write` for more details on specific\ncommands.\n'), ) self.assert_bot_output( {'content': "help ls", 'type': "stream", 'display_recipient': "foo", 'subject': "foo", 'sender_email': "foo_sender@zulip.com"}, @@ -52,19 +52,19 @@ class TestVirtualFsBot(BotTestCase): ) self.assert_bot_output( {'content': "", 'type': "stream", 'display_recipient': "foo", 'subject': "foo", 'sender_email': "foo_sender@zulip.com"}, - ('foo_sender@zulip.com:\n\nThe "fs" commands implement a virtual file system for a stream.\n' + ('foo_sender@zulip.com:\n\nThis bot implements a virtual file system for a stream.\n' 'The locations of text are persisted for the lifetime of the bot\n' 'running, and if you rename a stream, you will lose the info.\n' 'Example commands:\n\n```\n' - 'fs sample_conversation: sample conversation with the bot\n' - 'fs mkdir: create a directory\n' - 'fs ls: list a directory\n' - 'fs cd: change directory\n' - 'fs pwd: show current path\n' - 'fs write: write text\n' - 'fs read: read text\n' - 'fs rm: remove a file\n' - 'fs rmdir: remove a directory\n' + '@mention-bot sample_conversation: sample conversation with the bot\n' + '@mention-bot mkdir: create a directory\n' + '@mention-bot ls: list a directory\n' + '@mention-bot cd: change directory\n' + '@mention-bot pwd: show current path\n' + '@mention-bot write: write text\n' + '@mention-bot read: read text\n' + '@mention-bot rm: remove a file\n' + '@mention-bot rmdir: remove a directory\n' '```\n' - 'Use commands like `fs help write` for more details on specific\ncommands.\n'), + 'Use commands like `@mention-bot help write` for more details on specific\ncommands.\n'), ) diff --git a/contrib_bots/bots/virtual_fs/virtual_fs.py b/contrib_bots/bots/virtual_fs/virtual_fs.py index 3faa96c..239ede3 100644 --- a/contrib_bots/bots/virtual_fs/virtual_fs.py +++ b/contrib_bots/bots/virtual_fs/virtual_fs.py @@ -37,23 +37,23 @@ class VirtualFsHandler(object): def get_help(): return ''' -The "fs" commands implement a virtual file system for a stream. +This bot implements a virtual file system for a stream. The locations of text are persisted for the lifetime of the bot running, and if you rename a stream, you will lose the info. Example commands: ``` -fs sample_conversation: sample conversation with the bot -fs mkdir: create a directory -fs ls: list a directory -fs cd: change directory -fs pwd: show current path -fs write: write text -fs read: read text -fs rm: remove a file -fs rmdir: remove a directory +@mention-bot sample_conversation: sample conversation with the bot +@mention-bot mkdir: create a directory +@mention-bot ls: list a directory +@mention-bot cd: change directory +@mention-bot pwd: show current path +@mention-bot write: write text +@mention-bot read: read text +@mention-bot rm: remove a file +@mention-bot rmdir: remove a directory ``` -Use commands like `fs help write` for more details on specific +Use commands like `@mention-bot help write` for more details on specific commands. '''