Generate code with Unix line endings even on Windows

This commit is contained in:
Vincent Jacques
2012-05-28 19:18:34 +02:00
parent d6835ff949
commit 5b44982f61
2 changed files with 3 additions and 3 deletions
+2 -2
View File
@@ -27,7 +27,7 @@ for class_ in description[ "classes" ]:
githubObjectTemplate = django.template.loader.get_template( "GithubObject.py" )
for class_ in description[ "classes" ]:
with open( os.path.join( os.path.dirname( __file__ ), "..", "src", "github", class_[ "name" ] + ".py" ), "w" ) as f:
with open( os.path.join( os.path.dirname( __file__ ), "..", "src", "github", class_[ "name" ] + ".py" ), "wb" ) as f:
f.write( "# WARNING: this file is generated automaticaly.\n" )
f.write( "# Do not modify it manually, your work would be lost.\n" )
f.write( "\n" )
@@ -45,7 +45,7 @@ for class_ in description[ "classes" ]:
f.write( "\n".join( code ) + "\n" )
referenceOfClassesTemplate = django.template.loader.get_template( "ReferenceOfClasses.md" )
with open( os.path.join( os.path.dirname( __file__ ), "..", "doc", "ReferenceOfClasses.md" ), "w" ) as f:
with open( os.path.join( os.path.dirname( __file__ ), "..", "doc", "ReferenceOfClasses.md" ), "wb" ) as f:
rawCode = referenceOfClassesTemplate.render( django.template.Context( description ) ).split( "\n" )
code = list()
for line in rawCode: