Minor updates and bug fixes.
[OpenColorIO-Configs.git] / aces_1.0.0 / python / aces_ocio / process.py
index 062855e..5758b5e 100755 (executable)
@@ -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
+from __future__ import division\r
+\r
 import os\r
 import sys\r
 import traceback\r
@@ -39,9 +41,13 @@ def read_text(text_file):
          Return value description.\r
     """\r
 \r
-    if text_file != '':\r
-        with open(text_file, 'rb') as fp:\r
-            text = (fp.read())\r
+    # TODO: Investigate if check is needed.\r
+    if not text_file:\r
+        return\r
+\r
+    with open(text_file, 'rb') as fp:\r
+        text = (fp.read())\r
+\r
     return text\r
 \r
 \r
@@ -60,9 +66,13 @@ def write_text(text, text_file):
          Return value description.\r
     """\r
 \r
-    if text_file != '':\r
-        with open(text_file, 'wb') as fp:\r
-            fp.write(text)\r
+    # TODO: Investigate if check is needed.\r
+    if not text_file:\r
+        return\r
+\r
+    with open(text_file, 'wb') as fp:\r
+        fp.write(text)\r
+\r
     return text\r
 \r
 \r
@@ -321,7 +331,7 @@ class Process:
                 log_handle.write(header)\r
                 if format == 'xml':\r
                     log_handle.write(']]>\n')\r
-            self.write_log(log_handle)\r
+            self.write_log(log_handle, format=format)\r
             log_handle.close()\r
 \r
     def log_line(self, line):\r
@@ -720,7 +730,6 @@ def main():
         args_start = sys.argv.index('--') + 1\r
         args = sys.argv[args_start:]\r
     except:\r
-        args_start = len(sys.argv) + 1\r
         args = []\r
 \r
     if cmd is None:\r