Index: cms/bin/test_server.py |
=================================================================== |
--- a/cms/bin/test_server.py |
+++ b/cms/bin/test_server.py |
@@ -119,20 +119,14 @@ |
if __name__ == "__main__": |
parser = argparse.ArgumentParser(description='CMS testing server.') |
- parser.add_argument('-b', '--basepath', type=str, help='Base directory (EG: /path/to/web.eyeo.com)') |
- parser.add_argument('-n', '--hostname', type=str, help='Server hostname (EG: localhost, eyeo.com, 0.0.0.0)') |
- parser.add_argument('-p', '--port', type=str, help='Port number (EG: 8080, 5000)') |
+ parser.add_argument('basepath', nargs='?', default=os.curdir) |
Sebastian Noack
2016/01/20 17:46:25
Nit: I would simply call it "path".
juliandoucette
2016/01/21 13:46:24
Done.
|
+ parser.add_argument('-n', '--hostname', default='localhost', type=str, help='Server hostname (EG: localhost, example.com, 0.0.0.0)') |
Sebastian Noack
2016/01/20 17:46:25
Nit: "Address of the interface the server will lis
Sebastian Noack
2016/01/20 17:46:25
type=str is the default. How about omitting it, if
Sebastian Noack
2016/01/20 18:00:55
--address would be a better name for the option, a
juliandoucette
2016/01/21 13:46:24
Done.
juliandoucette
2016/01/21 13:46:24
Acknowledged.
juliandoucette
2016/01/21 13:46:24
Done.
|
+ parser.add_argument('-p', '--port', default='5000', type=str, help='Port number (EG: 8080, 5000)') |
Sebastian Noack
2016/01/20 17:46:25
How about type=int? Then you don't need to convert
juliandoucette
2016/01/21 13:46:23
Done.
|
args = parser.parse_args() |
- # for backwards compatibility |
- if len(sys.argv) > 1 and os.path.isdir(sys.argv[1]): |
- source = FileSource(sys.argv[1]) |
- hostname = 'localhost' |
- port = 5000 |
- else: |
- source = FileSource(args.basepath or os.curdir) |
- hostname = args.hostname or 'localhost' |
- port = int(args.port or '5000') |
+ source = FileSource(args.basepath) |
+ hostname = args.hostname |
+ port = int(args.port) |
try: |
from werkzeug.serving import ThreadedWSGIServer, run_simple |