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

Unified Diff: tools/boilerplate.py

Issue 2846223002: Fixed some issues with boilerplate.py to make it work on Windows (Closed)
Patch Set: Created 3 years, 8 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: tools/boilerplate.py
diff --git a/tools/boilerplate.py b/tools/boilerplate.py
index 8d6343853d374453e9115091195f7d96871846c3..03e71f5ef0be45ada6bc9780bcb909b9a03b5bef 100755
--- a/tools/boilerplate.py
+++ b/tools/boilerplate.py
@@ -39,7 +39,7 @@ def _GetHeader(filename):
def _CppHeader(filename):
guard = filename.upper() + '_'
- for char in '/.+':
+ for char in '/\\.+':
guard = guard.replace(char, '_')
return '\n'.join([
'',
@@ -69,8 +69,13 @@ def _IsIOSFile(filename):
return False
+def _FilePathSlashesToCpp(filename):
+ return filename.replace('\\', '/')
+
+
def _CppImplementation(filename):
- return '\n#include "' + _RemoveTestSuffix(filename) + '.h"\n'
+ return '\n#include "' + _FilePathSlashesToCpp(_RemoveTestSuffix(filename)) \
+ + '.h"\n'
def _ObjCppImplementation(filename):
@@ -94,7 +99,7 @@ def _CreateFile(filename):
elif filename.endswith('.mm'):
contents += _ObjCppImplementation(filename)
- fd = open(filename, 'w')
+ fd = open(filename, 'wb')
fd.write(contents)
fd.close()
« 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