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

Unified Diff: grit/node/misc.py

Issue 10800072: When looking up a file in the first IDs list, and the file is outside of the tree starting at SRCDI… (Closed) Base URL: http://grit-i18n.googlecode.com/svn/trunk/
Patch Set: Created 8 years, 5 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: grit/node/misc.py
===================================================================
--- grit/node/misc.py (revision 57)
+++ grit/node/misc.py (working copy)
@@ -458,9 +458,12 @@
from grit.node import empty
for node in self.inorder():
if isinstance(node, empty.GroupingNode):
- filename = os.path.abspath(filename_or_stream)[
- len(src_root_dir) + 1:]
- filename = filename.replace('\\', '/')
+ abs_filename = os.path.abspath(filename_or_stream)
+ if abs_filename[:len(src_root_dir)] != src_root_dir:
+ filename = os.path.basename(filename_or_stream)
+ else:
+ filename = abs_filename[len(src_root_dir) + 1:]
+ filename = filename.replace('\\', '/')
if node.attrs['first_id'] != '':
raise Exception(
« 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