22 |
|
'''Process and pipeline management for Python Radiance scripts |
23 |
|
''' |
24 |
|
def raise_on_error(self, actstr, e): |
25 |
+ |
try: self._strtypes |
26 |
+ |
except AttributeError: self.__configure_subprocess() |
27 |
|
if hasattr(e, 'strerror'): eb = e.strerror |
28 |
|
elif isinstance(e, self._strtypes): eb = e |
29 |
|
else: eb = e |
60 |
|
else: self._pipeargs = {} |
61 |
|
# type names vary between Py2.7 and 3.x |
62 |
|
self._strtypes = (type(b''), type(u'')) |
61 |
– |
# private attribute to indicate established configuration |
62 |
– |
self.__proc_mixin_setup = True |
63 |
|
|
64 |
|
def qjoin(self, sl): |
65 |
|
'''Join a list with quotes around each element containing whitespace. |
73 |
|
return ' '.join([_q(s) for s in sl]) |
74 |
|
|
75 |
|
def __parse_args(self, _in, out): |
76 |
< |
try: self.__proc_mixin_setup |
76 |
> |
try: self._strtypes |
77 |
|
except AttributeError: self.__configure_subprocess() |
78 |
|
instr = '' |
79 |
|
if _in == PIPE: |