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

Unified Diff: tools/grit/grit/grd_reader.py

Issue 2923103002: Allow GRD reader to process a custom GRDP file stored in a folder different from its parent GRD fil… (Closed)
Patch Set: Correct author name typo Created 3 years, 6 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 | « tools/grit/grit/exception.py ('k') | tools/grit/grit/grd_reader_unittest.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/grit/grit/grd_reader.py
diff --git a/tools/grit/grit/grd_reader.py b/tools/grit/grit/grd_reader.py
index ba8ad49feed2de62fc18659f1a3e3a6b8a424a74..c337b6f2c8ef632b70d5428a4e482650a3d4b3bb 100755
--- a/tools/grit/grit/grd_reader.py
+++ b/tools/grit/grit/grd_reader.py
@@ -84,13 +84,10 @@ class GrdContentHandler(xml.sax.handler.ContentHandler):
partnode = self.stack[-1]
partnode.started_inclusion = True
# Add the contents of the sub-grd file as children of the <part> node.
- partname = partnode.GetInputPath()
- if os.path.dirname(partname):
- # TODO(benrg): Remove this limitation. (The problem is that GRIT
- # assumes that files referenced from the GRD file are relative to
- # a path stored in the root <grit> node.)
- raise exception.GotPathExpectedFilenameOnly()
- partname = os.path.join(self.dir, partname)
+ partname = os.path.join(self.dir, partnode.GetInputPath())
+ # Check the GRDP file exists.
+ if not os.path.exists(partname):
+ raise exception.FileNotFound()
# Exceptions propagate to the handler in grd_reader.Parse().
xml.sax.parse(partname, GrdPartContentHandler(self))
« no previous file with comments | « tools/grit/grit/exception.py ('k') | tools/grit/grit/grd_reader_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698