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

Unified Diff: Source/bindings/scripts/idl_reader.py

Issue 469253004: Blink-in-JS: A very simple refactoring about a way to get a basename of an IDL file (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 4 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/scripts/idl_reader.py
diff --git a/Source/bindings/scripts/idl_reader.py b/Source/bindings/scripts/idl_reader.py
index 8a8cd4f679db0c3f7ab5fd2ade86da9f98b70bd3..2f9c9f2acd0eacd63dcfd8f3f94b7e916d5c543c 100644
--- a/Source/bindings/scripts/idl_reader.py
+++ b/Source/bindings/scripts/idl_reader.py
@@ -69,8 +69,8 @@ class IdlReader(object):
ast = blink_idl_parser.parse_file(self.parser, idl_filename)
if not ast:
raise Exception('Failed to parse %s' % idl_filename)
- idl_name = os.path.basename(idl_filename)
- definitions = IdlDefinitions(idl_name, ast)
+ idl_file_basename, _ = os.path.splitext(os.path.basename(idl_filename))
+ definitions = IdlDefinitions(idl_file_basename, ast)
# Validate file contents with filename convention
# The Blink IDL filenaming convention is that the file
@@ -86,7 +86,6 @@ class IdlReader(object):
'Expected exactly 1 definition in file {0}, but found {1}'
.format(idl_filename, number_of_targets))
target = targets[0]
- idl_file_basename, _ = os.path.splitext(os.path.basename(idl_filename))
if not target.is_partial and target.name != idl_file_basename:
raise Exception(
'Definition name "{0}" disagrees with IDL file basename "{1}".'
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698