This commit is contained in:
Ian Bell
2015-03-14 23:19:48 -06:00
3 changed files with 13 additions and 11 deletions

View File

@@ -1,3 +1,4 @@
from __future__ import print_function
import subprocess, os
from example_generator import *
import shutil
@@ -8,9 +9,9 @@ def tee_call(call, file, **kwargs):
stderr = subprocess.PIPE,
**kwargs)
stdout, stderr = callee.communicate()
print stdout, stderr
file.write(stdout)
file.write(stderr)
print(stdout, stderr)
file.write(stdout.decode('ascii'))
file.write(stderr.decode('ascii'))
if callee.poll() != 0:
raise ValueError('Return code is non-zero')

View File

@@ -1,4 +1,5 @@
import json, sys
from six import string_types
header_template = """
[
@@ -321,7 +322,7 @@ class BaseParser(object):
def parse(self):
lines = []
for line in self.pieces:
if isinstance(line, basestring):
if isinstance(line, string_types):
lines.append(line)
elif isinstance(line, dict):
lines.append(self.dict2string(line))
@@ -352,7 +353,7 @@ class Python(BaseParser):
def parse_arguments(self, arguments):
out = []
for arg in arguments:
if isinstance(arg, basestring) and arg[0] == "'" and arg[-1] == "'":
if isinstance(arg, string_types) and arg[0] == "'" and arg[-1] == "'":
out.append('\"' + arg[1:-1] + '\"')
elif isinstance(arg, dict):
out.append(self.dict2string(arg))
@@ -407,7 +408,7 @@ class Octave(BaseParser):
def parse_arguments(self, arguments):
out = []
for arg in arguments:
if isinstance(arg, basestring) and arg[0] == "'" and arg[-1] == "'":
if isinstance(arg, string_types) and arg[0] == "'" and arg[-1] == "'":
out.append('\'' + arg[1:-1] + '\'')
elif isinstance(arg, dict):
out.append(self.dict2string(arg))
@@ -474,7 +475,7 @@ class MATLAB(BaseParser):
def parse_arguments(self, arguments):
out = []
for arg in arguments:
if isinstance(arg, basestring) and arg[0] == "'" and arg[-1] == "'":
if isinstance(arg, string_types) and arg[0] == "'" and arg[-1] == "'":
out.append('\'' + arg[1:-1] + '\'')
elif isinstance(arg, dict):
out.append(self.dict2string(arg))
@@ -538,7 +539,7 @@ class Java(BaseParser):
def parse_arguments(self, arguments):
out = []
for arg in arguments:
if isinstance(arg, basestring) and arg[0] == "'" and arg[-1] == "'":
if isinstance(arg, string_types) and arg[0] == "'" and arg[-1] == "'":
out.append('\"' + arg[1:-1] + '\"')
elif isinstance(arg, dict):
out.append(self.dict2string(arg))
@@ -603,7 +604,7 @@ class Csharp(BaseParser):
def parse_arguments(self, arguments):
out = []
for arg in arguments:
if isinstance(arg, basestring) and arg[0] == "'" and arg[-1] == "'":
if isinstance(arg, string_types) and arg[0] == "'" and arg[-1] == "'":
out.append('\"' + arg[1:-1] + '\"')
elif isinstance(arg, dict):
out.append(self.dict2string(arg))
@@ -655,4 +656,4 @@ if __name__=='__main__':
args = parser.parse_args()
writer = locals()[args.language]()
writer.write(args.destination, writer.parse())
print 'written to', args.destination
print('written to', args.destination)

View File

@@ -23,7 +23,7 @@ cdef class AbstractState:
""" Get the backend name - wrapper of c++ function :cpapi:`CoolProp::AbstractState::name` """
return self.thisptr.name()
cpdef constants_header.phases phase(self):
cpdef constants_header.phases phase(self) except *:
""" Get the phase as key value- wrapper of c++ function :cpapi:`CoolProp::AbstractState::phase` """
return self.thisptr.phase()