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
config file (botserverrc here) and loads the bot modules.

View file

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

View file

@ -122,7 +122,7 @@ class BotServerTests(BotServerTestCase):
token='abcd1234'),
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:
opts = parse_args()
assert opts.config_file == '/foo/bar/baz.conf'

View file

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

View file

@ -3,50 +3,41 @@ import argparse
def parse_args() -> argparse.Namespace:
usage = '''
zulip-bot-server --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.
zulip-botserver --config-file <path/to/botserverrc> [--hostname=<address>] [--port=<port>]
'''
parser = argparse.ArgumentParser(usage=usage)
parser.add_argument(
'--config-file',
'--config-file', '-c',
action='store',
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(
'--bot-config-file',
action='store',
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(
'--bot-name', '-b',
action='store',
help='Bot name (optional, rewrites first bot name from config file). '
'Only for single-bot usage! Other bots will be ignored'
help='Run a single bot BOT_NAME. Use this option to run the Botserver '
'with a `zuliprc` config file.'
)
parser.add_argument(
'--hostname',
action='store',
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(
'--port',
action='store',
default=5002,
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()