X-Git-Url: http://users.mur.at/ms/git/gitweb/?a=blobdiff_plain;f=aces_1.0.0%2Fpython%2Faces_ocio%2Fprocess.py;h=76dd754389909215b44aa9d9a8810b6d34040974;hb=529f7b361204176430ea0df642e4ec00a5c54ad7;hp=062855e9fd1ef1681dfb602c133db45369403f70;hpb=334e8bd4d18f6b4ad0bd616638f349825e9610b8;p=OpenColorIO-Configs.git diff --git a/aces_1.0.0/python/aces_ocio/process.py b/aces_1.0.0/python/aces_ocio/process.py index 062855e..76dd754 100755 --- 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. """ +from __future__ import division + import os import sys import traceback @@ -39,9 +41,13 @@ def read_text(text_file): Return value description. """ - if text_file != '': - with open(text_file, 'rb') as fp: - text = (fp.read()) + # TODO: Investigate if check is needed. + if not text_file: + return + + with open(text_file, 'rb') as fp: + text = (fp.read()) + return text @@ -60,9 +66,13 @@ def write_text(text, text_file): Return value description. """ - if text_file != '': - with open(text_file, 'wb') as fp: - fp.write(text) + # TODO: Investigate if check is needed. + if not text_file: + return + + with open(text_file, 'wb') as fp: + fp.write(text) + return text @@ -720,7 +730,6 @@ def main(): args_start = sys.argv.index('--') + 1 args = sys.argv[args_start:] except: - args_start = len(sys.argv) + 1 args = [] if cmd is None: