py36 we also need to put py36 in externals
This commit is contained in:
1 parent
e5391245d4
commit
dec5ab3036
1 file changed
+6
-5
@@ -1,4 +1,5 @@
|
||||
#!/usr/bin/python
|
||||
from __future__ import print_function
|
||||
import os, sys
|
||||
from collections import namedtuple
|
||||
|
||||
@@ -30,8 +31,8 @@ import apioptions_pb2
|
||||
def loadTemplate(lang, name):
|
||||
path = os.path.join("templates", lang, name)
|
||||
text = open(path).read()
|
||||
utext = unicode(text, "utf-8")
|
||||
return compiler.compile(utext)
|
||||
#utext = unicode(text, "utf-8")
|
||||
return compiler.compile(text)
|
||||
|
||||
def option(options, key, default=None):
|
||||
if options.HasExtension(key):
|
||||
@@ -307,7 +308,7 @@ if __name__ == "__main__":
|
||||
if DEBUG:
|
||||
data = open("data", mode='rb').read()
|
||||
else:
|
||||
data = sys.stdin.read()
|
||||
data = sys.stdin.buffer.read()
|
||||
request = plugin.CodeGeneratorRequest()
|
||||
# open("data", 'wb').write(data)
|
||||
request.ParseFromString(data)
|
||||
@@ -316,8 +317,8 @@ if __name__ == "__main__":
|
||||
|
||||
if DEBUG:
|
||||
for f in response.file:
|
||||
print f.content
|
||||
print(f.content)
|
||||
else:
|
||||
output = response.SerializeToString()
|
||||
sys.stdout.write(output)
|
||||
sys.stdout.buffer.write(output)
|
||||
|
||||
Reference in new issue
Block a user