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

Unified Diff: Source/devtools/scripts/generate_devtools_grd.py

Issue 283833006: DevTools: Fix content_shell devtools built in debug_devtools=1 mode (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix codemirror CSS copying in debug_devtools=0 mode Created 6 years, 7 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 | « Source/devtools/front_end/ui/View.js ('k') | Source/devtools/scripts/generate_devtools_html.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/devtools/scripts/generate_devtools_grd.py
diff --git a/Source/devtools/scripts/generate_devtools_grd.py b/Source/devtools/scripts/generate_devtools_grd.py
index f25891104b2a78467a76a76b2ea4ad546e4bee55..248b026084f513ae88703a322b8cdecf3f7fe3c7 100755
--- a/Source/devtools/scripts/generate_devtools_grd.py
+++ b/Source/devtools/scripts/generate_devtools_grd.py
@@ -58,26 +58,27 @@ kGrdTemplate = '''<?xml version="1.0" encoding="UTF-8"?>
class ParsedArgs:
- def __init__(self, source_files, relative_path_dir, image_dirs, output_filename):
+ def __init__(self, source_files, relative_path_dirs, image_dirs, output_filename):
self.source_files = source_files
- self.relative_path_dir = relative_path_dir
+ self.relative_path_dirs = relative_path_dirs
self.image_dirs = image_dirs
self.output_filename = output_filename
def parse_args(argv):
- relative_path_dir_position = argv.index('--relative_path_dir')
+ relative_path_dirs_position = argv.index('--relative_path_dirs')
images_position = argv.index('--images')
output_position = argv.index('--output')
- source_files = argv[:relative_path_dir_position]
- relative_path_dir = argv[relative_path_dir_position + 1]
+ source_files = argv[:relative_path_dirs_position]
+ relative_path_dirs = argv[relative_path_dirs_position + 1:images_position]
image_dirs = argv[images_position + 1:output_position]
- return ParsedArgs(source_files, relative_path_dir, image_dirs, argv[output_position + 1])
+ return ParsedArgs(source_files, relative_path_dirs, image_dirs, argv[output_position + 1])
def make_name_from_filename(filename):
return (filename.replace('/', '_')
.replace('\\', '_')
+ .replace('-', '_')
.replace('.', '_')).upper()
@@ -92,13 +93,12 @@ def add_file_to_grd(grd_doc, relative_filename):
includes_node.appendChild(new_include_node)
-def build_relative_filename(relative_path_dir, filename):
- if relative_path_dir:
+def build_relative_filename(relative_path_dirs, filename):
+ for relative_path_dir in relative_path_dirs:
index = filename.find(relative_path_dir)
if index == 0:
return filename[len(relative_path_dir) + 1:]
- return os.path.basename(filename)
- return filename
+ return os.path.basename(filename)
def main(argv):
@@ -114,7 +114,7 @@ def main(argv):
raise e
for filename in parsed_args.source_files:
- relative_filename = build_relative_filename(parsed_args.relative_path_dir, filename)
+ relative_filename = build_relative_filename(parsed_args.relative_path_dirs, filename)
target_dir = os.path.join(output_directory, os.path.dirname(relative_filename))
if not os.path.exists(target_dir):
os.makedirs(target_dir)
« no previous file with comments | « Source/devtools/front_end/ui/View.js ('k') | Source/devtools/scripts/generate_devtools_html.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698