Ori.livneh has uploaded a new change for review. https://gerrit.wikimedia.org/r/49470
Change subject: Improve comment and argument parsing ...................................................................... Improve comment and argument parsing Change-Id: I43544631347bc95a3c1cf22f12dad7cfecc3c599 --- M server/bin/eventlogging-devserver 1 file changed, 24 insertions(+), 7 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/EventLogging refs/changes/70/49470/1 diff --git a/server/bin/eventlogging-devserver b/server/bin/eventlogging-devserver index 2a76e28..66b27da 100755 --- a/server/bin/eventlogging-devserver +++ b/server/bin/eventlogging-devserver @@ -1,15 +1,30 @@ #!/usr/bin/env python # -*- coding: utf8 -*- """ - el-devserver - ------------ + eventlogging-devserver + ---------------------- + + Invoking this command-line tool will spawn a web server that can serve + as a test logging endpoint. Events logged against this server will be + validated verbosely and pretty-printed to the terminal. + + To use this, you probably want to set '$wgEventLoggingBaseUri' on your + test wiki to point at the host and port of this web server. The value + '//localhost:8080/event.gif' should work. + + usage: eventlogging-devserver [-h] [--host HOST] [--port PORT] + + optional arguments: + -h, --help show this help message and exit + --iface HOST server iface (default: 0.0.0.0) + --port PORT server port (default: 8080) :copyright: (c) 2012 by Ori Livneh <[email protected]> :license: GNU General Public Licence 2.0 or later """ # pylint: disable=E0611 -from __future__ import print_function +from __future__ import print_function, unicode_literals import argparse import itertools @@ -26,8 +41,10 @@ argparser = argparse.ArgumentParser() -argparser.add_argument('--host', default='0.0.0.0') -argparser.add_argument('--port', default=8080, type=int) +argparser.add_argument('--iface', default='0.0.0.0', + help='server iface (default: 0.0.0.0)') +argparser.add_argument('--port', default=8080, type=int, + help='server port (default: 8080)') args = argparser.parse_args() lexer = JSONLexer() @@ -108,10 +125,10 @@ return [] -httpd = make_server(args.host, args.port, handle_event, +httpd = make_server(args.iface, args.port, handle_event, handler_class=EventLoggingHandler) -print('EventLogging DevServer running on %s:%s...' % (args.host, args.port)) +print('EventLogging DevServer running on %s:%s...' % (args.iface, args.port)) try: httpd.serve_forever() -- To view, visit https://gerrit.wikimedia.org/r/49470 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I43544631347bc95a3c1cf22f12dad7cfecc3c599 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/EventLogging Gerrit-Branch: master Gerrit-Owner: Ori.livneh <[email protected]> _______________________________________________ MediaWiki-commits mailing list [email protected] https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
