pycoze 0.1.255__py3-none-any.whl → 0.1.257__py3-none-any.whl
Sign up to get free protection for your applications and to get access to all the features.
- pycoze/api/__init__.py +5 -0
- pycoze/api/api.py +7 -0
- pycoze/api/lib/__init__.py +0 -0
- pycoze/api/lib/window_cls.py +51 -0
- pycoze/utils/__init__.py +5 -1
- pycoze/utils/socket.py +3 -2
- {pycoze-0.1.255.dist-info → pycoze-0.1.257.dist-info}/METADATA +1 -1
- {pycoze-0.1.255.dist-info → pycoze-0.1.257.dist-info}/RECORD +11 -7
- {pycoze-0.1.255.dist-info → pycoze-0.1.257.dist-info}/LICENSE +0 -0
- {pycoze-0.1.255.dist-info → pycoze-0.1.257.dist-info}/WHEEL +0 -0
- {pycoze-0.1.255.dist-info → pycoze-0.1.257.dist-info}/top_level.txt +0 -0
pycoze/api/__init__.py
ADDED
pycoze/api/api.py
ADDED
File without changes
|
@@ -0,0 +1,51 @@
|
|
1
|
+
import sys
|
2
|
+
import subprocess
|
3
|
+
import os
|
4
|
+
from pycoze import utils
|
5
|
+
|
6
|
+
|
7
|
+
socket = utils.socket
|
8
|
+
|
9
|
+
class WindowCls:
|
10
|
+
|
11
|
+
def get_slected_text(self) -> str:
|
12
|
+
result = socket.post_and_recv_result("get-selected-text", {})
|
13
|
+
return result
|
14
|
+
|
15
|
+
def append_msg(self, message: str, type='info'):
|
16
|
+
if not isinstance(message, str):
|
17
|
+
message = repr(message)
|
18
|
+
socket.post("append-msg", {"message": message, "type": type})
|
19
|
+
|
20
|
+
def show_operation(self, text: str):
|
21
|
+
socket.post("show-operation", {"text": text})
|
22
|
+
|
23
|
+
def screenshot(self, name):
|
24
|
+
socket.post("screenshot", {"name": name})
|
25
|
+
|
26
|
+
def confirm(self, message: str) -> bool:
|
27
|
+
return socket.post_and_recv_result("confirm", {"message": message})
|
28
|
+
|
29
|
+
def maximize(self):
|
30
|
+
socket.post("maximize", {})
|
31
|
+
|
32
|
+
def open_file_with_system(self, file_path, wait: bool):
|
33
|
+
process_fn = subprocess.run if wait else subprocess.Popen
|
34
|
+
if sys.platform.startswith('linux'):
|
35
|
+
process_fn(['xdg-open', file_path])
|
36
|
+
elif sys.platform.startswith('darwin'):
|
37
|
+
process_fn(['open', file_path])
|
38
|
+
elif sys.platform.startswith('win32') or sys.platform.startswith('cygwin'):
|
39
|
+
os.startfile(file_path)
|
40
|
+
else:
|
41
|
+
raise OSError('Unsupported operating system')
|
42
|
+
|
43
|
+
def open_program(self, file_path, wait: bool):
|
44
|
+
process_fn = subprocess.run if wait else subprocess.Popen
|
45
|
+
process_fn([file_path])
|
46
|
+
|
47
|
+
def execute_javaScript(self, js_code: str):
|
48
|
+
result = socket.post_and_recv_result("executeJavaScript", {"code": js_code})
|
49
|
+
if not result["ok"]:
|
50
|
+
raise Exception(result["value"])
|
51
|
+
return result["value"] if "value" in result else None
|
pycoze/utils/__init__.py
CHANGED
@@ -1,5 +1,9 @@
|
|
1
1
|
from .arg import read_arg
|
2
2
|
from .env import read_params_file, params, read_json_file
|
3
|
+
from .socket import TcpSocket, socket, socket_subscribe
|
3
4
|
from .text_or_file import to_text
|
4
5
|
|
5
|
-
__all__ = [read_arg,
|
6
|
+
__all__ = [read_arg,
|
7
|
+
read_params_file, params, read_json_file,
|
8
|
+
TcpSocket, socket, socket_subscribe,
|
9
|
+
to_text]
|
pycoze/utils/socket.py
CHANGED
@@ -5,6 +5,10 @@ pycoze/ai/llm/__init__.py,sha256=5_AnOrzXI2V6ZZsLUWW1v5ATRWmJy53JLN9jfSZQXCg,249
|
|
5
5
|
pycoze/ai/llm/chat.py,sha256=izriC7nCp5qeJRqcUVQBVqTHiH6MJS77ROzGBJufdNI,5133
|
6
6
|
pycoze/ai/llm/text_to_image_prompt.py,sha256=0bx2C_YRvjAo7iphHGp1-pmGKsKqwur7dM0t3SiA8kA,3398
|
7
7
|
pycoze/ai/llm/think.py,sha256=sUgTBdGzcZtL3r-Wx8M3lDuVUmDVz8g3qC0VU8uiKAI,5143
|
8
|
+
pycoze/api/__init__.py,sha256=Bb7Trv4y5vti-Tt_4fiu7Zfr1HF_vuxASHReLiUHXn4,137
|
9
|
+
pycoze/api/api.py,sha256=OPLp4t4szP4azCTEBNEHO9CIDl9JrmfZPK9mONpvQC0,137
|
10
|
+
pycoze/api/lib/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
11
|
+
pycoze/api/lib/window_cls.py,sha256=uXK0WM64_IpaYXFn6tdWlZZ8AWXLVPZOScENkaCXERI,1774
|
8
12
|
pycoze/bot/__init__.py,sha256=JxnRoCCqx_LFyVb3pLu0qYCsH8ZLuAaMXAtvVUuCHuE,78
|
9
13
|
pycoze/bot/agent_chat.py,sha256=ARXXsIVCTpmBojz2C4BR69nB0QhM6gkEngL3iq34JPo,4178
|
10
14
|
pycoze/bot/bot.py,sha256=_qmUTZ09FmRLifHrW5stDZWGVK6yuMEMBC3fmeYJnqk,844
|
@@ -25,13 +29,13 @@ pycoze/ui/base.py,sha256=bz9mHZwIXA8LErEHTIonH347u6LP7rxV2EADMMjNZos,1081
|
|
25
29
|
pycoze/ui/color.py,sha256=cT9Ib8uNzkOKxyW0IwVj46o4LwdB1xgNCj1_Rou9d_4,854
|
26
30
|
pycoze/ui/typ.py,sha256=NpT0FrbHvByOszBZMFtroRp7I7pN-38tYz_zPOPejF4,1723
|
27
31
|
pycoze/ui/ui_def.py,sha256=lGWZGpzRoegP34D562PvK0EJHrmVZrlHW1JjsIG9A9Q,4521
|
28
|
-
pycoze/utils/__init__.py,sha256=
|
32
|
+
pycoze/utils/__init__.py,sha256=H-2KRUsUG47owL0sbD1KwDOuRm-j_0K4RkeNhzr7ISo,319
|
29
33
|
pycoze/utils/arg.py,sha256=jop1tBfe5hYkHW1NSpCeaZBEznkgguBscj_7M2dWfrs,503
|
30
34
|
pycoze/utils/env.py,sha256=5pWlXfM1F5ZU9hhv1rHlDEanjEW5wf0nbyez9bNRqqA,559
|
31
|
-
pycoze/utils/socket.py,sha256=
|
35
|
+
pycoze/utils/socket.py,sha256=yyYgx7G40x58sV466OQH0vj3i55xgR3uMDEjbQMbGks,2413
|
32
36
|
pycoze/utils/text_or_file.py,sha256=gpxZVWt2DW6YiEg_MnMuwg36VNf3TX383QD_1oZNB0Y,551
|
33
|
-
pycoze-0.1.
|
34
|
-
pycoze-0.1.
|
35
|
-
pycoze-0.1.
|
36
|
-
pycoze-0.1.
|
37
|
-
pycoze-0.1.
|
37
|
+
pycoze-0.1.257.dist-info/LICENSE,sha256=QStd_Qsd0-kAam_-sOesCIp_uKrGWeoKwt9M49NVkNU,1090
|
38
|
+
pycoze-0.1.257.dist-info/METADATA,sha256=ZgRSbR7eyjWMl6GnMh0fVg0WSzUFGVa02LV6ADkoy2o,699
|
39
|
+
pycoze-0.1.257.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
|
40
|
+
pycoze-0.1.257.dist-info/top_level.txt,sha256=76dPeDhKvOCleL3ZC5gl1-y4vdS1tT_U1hxWVAn7sFo,7
|
41
|
+
pycoze-0.1.257.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|