Chromium Code Reviews| Index: native_client_sdk/src/build_tools/easy_template.py |
| diff --git a/native_client_sdk/src/build_tools/easy_template.py b/native_client_sdk/src/build_tools/easy_template.py |
| index 999bdb1f8816e9090aac4c62156da007e312d6d4..8667e32c9a198e0bdb6c3985e82798ae9fa9f85e 100755 |
| --- a/native_client_sdk/src/build_tools/easy_template.py |
| +++ b/native_client_sdk/src/build_tools/easy_template.py |
| @@ -5,7 +5,7 @@ |
| import copy |
| import cStringIO |
| -import optparse |
| +import argparse |
|
binji
2014/11/13 23:57:01
sort
Sam Clegg
2014/11/30 17:55:11
Done.
|
| import os |
| import re |
| import sys |
| @@ -98,12 +98,11 @@ def RunTemplateString(src, template_dict, statement_re=None, expr_re=None): |
| def main(args): |
| - parser = optparse.OptionParser() |
| - _, args = parser.parse_args(args) |
| - if not args: |
| - return |
| + parser = argparse.ArgumentParser() |
| + parser.add_arguments('template') |
| + options = parser.parse_args(args) |
| - with open(args[0]) as f: |
| + with open(options.templet) as f: |
|
binji
2014/11/13 23:57:01
template
Sam Clegg
2014/11/30 17:55:11
Done.
binji
2014/12/08 21:58:20
template :)
Sam Clegg
2015/01/14 15:28:32
Done.
|
| print TemplateToPython( |
| f.read(), re.compile(STATEMENT_RE), re.compile(EXPR_RE)) |