Skip to content

Commit 405eee4

Browse files
committed
Fix doc line problem
Fix doc line problem
1 parent dbad547 commit 405eee4

File tree

11 files changed

+1
-136
lines changed

11 files changed

+1
-136
lines changed

Diff for: docs/source/Zh/doc/callback_function/callback_function_doc.rst

-13
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33

44
在 AutoControl 裡,Callback function 是由 Callback Executor 提供支援,
55
以下是簡易的使用 Callback Executor 的範例,
6-
76
.. code-block:: python
87
from je_auto_control import callback_executor
98
# trigger_function will first to execute, but return value need to wait everything done
@@ -20,8 +19,6 @@
2019
* ( 注意!,如果 callback_executor event_dict 裡面包含的 name: function 需與 executor 一樣,不一樣則是 Bug)
2120
* (當然跟 executor 一樣可以藉由添加外部 function 來擴充,請看下面例子)
2221

23-
-----
24-
2522
在這個範例裡,我們使用 callback_executor 執行定義在 AutoControl 的 size function,
2623
然後執行完 size function 後,會去執行傳遞給 callback_function 的 function,
2724
可以由 callback_param_method 參數來決定要使用的傳遞方法,
@@ -31,25 +28,15 @@
3128
實際上 size -> print 順序沒錯,但此例會先看到 print 之後才是 print(size_function_return_value),
3229
因為 size function 只有回傳值本身沒有 print 的動作。
3330

34-
-----
35-
3631
如果我們想要在 callback_executor 裡面添加 function,可以使用如下:
3732
這段程式碼會把所有 time module 的 builtin, function, method, class
3833
載入到 callback executor,然後要使用被載入的 function 需要使用 package_function 名稱,
3934
例如 time.sleep 會變成 time_sleep
40-
41-
----
42-
4335
.. code-block:: python
4436
from je_auto_control import package_manager
4537
package_manager.add_package_to_callback_executor("time")
4638
47-
----
48-
4939
如果你需要查看被更新的 event_dict 可以使用
50-
51-
----
52-
5340
.. code-block:: python
5441
from je_auto_control import callback_executor
5542
print(callback_executor.event_dict)

Diff for: docs/source/Zh/doc/cli/cli_doc.rst

-9
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,13 @@
11
命令列介面 文件
22
----
33

4-
----
5-
64
我們可以使用 CLI 模式去執行 keyword.json 檔案或執行包含 Keyword.json files 的資料夾,
75
以下這個範例是去執行指定路徑的關鍵字 json 檔
8-
9-
----
10-
116
.. code-block::
127
python je_auto_control --execute_file "C:\Users\JeffreyChen\Desktop\Code_Space\AutoControl\test\unit_test\argparse\test1.json"
138
149
15-
----
1610
1711
以下這個範例是去執行指定路徑資料夾下所有的 keyword json 檔
18-
19-
----
20-
2112
.. code-block::
2213
python je_auto_control --execute_dir "C:\Users\JeffreyChen\Desktop\Code_Space\AutoControl\test\unit_test\argparse"

Diff for: docs/source/Zh/doc/critical_exit/critical_exit_doc.rst

-8
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,13 @@
11
緊急退出 文件
22
----
3-
4-
----
5-
63
* Critical Exit 是提供故障保護的機制。
74
* Critical Exit 預設是關閉的。
85
* 如果開啟,預設按鍵是 F7。
96
* 開啟的方法是 CriticalExit().init_critical_exit()
107

11-
----
12-
138
以下這個範例是讓滑鼠不受控制的移動並拋出例外,
149
當接收到例外,初始化 Critical Exit 並自動按下 F7,
1510
( 注意! 如果修改這個範例必須極度小心。 )
16-
17-
----
18-
1911
.. code-block:: python
2012
import sys
2113

Diff for: docs/source/Zh/doc/generate_report/generate_report_doc.rst

-16
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,10 @@ Generate Report 可以生成以下格式的報告
55
* HTML
66
* JSON
77
* XML
8-
9-
----
10-
118
* Generate Report 主要用來記錄與確認有哪些步驟執行,執行是否成功,
129
* 如果要使用 Generate Report 需要先設定紀錄為 True,使用 test_record_instance.init_record = True
1310
* 下面的範例有搭配 keyword and executor 如果看不懂可以先去看看 executor
14-
1511
以下是產生 HTML 的範例。
16-
17-
----
18-
1912
.. code-block:: python
2013
import sys
2114
@@ -61,12 +54,8 @@ Generate Report 可以生成以下格式的報告
6154
print("\n\n")
6255
execute_action(test_list)
6356
64-
----
6557
6658
以下是產生 JSON 的範例。
67-
68-
----
69-
7059
.. code-block:: python
7160
import sys
7261
@@ -112,12 +101,7 @@ Generate Report 可以生成以下格式的報告
112101
print("\n\n")
113102
execute_action(test_list)
114103
115-
----
116-
117104
以下是產生 XML 的範例。
118-
119-
----
120-
121105
.. code-block:: python
122106
import sys
123107

Diff for: docs/source/Zh/doc/image/image_doc.rst

-15
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,7 @@
66
* 定位多張圖片在螢幕中的位置。
77
* 定位圖片在螢幕中的位置並點擊。
88

9-
----
10-
119
以下範例是定位所有圖片
12-
13-
----
14-
1510
.. code-block:: python
1611
import time
1712
@@ -26,12 +21,7 @@
2621
image_data = locate_all_image(screenshot(), detect_threshold=0.9, draw_image=False)
2722
print(image_data)
2823
29-
----
30-
3124
以下範例是定位並點擊'圖片
32-
33-
----
34-
3525
.. code-block:: python
3626
import time
3727
@@ -45,12 +35,7 @@
4535
image_data = locate_and_click(screenshot(), "mouse_left", detect_threshold=0.9, draw_image=False)
4636
print(image_data)
4737
48-
----
49-
5038
以下範例是定位圖片
51-
52-
----
53-
5439
.. code-block:: python
5540
import time
5641

Diff for: docs/source/Zh/doc/keyboard/keyboard_doc.rst

-27
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,14 @@
77
以下範例是取得鍵盤的資訊,
88
* special_table 是特定的鍵盤按鍵 ( 注意! 不是每個平台都有 )
99
* keys_table 是所有可以使用的按鍵
10-
11-
----
12-
1310
.. code-block:: python
1411
from je_auto_control import keys_table, get_special_table
1512
1613
print(keys_table)
1714
print(get_special_table())
1815
19-
----
2016
2117
以下範例是按著鍵盤的某個按鍵,並在一秒後釋放
22-
23-
----
24-
2518
.. code-block:: python
2619
from time import sleep
2720
from je_auto_control import press_key, release_key
@@ -30,45 +23,25 @@
3023
sleep(1)
3124
release_key("a")
3225
33-
----
34-
3526
以下範例是按下與釋放按鍵
36-
37-
----
38-
3927
.. code-block:: python
4028
from je_auto_control import type_key
4129
4230
type_key("a")
4331
44-
----
45-
4632
以下範例是檢查鍵盤 a 鍵是否按著
47-
48-
----
49-
5033
.. code-block:: python
5134
from je_auto_control import check_key_is_press
5235
5336
check_key_is_press("a")
5437
55-
----
56-
5738
以下範例是按下與放開一串按鍵
58-
59-
----
60-
6139
.. code-block:: python
6240
from je_auto_control import write
6341
6442
write("abcdefg")
6543
66-
----
67-
6844
以下範例是按下按鍵並相反的釋放
69-
70-
----
71-
7245
.. code-block:: python
7346
import sys
7447

Diff for: docs/source/Zh/doc/keyword_and_executor/keyword_and_executor_doc.rst

+1-18
Original file line numberDiff line numberDiff line change
@@ -14,45 +14,28 @@
1414
# If you are using position param
1515
["function_name_in_event_dict": {param_value1, param_value2....}]
1616
]
17-
----
1817
1918
如果我們想要在 executor 裡面添加 function,可以使用如下:
2019
這段程式碼會把所有 time module 的 builtin, function, method, class
2120
載入到 executor,然後要使用被載入的 function 需要使用 package_function 名稱,
2221
例如 time.sleep 會變成 time_sleep
23-
24-
----
25-
2622
.. code-block:: python
2723
from je_auto_control import package_manager
2824
package_manager.add_package_to_executor("time")
2925
30-
----
31-
32-
如果你需要查看被更新的 event_dict 可以使用
3326
34-
----
3527
28+
如果你需要查看被更新的 event_dict 可以使用
3629
.. code-block:: python
3730
from je_auto_control import executor
3831
print(executor.event_dict)
3932
40-
----
41-
4233
如果我們想要執行 JSON 檔案
43-
44-
----
45-
4634
.. code-block:: python
4735
from je_auto_control import execute_action, read_action_json
4836
execute_action(read_action_json(file_path))
4937
50-
----
51-
5238
如果我們想要執行資料夾裡所有 JSON 檔案
53-
54-
----
55-
5639
.. code-block:: python
5740
from je_auto_control import execute_files, get_dir_files_as_list
5841
execute_files(get_dir_files_as_list(dir_path))

Diff for: docs/source/Zh/doc/mouse/mouse_doc.rst

-18
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,13 @@
77
以下範例是取得鍵盤的資訊,
88
* mouse_table 是所有可以使用的按鍵
99

10-
----
11-
1210
.. code-block:: python
1311
from je_auto_control import mouse_table
1412
1513
print(mouse_table)
1614
17-
----
18-
1915
以下範例是按著滑鼠,一秒後釋放滑鼠
2016

21-
----
22-
2317
.. code-block:: python
2418
from time import sleep
2519
@@ -28,35 +22,23 @@
2822
press_mouse("mouse_right")
2923
release_mouse("mouse_right")
3024
31-
----
32-
3325
以下範例是點擊並放開滑鼠
3426

35-
----
36-
3727
.. code-block:: python
3828
from je_auto_control import click_mouse
3929
4030
click_mouse("mouse_right")
4131
42-
----
43-
4432
以下範例是檢查滑鼠位置並改變滑鼠位置
4533

46-
----
47-
4834
.. code-block:: python
4935
from je_auto_control import position, set_position
5036
5137
print(position)
5238
set_position(100, 100)
5339
54-
----
55-
5640
以下範例是3秒後滑鼠會往上 scroll
5741

58-
----
59-
6042
.. code-block:: python
6143
from time import sleep
6244
from je_auto_control import scroll

Diff for: docs/source/Zh/doc/record/record_doc.rst

-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
* 可以搭配 executor 使用來重播鍵盤跟滑鼠動作。
66

77
以下是範例如何使用
8-
98
.. code-block:: python
109
from time import sleep
1110

Diff for: docs/source/Zh/doc/screen/screen_doc.rst

-10
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,13 @@
33

44
* Screen 主要用來取得螢幕尺寸與截圖。
55

6-
----
7-
86
以下範例是截圖
9-
10-
----
11-
127
.. code-block:: python
138
from je_auto_control import screenshot
149
1510
screenshot()
1611
17-
----
18-
1912
以下範例是取得螢幕尺寸
20-
21-
----
22-
2313
.. code-block:: python
2414
from je_auto_control import size
2515

Diff for: docs/source/Zh/doc/socket_driver/socket_driver_doc.rst

-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ Socket Driver 文件
1010
* 每個段落結束都應該傳輸 Return_Data_Over_JE。
1111
* 使用 UTF-8 encoding。
1212
* 傳送 quit_server 將會關閉伺服器。
13-
1413
.. code-block:: python
1514
import sys
1615

0 commit comments

Comments
 (0)