[Groonga-commit] groonga/groonga at 602d3cb [master] doc: ensure reading logs

Back to archive index
Kouhei Sutou null+****@clear*****
Tue Apr 2 18:28:28 JST 2019


Kouhei Sutou	2019-04-02 18:28:28 +0900 (Tue, 02 Apr 2019)

  Revision: 602d3cbb40569e32df261ad320cac118c50f6913
  https://github.com/groonga/groonga/commit/602d3cbb40569e32df261ad320cac118c50f6913

  Message:
    doc: ensure reading logs

  Modified files:
    doc/update_execution_example.py

  Modified: doc/update_execution_example.py (+8 -10)
===================================================================
--- doc/update_execution_example.py    2019-04-02 17:17:48 +0900 (1f3440178)
+++ doc/update_execution_example.py    2019-04-02 18:28:28 +0900 (d4c9c795d)
@@ -157,16 +157,14 @@ def execmd(command, fout):
             fout.write(first_lines_re.sub(prefix, formatted_output.strip()))
             fout.write("\n")
           if current_log:
-            log = current_log.read().strip()
-            if len(log) > 0:
-              prefix = "  # log: "
-              first_lines_re = re.compile("^", re.M)
-              formatted_log = first_lines_re.sub(prefix, log)
-              stdout.write(first_lines_re.sub(prefix, log))
-              stdout.write("\n")
-              if output_log and fout:
-                fout.write(formatted_log)
-                fout.write("\n")
+            prefix = "  # log: "
+            for line in current_log.readlines():
+                formatted_line = prefix + line.strip()
+                stdout.write(formatted_line)
+                stdout.write("\n")
+                if output_log and fout:
+                    fout.write(formatted_line)
+                    fout.write("\n")
           output_buffer = ""
     else:
       stdout.flush()
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.osdn.me/mailman/archives/groonga-commit/attachments/20190402/e32e902b/attachment.html>


More information about the Groonga-commit mailing list
Back to archive index