Skip to content

Commit

Permalink
Fix nits in generate_resource_whitelist.*
Browse files Browse the repository at this point in the history
Review-Url: https://codereview.chromium.org/2968523002
Cr-Commit-Position: refs/heads/master@{#483477}
  • Loading branch information
zpeng authored and Commit Bot committed Jun 29, 2017
1 parent 1508ca9 commit 10bc4e3
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 15 deletions.
6 changes: 3 additions & 3 deletions tools/resources/generate_resource_whitelist.gni
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@ template("generate_resource_whitelist") {
]

args = [
"-i",
"--input",
rebase_path(invoker.input, root_build_dir),
"-o",
"--output",
rebase_path(invoker.output, root_build_dir),
"--out-dir=.",
"--output-directory=.",
]
}
}
25 changes: 13 additions & 12 deletions tools/resources/generate_resource_whitelist.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,8 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

import argparse
import os
import re
import sys

USAGE = """generate_resource_whitelist.py [-h] [-i INPUT] [-o OUTPUT]
__doc__ = """generate_resource_whitelist.py [-h] [--input INPUT]
[--output OUTPUT]
INPUT specifies a file containing existing resource IDs that should be
whitelisted, where each line of INPUT contains a single resource ID.
Expand All @@ -27,9 +23,14 @@
[-Wunknown-pragmas]
On Windows, the message is simply a message via __pragma(message(...)).
"""

import argparse
import os
import re
import sys


COMPONENTS_STRINGS_HEADER = 'gen/components/strings/grit/components_strings.h'

# We don't want the resources are different between 32-bit and 64-bit build,
Expand All @@ -56,16 +57,16 @@ def _FindResourceIds(header, resource_names):


def main():
parser = argparse.ArgumentParser(usage=USAGE)
parser = argparse.ArgumentParser(usage=__doc__)
parser.add_argument(
'-i', '--input', type=argparse.FileType('r'), default=sys.stdin,
'--input', type=argparse.FileType('r'), default=sys.stdin,
help='A resource whitelist where each line contains one resource ID')
parser.add_argument(
'-o', '--output', type=argparse.FileType('w'), default=sys.stdout,
'--output', type=argparse.FileType('w'), default=sys.stdout,
help='The resource list path to write (default stdout)')
parser.add_argument(
'--out-dir', required=True,
help='The out target directory, for example out/Release')
'--output-directory', required=True,
help='The output target directory, for example out/Release')

args = parser.parse_args()

Expand Down

0 comments on commit 10bc4e3

Please sign in to comment.