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

Unified Diff: experimental/PdfViewer/generate_code.py

Issue 19623007: pdfviewer: fix path shortcuts in python script, use os.path.join() (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 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: experimental/PdfViewer/generate_code.py
===================================================================
--- experimental/PdfViewer/generate_code.py (revision 10286)
+++ experimental/PdfViewer/generate_code.py (working copy)
@@ -1,5 +1,6 @@
+import os
import sys
import datatypes
@@ -274,7 +275,7 @@
# write imports
# write enums
- fileEnums = open(sys.argv[1] + 'autogen/SkPdfEnums_autogen.h', 'w')
+ fileEnums = open(os.path.join(sys.argv[1], 'autogen', 'SkPdfEnums_autogen.h'), 'w')
fileEnums.write('#ifndef __DEFINED__SkPdfEnums\n')
fileEnums.write('#define __DEFINED__SkPdfEnums\n')
fileEnums.write('\n')
@@ -298,8 +299,8 @@
cls = self.fClasses[name]
enum = cls.fEnum
- nativeFileClass = open(sys.argv[1] + 'native/autogen/SkPdf' + cls.fName + '_autogen.h', 'w')
- nativeFileClassCpp = open(sys.argv[1] + 'native/autogen/SkPdf' + cls.fName + '_autogen.cpp', 'w')
+ nativeFileClass = open(os.path.join(sys.argv[1], 'native', 'autogen', 'SkPdf' + cls.fName + '_autogen.h'), 'w')
+ nativeFileClassCpp = open(os.path.join(sys.argv[1], 'native', 'autogen', 'SkPdf' + cls.fName + '_autogen.cpp'), 'w')
nativeFileClass.write('#ifndef __DEFINED__SkPdf' + cls.fName + '\n')
nativeFileClass.write('#define __DEFINED__SkPdf' + cls.fName + '\n')
@@ -449,8 +450,8 @@
# generate parser
# TODO(edisonn): fast recognition based on must attributes.
- fileMapperNative = open(sys.argv[1] + 'native/autogen/SkPdfMapper_autogen.h', 'w')
- fileMapperNativeCpp = open(sys.argv[1] + 'native/autogen/SkPdfMapper_autogen.cpp', 'w')
+ fileMapperNative = open(os.path.join(sys.argv[1], 'native', 'autogen', 'SkPdfMapper_autogen.h'), 'w')
+ fileMapperNativeCpp = open(os.path.join(sys.argv[1], 'native', 'autogen', 'SkPdfMapper_autogen.cpp'), 'w')
fileMapperNative.write('#ifndef __DEFINED__SkPdfMapper\n')
fileMapperNative.write('#define __DEFINED__SkPdfMapper\n')
@@ -574,8 +575,8 @@
global fileHeadersNativeCpp
global knowTypes
- fileHeadersNative = open(sys.argv[1] + 'native/autogen/SkPdfHeaders_autogen.h', 'w')
- fileHeadersNativeCpp = open(sys.argv[1] + 'native/autogen/SkPdfHeaders_autogen.cpp', 'w')
+ fileHeadersNative = open(os.path.join(sys.argv[1], 'native', 'autogen', 'SkPdfHeaders_autogen.h'), 'w')
+ fileHeadersNativeCpp = open(os.path.join(sys.argv[1], 'native', 'autogen', 'SkPdfHeaders_autogen.cpp'), 'w')
fileHeadersNative.write('#ifndef __DEFINED__SkPdfHeaders\n')
fileHeadersNative.write('#define __DEFINED__SkPdfHeaders\n')
« 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