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

Unified Diff: native_client_sdk/src/build_tools/update_nacl_manifest.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
Index: native_client_sdk/src/build_tools/update_nacl_manifest.py
diff --git a/native_client_sdk/src/build_tools/update_nacl_manifest.py b/native_client_sdk/src/build_tools/update_nacl_manifest.py
index c93198bc19de360e664778c50c735fa2bfaaf68e..d60f0983fb2c06062499f3d389d53d117ae0f473 100755
--- a/native_client_sdk/src/build_tools/update_nacl_manifest.py
+++ b/native_client_sdk/src/build_tools/update_nacl_manifest.py
@@ -10,6 +10,7 @@ in manifest.
# pylint is convinced the email module is missing attributes
# pylint: disable=E1101
+import argparse
import buildbot_common
import csv
import cStringIO
@@ -18,7 +19,6 @@ import email
import logging
import logging.handlers
import manifest_util
-import optparse
import os
import posixpath
import re
@@ -879,24 +879,25 @@ class CapturedFile(object):
def main(args):
- parser = optparse.OptionParser()
- parser.add_option('--gsutil', help='path to gsutil.')
- parser.add_option('-d', '--debug', help='run in debug mode.',
+ parser = argparse.ArgumentParser()
+ parser.add_argument('--gsutil', help='path to gsutil.')
+ parser.add_argument('-d', '--debug', help='run in debug mode.',
action='store_true')
- parser.add_option('--mailfrom', help='email address of sender.')
- parser.add_option('--mailto', help='send error mails to...', action='append')
- parser.add_option('-n', '--dryrun', help="don't upload the manifest.",
+ parser.add_argument('--mailfrom', help='email address of sender.')
+ parser.add_argument('--mailto', help='send error mails to...',
+ action='append')
+ parser.add_argument('-n', '--dryrun', help="don't upload the manifest.",
action='store_true')
- parser.add_option('-v', '--verbose', help='print more diagnotic messages. '
+ parser.add_argument('-v', '--verbose', help='print more diagnotic messages. '
'Use more than once for more info.',
action='count')
- parser.add_option('--log-file', metavar='FILE', help='log to FILE')
- parser.add_option('--upload-log', help='Upload log alongside the manifest.',
- action='store_true')
- parser.add_option('--bundle-version',
+ parser.add_argument('--log-file', metavar='FILE', help='log to FILE')
+ parser.add_argument('--upload-log', help='Upload log alongside the manifest.',
+ action='store_true')
+ parser.add_argument('--bundle-version',
help='Manually set a bundle version. This can be passed more than once. '
'format: --bundle-version pepper_24=24.0.1312.25', action='append')
- options, args = parser.parse_args(args)
+ options = parser.parse_args(args)
if (options.mailfrom is None) != (not options.mailto):
options.mailfrom = None
« no previous file with comments | « native_client_sdk/src/build_tools/tests/verify_ppapi_test.py ('k') | native_client_sdk/src/build_tools/update_sdktools.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698