Skip to content

Commit 96fbcde

Browse files
committed
add record test and update pypi
add record test update pypi ver refactor
1 parent 30d5a16 commit 96fbcde

File tree

5 files changed

+40
-9
lines changed

5 files changed

+40
-9
lines changed

circle_ci_test/record_test.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import sys
2+
from time import sleep
3+
4+
from je_auto_control import record
5+
from je_auto_control import stop_record
6+
from je_auto_control import type_key
7+
8+
record()
9+
type_key("t")
10+
type_key("e")
11+
type_key("s")
12+
type_key("t")
13+
14+
sleep(1)
15+
stop_record()

je_auto_control/wrapper/auto_control_record.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import sys
2+
13
from je_auto_control.utils.je_auto_control_exception.exceptions import AutoControlRecordException
24
from je_auto_control.utils.je_auto_control_exception.exception_tag import record_not_found_action_error
35
from je_auto_control.wrapper.auto_control_mouse import click_mouse
@@ -34,10 +36,14 @@ def stop_record_keyboard():
3436

3537

3638
def record():
39+
if sys.platform == "darwin":
40+
raise Exception("macos can't use recorder")
3741
recorder.record()
3842

3943

4044
def stop_record():
45+
if sys.platform == "darwin":
46+
raise Exception("macos can't use recorder")
4147
action_queue = recorder.stop_record()
4248
if action_queue is None:
4349
raise AutoControlRecordException
@@ -53,12 +59,8 @@ def stop_record():
5359
if __name__ == "__main__":
5460
record()
5561
from time import sleep
56-
sleep(10)
62+
sleep(5)
5763
stop_record()
58-
sleep(3)
59-
import sys
60-
if sys.platform in ["darwin"]:
61-
record()
62-
stop_record()
64+
sleep(2)
6365

6466

je_auto_control/wrapper/platform_wrapper.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -864,8 +864,7 @@
864864
keyboard_check = osx_keyboard_check
865865
mouse = osx_mouse
866866
screen = osx_screen
867-
recorder = osx_recorder
868-
if None in [keys_table, mouse_table, keyboard_check, keyboard, mouse, screen, recorder]:
867+
if None in [keys_table, mouse_table, keyboard_check, keyboard, mouse, screen]:
869868
raise AutoControlException("Can't init auto control")
870869

871870
elif sys.platform in ["linux", "linux2"]:

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
setuptools.setup(
77
name="je_auto_control",
8-
version="0.0.39",
8+
version="0.0.40",
99
author="JE-Chen",
1010
author_email="[email protected]",
1111
description="auto control gui",
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import sys
2+
from time import sleep
3+
4+
from je_auto_control import record
5+
from je_auto_control import stop_record
6+
from je_auto_control import type_key
7+
8+
record()
9+
type_key("t")
10+
type_key("e")
11+
type_key("s")
12+
type_key("t")
13+
14+
sleep(1)
15+
stop_record()

0 commit comments

Comments
 (0)