Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(70)

Unified Diff: native_client_sdk/src/tools/httpd.py

Issue 720233003: [NaCl SDK] Convert python scripts from optparse to argparse. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « native_client_sdk/src/tools/getos.py ('k') | native_client_sdk/src/tools/lib/tests/quote_test.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: native_client_sdk/src/tools/httpd.py
diff --git a/native_client_sdk/src/tools/httpd.py b/native_client_sdk/src/tools/httpd.py
index ea8d0fbca5041a2c17ef2e4771c80bd46224f67f..059f28b822792d43468d28b57f347bcb247576a4 100755
--- a/native_client_sdk/src/tools/httpd.py
+++ b/native_client_sdk/src/tools/httpd.py
@@ -3,10 +3,10 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
+import argparse
import BaseHTTPServer
import logging
import multiprocessing
-import optparse
import os
import SimpleHTTPServer # pylint: disable=W0611
import socket
@@ -185,13 +185,13 @@ def _HTTPServerProcess(conn, dirname, port, server_kwargs):
def main(args):
- parser = optparse.OptionParser()
- parser.add_option('-C', '--serve-dir',
+ parser = argparse.ArgumentParser()
+ parser.add_argument('-C', '--serve-dir',
help='Serve files out of this directory.',
default=os.path.abspath('.'))
- parser.add_option('-p', '--port',
+ parser.add_argument('-p', '--port',
help='Run server on this port.', default=5103)
- parser.add_option('--no-dir-check', '--no_dir_check',
+ parser.add_argument('--no-dir-check', '--no_dir_check',
help='No check to ensure serving from safe directory.',
dest='do_safe_check', action='store_false', default=True)
@@ -204,7 +204,7 @@ def main(args):
except ImportError:
pass
- options, args = parser.parse_args(args)
+ options = parser.parse_args(args)
if options.do_safe_check:
SanityCheckDirectory(options.serve_dir)
« no previous file with comments | « native_client_sdk/src/tools/getos.py ('k') | native_client_sdk/src/tools/lib/tests/quote_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698