Comments pruning session.
[OpenColorIO-Configs.git] / aces_1.0.0 / python / aces_ocio / process.py
index 47b968f..db23fc3 100755 (executable)
@@ -158,7 +158,7 @@ class Process:
                 else:\r
                     write_dict['logHandle'].write(\r
                         '%s<%s>%s</%s>\n' % (indent, key, value, key))\r
-            else:  # writeDict['format'] == 'txt':\r
+            else:\r
                 write_dict['logHandle'].write(\r
                     '%s%40s : %s\n' % (indent, key, value))\r
 \r
@@ -179,8 +179,6 @@ class Process:
 \r
         import platform\r
 \r
-        # Retrieve operating environment information\r
-        user = None\r
         try:\r
             user = os.getlogin()\r
         except:\r
@@ -197,10 +195,6 @@ class Process:
             (sysname, nodename, release, version, machine, processor) = (\r
                 'unknown_sysname', 'unknown_nodename', 'unknown_release',\r
                 'unknown_version', 'unknown_machine', 'unknown_processor')\r
-        try:\r
-            hostname = platform.node()\r
-        except:\r
-            hostname = 'unknown_hostname'\r
 \r
         self.write_key(write_dict, 'process', None, 'start')\r
         write_dict['indentationLevel'] += 1\r
@@ -381,7 +375,6 @@ class Process:
             else:\r
                 print('\n%s : %s\n' % (self.__class__, ' '.join(cmdargs)))\r
 \r
-        # intialize a few variables that may or may not be set later\r
         process = None\r
         tmp_wrapper = None\r
         stdout = None\r
@@ -390,7 +383,7 @@ class Process:
         parentcwd = os.getcwd()\r
 \r
         try:\r
-            # Using subprocess\r
+            # Using *subprocess*.\r
             if sp:\r
                 if self.batch_wrapper:\r
                     cmd = ' '.join(cmdargs)\r
@@ -406,7 +399,7 @@ class Process:
                                        stderr=sp.STDOUT,\r
                                        cwd=self.cwd, env=self.env)\r
 \r
-            # using os.popen4\r
+            # using *os.popen4*.\r
             else:\r
                 if self.env:\r
                     os.environ = self.env\r
@@ -418,7 +411,7 @@ class Process:
             print('Couldn\'t execute command : %s' % cmdargs[0])\r
             traceback.print_exc()\r
 \r
-        # Using subprocess\r
+        # Using *subprocess*\r
         if sp:\r
             if process != None:\r
                 # pid = process.pid\r
@@ -428,15 +421,15 @@ class Process:
                     # This is more proper python, and resolves some issues with\r
                     # a process ending before all of its output has been\r
                     # processed, but it also seems to stall when the read\r
-                    # buffer is near or over it's limit. this happens\r
+                    # buffer is near or over its limit. This happens\r
                     # relatively frequently with processes that generate lots\r
                     # of print statements.\r
                     for line in process.stdout:\r
                         self.log_line(line)\r
-                    #\r
-                    # So we go with the, um, uglier  option below\r
 \r
-                    # This is now used to ensure that the process has finished\r
+                    # So we go with the, um, uglier option below.\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
                         try:\r
@@ -462,11 +455,10 @@ class Process:
                             'Couldn\'t remove temp wrapper : %s' % tmp_wrapper)\r
                         traceback.print_exc()\r
 \r
-        # Using os.popen4\r
+        # Using *os.popen4*.\r
         else:\r
             exit_code = -1\r
             try:\r
-                # print('reading stdout lines')\r
                 stdout_lines = stdout.readlines()\r
                 exit_code = stdout.close()\r
 \r
@@ -542,14 +534,13 @@ class ProcessList(Process):
                 if isinstance(child, ProcessList):\r
                     child.generate_report(write_dict)\r
 \r
-                child_result = ''\r
                 key = child.description\r
                 value = child.status\r
                 if write_dict['format'] == 'xml':\r
                     child_result = (\r
                         '%s<result description=\'%s\'>%s</result>' % (\r
                             indent, key, value))\r
-                else:  # writeDict['format'] == 'txt':\r
+                else:\r
                     child_result = ('%s%40s : %s' % (indent, key, value))\r
                 self.log.append(child_result)\r
 \r
@@ -715,9 +706,6 @@ def main():
 \r
     options, arguments = p.parse_args()\r
 \r
-    #\r
-    # Get options\r
-    # \r
     cmd = options.cmd\r
     log_filename = options.log\r
 \r
@@ -731,14 +719,10 @@ def main():
     if cmd is None:\r
         print('process: No command specified')\r
 \r
-    #\r
-    # Test regular logging\r
-    #\r
+    # Testing regular logging.\r
     process = Process(description='a process', cmd=cmd, args=args)\r
 \r
-    #\r
-    # Test report generation and writing a log\r
-    #\r
+    # Testing report generation and writing a log.\r
     process_list = ProcessList('a process list')\r
     process_list.processes.append(process)\r
     process_list.echo = True\r