null+****@clear*****
null+****@clear*****
2012年 6月 27日 (水) 13:17:08 JST
Ryo Onodera 2012-06-27 13:17:08 +0900 (Wed, 27 Jun 2012) New Revision: 08e097e9c10211ce98f9d130e4e8cf5cec6e7ef6 https://github.com/groonga/groonga/commit/08e097e9c10211ce98f9d130e4e8cf5cec6e7ef6 Log: doc: use update_execution_example.py in groonga-httpd Added files: doc/source/example/executables/groonga-httpd.log Modified files: doc/locale/ja/LC_MESSAGES/executables.po doc/source/executables/groonga-httpd.txt doc/update_execution_example.py Modified: doc/locale/ja/LC_MESSAGES/executables.po (+5 -0) =================================================================== --- doc/locale/ja/LC_MESSAGES/executables.po 2012-06-27 12:05:21 +0900 (87f5e17) +++ doc/locale/ja/LC_MESSAGES/executables.po 2012-06-27 13:17:08 +0900 (3f7057a) @@ -18,6 +18,11 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" +# f1e03b584ff343688d79229a67fe2860 +#: ../../../source/example/executables/groonga-httpd.log:1 +msgid "Execution example::" +msgstr "実行例::" + #: ../../../source/executables.txt:6 msgid "実行ファイル" msgstr "" Added: doc/source/example/executables/groonga-httpd.log (+21 -0) 100644 =================================================================== --- /dev/null +++ doc/source/example/executables/groonga-httpd.log 2012-06-27 13:17:08 +0900 (2522297) @@ -0,0 +1,21 @@ +Execution example:: + + % curl http://localhost:10041/d/status + [ + [ + 0, + 1337566253.89858, + 0.000355720520019531 + ], + { + "uptime": 0, + "max_command_version": 2, + "n_queries": 0, + "cache_hit_rate": 0.0, + "version": "2.0.3-278-g6071d65", + "alloc_count": 145, + "command_version": 1, + "starttime": 1340769698, + "default_command_version": 1 + } + ] Modified: doc/source/executables/groonga-httpd.txt (+6 -21) =================================================================== --- doc/source/executables/groonga-httpd.txt 2012-06-27 12:05:21 +0900 (d880770) +++ doc/source/executables/groonga-httpd.txt 2012-06-27 13:17:08 +0900 (54abea1) @@ -49,27 +49,12 @@ console because groonga-httpd runs as a daemon process by default.:: Request queries ^^^^^^^^^^^^^^^ -To check, request a simple query (:ref:`command-status`).:: - - % curl -s http://localhost:10041/d/status | python -m json.tool - [ - [ - 0, - 1340331537.24441, - 5.17368316650391e-05 - ], - { - "alloc_count": 125, - "cache_hit_rate": 0.0, - "command_version": 1, - "default_command_version": 1, - "max_command_version": 2, - "n_queries": 0, - "starttime": 1340331494, - "uptime": 43, - "version": "2.0.3-278-g6071d65" - } - ] +To check, request a simple query (:ref:`command-status`). + +.. groonga-command +.. database: groonga-httpd +.. include:: ../example/executables/groonga-httpd.log +.. /d/status Browse the administration tool ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Modified: doc/update_execution_example.py (+12 -3) =================================================================== --- doc/update_execution_example.py 2012-06-27 12:05:21 +0900 (1230f1f) +++ doc/update_execution_example.py 2012-06-27 13:17:08 +0900 (bdb86aa) @@ -47,14 +47,19 @@ def normalize_output(output): return output def execmd(command, fout): - formatted_command_line = " " + command + "\n" stdout.write(command + "\n") stdout.flush() groonga_process.stdin.write(command + "\n") groonga_process.stdin.flush() + is_command = re.match("[a-z/]", command) + is_console = not re.match("/", command) if fout: + if is_console: + prefix = " " + else: + prefix = " % curl http://localhost:10041" + formatted_command_line = prefix + command + "\n" fout.write(formatted_command_line) - is_command = re.match("[a-z]", command) is_load_data_end = re.match("^\]", command) if not is_command and not is_load_data_end: return @@ -83,8 +88,12 @@ def execmd(command, fout): formatted_output = formatted_output.encode("utf-8") stdout.write(formatted_output) if fout: + if is_console: + prefix = " # " + else: + prefix = " " first_lines_re = re.compile("^", re.M) - fout.write(first_lines_re.sub(" # ", formatted_output.strip())) + fout.write(first_lines_re.sub(prefix, formatted_output.strip())) fout.write("\n") output_buffer = "" else: -------------- next part -------------- HTML$B$NE:IU%U%!%$%k$rJ]4I$7$^$7$?(B...Download