botserver: Rename zulip-bot-server to zulip-botserver.

This is consistent with the correct prose "Botserver"
(instead of "Bot-server").
This commit is contained in:
Robert Hönig 2018-05-31 09:26:11 +02:00 committed by Tim Abbott
parent 60c3919deb
commit 3d05b88cc2
5 changed files with 16 additions and 25 deletions

View file

@ -1,9 +1,9 @@
``` ```
zulip-bot-server --config-file <path to botserverrc> --hostname <address> --port <port> zulip-botserver --config-file <path to botserverrc> --hostname <address> --port <port>
``` ```
Example: `zulip-bot-server --config-file ~/botserverrc` Example: `zulip-botserver --config-file ~/botserverrc`
This program loads the bot configurations from the This program loads the bot configurations from the
config file (botserverrc here) and loads the bot modules. config file (botserverrc here) and loads the bot modules.

View file

@ -26,7 +26,7 @@ package_info = dict(
url='https://www.zulip.org/', url='https://www.zulip.org/',
entry_points={ entry_points={
'console_scripts': [ 'console_scripts': [
'zulip-bot-server=zulip_botserver.server:main', 'zulip-botserver=zulip_botserver.server:main',
], ],
}, },
test_suite='tests', test_suite='tests',

View file

@ -122,7 +122,7 @@ class BotServerTests(BotServerTestCase):
token='abcd1234'), token='abcd1234'),
bots_config=bots_config)) bots_config=bots_config))
@mock.patch('sys.argv', ['zulip-bot-server', '--config-file', '/foo/bar/baz.conf']) @mock.patch('sys.argv', ['zulip-botserver', '--config-file', '/foo/bar/baz.conf'])
def test_argument_parsing_defaults(self) -> None: def test_argument_parsing_defaults(self) -> None:
opts = parse_args() opts = parse_args()
assert opts.config_file == '/foo/bar/baz.conf' assert opts.config_file == '/foo/bar/baz.conf'

View file

@ -1,5 +1,5 @@
[program:zulip-bot-server] [program:zulip-botserver]
command=zulip-bot-server --config-file=<path/to/your/botserverrc> --hostname <address> --port <port> command=zulip-botserver --config-file=<path/to/your/botserverrc> --hostname <address> --port <port>
startsecs=3 startsecs=3
stdout_logfile=/var/log/zulip_botserver.log ; all output of your Botserver will be logged here stdout_logfile=/var/log/zulip_botserver.log ; all output of your Botserver will be logged here
redirect_stderr=true redirect_stderr=true

View file

@ -3,50 +3,41 @@ import argparse
def parse_args() -> argparse.Namespace: def parse_args() -> argparse.Namespace:
usage = ''' usage = '''
zulip-bot-server --config-file <path to botserverrc> --hostname <address> --port <port> zulip-botserver --config-file <path/to/botserverrc> [--hostname=<address>] [--port=<port>]
Example1: zulip-bot-server --config-file ~/botserverrc
Example2: zulip-bot-server --config-file ~/botserverrc -b mybotname
(This program loads the bot configurations from the
config file (botserverrc here) and loads the bot modules.
It then starts the server and fetches the requests to the
above loaded modules and returns the success/failure result)
Please make sure you have a current botserverrc file with the
configurations of the required bots.
Hostname and Port are optional arguments. Default hostname is
127.0.0.1 and default port is 5002.
See lib/readme.md for more context.
''' '''
parser = argparse.ArgumentParser(usage=usage) parser = argparse.ArgumentParser(usage=usage)
parser.add_argument( parser.add_argument(
'--config-file', '--config-file', '-c',
action='store', action='store',
required=True, required=True,
help='Config file for the zulip Botserver (botserverrc)' help='Config file for the Botserver. Use your `botserverrc` for multiple bots or'
'`zuliprc` for a single bot.'
) )
parser.add_argument( parser.add_argument(
'--bot-config-file', '--bot-config-file',
action='store', action='store',
default=None, default=None,
help='Config file for third-party bots' help='Config file for bots. Only needed when one of '
'the bots you want to run requires a config file.'
) )
parser.add_argument( parser.add_argument(
'--bot-name', '-b', '--bot-name', '-b',
action='store', action='store',
help='Bot name (optional, rewrites first bot name from config file). ' help='Run a single bot BOT_NAME. Use this option to run the Botserver '
'Only for single-bot usage! Other bots will be ignored' 'with a `zuliprc` config file.'
) )
parser.add_argument( parser.add_argument(
'--hostname', '--hostname',
action='store', action='store',
default="127.0.0.1", default="127.0.0.1",
help='Address on which you want to run the server' help='Address on which you want to run the Botserver. (default: %(default)s)'
) )
parser.add_argument( parser.add_argument(
'--port', '--port',
action='store', action='store',
default=5002, default=5002,
type=int, type=int,
help='Port on which you want to run the server' help='Port on which you want to run the Botserver. (default: %(default)d)'
) )
return parser.parse_args() return parser.parse_args()