null+****@clear*****
null+****@clear*****
2012年 5月 21日 (月) 11:16:55 JST
Kouhei Sutou 2012-05-21 11:16:55 +0900 (Mon, 21 May 2012)
New Revision: c494d043431dbed16cafcaae373934d6b6ff16ea
Log:
doc: use normalized start time and elapsed time
Modified files:
doc/update_execution_example.py
Modified: doc/update_execution_example.py (+11 -1)
===================================================================
--- doc/update_execution_example.py 2012-05-21 11:09:46 +0900 (db670a3)
+++ doc/update_execution_example.py 2012-05-21 11:16:55 +0900 (1ef4f3a)
@@ -37,6 +37,15 @@ def reconnect(name):
fout = None
+def normalize_output(output):
+ status = output[0]
+ if status:
+ normalized_start_time = 1337566253.89858
+ normalized_elapsed_time = 0.000355720520019531
+ status[1] = normalized_start_time
+ status[2] = normalized_elapsed_time
+ return output
+
def execmd(command, fout):
formatted_command_line = " " + command + "\n"
stdout.write(command + "\n")
@@ -65,7 +74,8 @@ def execmd(command, fout):
formatted_output = output_buffer
else:
parsed_output = json.loads(output_buffer)
- formatted_output = json.dumps(parsed_output,
+ normalized_output = normalize_output(parsed_output)
+ formatted_output = json.dumps(normalized_output,
indent=2,
ensure_ascii=False)
formatted_output += "\n"