projects
/
OpenColorIO-Configs.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Updated ordering of view and displays for Nuke-specific config file.
[OpenColorIO-Configs.git]
/
aces_1.0.0
/
python
/
aces_ocio
/
process.py
diff --git
a/aces_1.0.0/python/aces_ocio/process.py
b/aces_1.0.0/python/aces_ocio/process.py
index
db23fc3
..
bb8f199
100755
(executable)
--- a/
aces_1.0.0/python/aces_ocio/process.py
+++ b/
aces_1.0.0/python/aces_ocio/process.py
@@
-6,6
+6,8
@@
A process wrapper class that maintains the text output and execution status of
a process or a list of other process wrappers which carry such data.
\r
"""
\r
\r
a process or a list of other process wrappers which carry such data.
\r
"""
\r
\r
+from __future__ import division
\r
+
\r
import os
\r
import sys
\r
import traceback
\r
import os
\r
import sys
\r
import traceback
\r
@@
-74,7
+76,7
@@
class Process:
def __init__(self,
\r
description=None,
\r
cmd=None,
\r
def __init__(self,
\r
description=None,
\r
cmd=None,
\r
- args=
[]
,
\r
+ args=
None
,
\r
cwd=None,
\r
env=None,
\r
batch_wrapper=False):
\r
cwd=None,
\r
env=None,
\r
batch_wrapper=False):
\r
@@
-92,6
+94,9
@@
class Process:
Return value description.
\r
"""
\r
\r
Return value description.
\r
"""
\r
\r
+ if args is None:
\r
+ args = []
\r
+
\r
self.cmd = cmd
\r
if not description:
\r
self.description = cmd
\r
self.cmd = cmd
\r
if not description:
\r
self.description = cmd
\r
@@
-148,7
+153,7
@@
class Process:
Return value description.
\r
"""
\r
\r
Return value description.
\r
"""
\r
\r
- if key
!= None and (value != None or start_stop !=
None):
\r
+ if key
is not None and (value is not None or start_stop is not
None):
\r
indent = '\t' * write_dict['indentationLevel']
\r
if write_dict['format'] == 'xml':
\r
if start_stop == 'start':
\r
indent = '\t' * write_dict['indentationLevel']
\r
if write_dict['format'] == 'xml':
\r
if start_stop == 'start':
\r
@@
-413,7
+418,7
@@
class Process:
\r
# Using *subprocess*
\r
if sp:
\r
\r
# Using *subprocess*
\r
if sp:
\r
- if process
!=
None:
\r
+ if process
is not
None:
\r
# pid = process.pid
\r
# log.logLine('process id %s\n' % pid)
\r
\r
# pid = process.pid
\r
# log.logLine('process id %s\n' % pid)
\r
\r
@@
-431,14
+436,16
@@
class Process:
\r
# This is now used to ensure that the process has finished.
\r
line = ''
\r
\r
# This is now used to ensure that the process has finished.
\r
line = ''
\r
- while line
!=
None and process.poll() is None:
\r
+ while line
is not
None and process.poll() is None:
\r
try:
\r
line = process.stdout.readline()
\r
except:
\r
break
\r
# 3.1
\r
try:
\r
try:
\r
line = process.stdout.readline()
\r
except:
\r
break
\r
# 3.1
\r
try:
\r
- self.log_line(str(line, encoding='utf-8'))
\r
+ # TODO: Investigate previous eroneous statement.
\r
+ # self.log_line(str(line, encoding='utf-8'))
\r
+ self.log_line(str(line))
\r
# 2.6
\r
except:
\r
self.log_line(line)
\r
# 2.6
\r
except:
\r
self.log_line(line)
\r
@@
-460,6
+467,8
@@
class Process:
exit_code = -1
\r
try:
\r
stdout_lines = stdout.readlines()
\r
exit_code = -1
\r
try:
\r
stdout_lines = stdout.readlines()
\r
+ # TODO: Investigate if this is the good behavior, close() does
\r
+ # not return anything / None.
\r
exit_code = stdout.close()
\r
\r
stdout.close()
\r
exit_code = stdout.close()
\r
\r
stdout.close()
\r