mirror of
https://github.com/CoolProp/CoolProp.git
synced 2026-04-23 03:00:17 -04:00
Merge branch 'master' of https://github.com/coolprop/coolprop
This commit is contained in:
@@ -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')
|
||||
|
||||
|
||||
@@ -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)
|
||||
@@ -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()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user