pycoze 0.1.256__tar.gz → 0.1.257__tar.gz
Sign up to get free protection for your applications and to get access to all the features.
- {pycoze-0.1.256 → pycoze-0.1.257}/PKG-INFO +1 -1
- {pycoze-0.1.256 → pycoze-0.1.257}/pycoze/api/__init__.py +0 -1
- pycoze-0.1.257/pycoze/api/api.py +7 -0
- {pycoze-0.1.256/pycoze/reference → pycoze-0.1.257/pycoze/api/lib}/__init__.py +0 -0
- {pycoze-0.1.256/pycoze/api → pycoze-0.1.257/pycoze/api/lib}/window_cls.py +3 -2
- pycoze-0.1.257/pycoze/reference/__init__.py +0 -0
- {pycoze-0.1.256 → pycoze-0.1.257}/pycoze.egg-info/PKG-INFO +1 -1
- {pycoze-0.1.256 → pycoze-0.1.257}/pycoze.egg-info/SOURCES.txt +2 -2
- {pycoze-0.1.256 → pycoze-0.1.257}/setup.py +1 -1
- pycoze-0.1.256/pycoze/api/api.py +0 -9
- pycoze-0.1.256/pycoze/api/tab_cls.py +0 -103
- {pycoze-0.1.256 → pycoze-0.1.257}/LICENSE +0 -0
- {pycoze-0.1.256 → pycoze-0.1.257}/README.md +0 -0
- {pycoze-0.1.256 → pycoze-0.1.257}/pycoze/__init__.py +0 -0
- {pycoze-0.1.256 → pycoze-0.1.257}/pycoze/ai/__init__.py +0 -0
- {pycoze-0.1.256 → pycoze-0.1.257}/pycoze/ai/llm/__init__.py +0 -0
- {pycoze-0.1.256 → pycoze-0.1.257}/pycoze/ai/llm/chat.py +0 -0
- {pycoze-0.1.256 → pycoze-0.1.257}/pycoze/ai/llm/text_to_image_prompt.py +0 -0
- {pycoze-0.1.256 → pycoze-0.1.257}/pycoze/ai/llm/think.py +0 -0
- {pycoze-0.1.256 → pycoze-0.1.257}/pycoze/ai/vram_reserve.py +0 -0
- {pycoze-0.1.256 → pycoze-0.1.257}/pycoze/bot/__init__.py +0 -0
- {pycoze-0.1.256 → pycoze-0.1.257}/pycoze/bot/agent/__init__.py +0 -0
- {pycoze-0.1.256 → pycoze-0.1.257}/pycoze/bot/agent/agent.py +0 -0
- {pycoze-0.1.256 → pycoze-0.1.257}/pycoze/bot/agent/agent_types/__init__.py +0 -0
- {pycoze-0.1.256 → pycoze-0.1.257}/pycoze/bot/agent/agent_types/const.py +0 -0
- {pycoze-0.1.256 → pycoze-0.1.257}/pycoze/bot/agent/agent_types/openai_func_call_agent.py +0 -0
- {pycoze-0.1.256 → pycoze-0.1.257}/pycoze/bot/agent/assistant.py +0 -0
- {pycoze-0.1.256 → pycoze-0.1.257}/pycoze/bot/agent/chat.py +0 -0
- {pycoze-0.1.256 → pycoze-0.1.257}/pycoze/bot/agent_chat.py +0 -0
- {pycoze-0.1.256 → pycoze-0.1.257}/pycoze/bot/bot.py +0 -0
- {pycoze-0.1.256 → pycoze-0.1.257}/pycoze/reference/bot.py +0 -0
- {pycoze-0.1.256 → pycoze-0.1.257}/pycoze/reference/lib.py +0 -0
- {pycoze-0.1.256 → pycoze-0.1.257}/pycoze/reference/tool.py +0 -0
- {pycoze-0.1.256 → pycoze-0.1.257}/pycoze/reference/workflow.py +0 -0
- {pycoze-0.1.256 → pycoze-0.1.257}/pycoze/ui/__init__.py +0 -0
- {pycoze-0.1.256 → pycoze-0.1.257}/pycoze/ui/base.py +0 -0
- {pycoze-0.1.256 → pycoze-0.1.257}/pycoze/ui/color.py +0 -0
- {pycoze-0.1.256 → pycoze-0.1.257}/pycoze/ui/typ.py +0 -0
- {pycoze-0.1.256 → pycoze-0.1.257}/pycoze/ui/ui_def.py +0 -0
- {pycoze-0.1.256 → pycoze-0.1.257}/pycoze/utils/__init__.py +0 -0
- {pycoze-0.1.256 → pycoze-0.1.257}/pycoze/utils/arg.py +0 -0
- {pycoze-0.1.256 → pycoze-0.1.257}/pycoze/utils/env.py +0 -0
- {pycoze-0.1.256 → pycoze-0.1.257}/pycoze/utils/socket.py +0 -0
- {pycoze-0.1.256 → pycoze-0.1.257}/pycoze/utils/text_or_file.py +0 -0
- {pycoze-0.1.256 → pycoze-0.1.257}/pycoze.egg-info/dependency_links.txt +0 -0
- {pycoze-0.1.256 → pycoze-0.1.257}/pycoze.egg-info/top_level.txt +0 -0
- {pycoze-0.1.256 → pycoze-0.1.257}/setup.cfg +0 -0
File without changes
|
File without changes
|
@@ -14,8 +14,8 @@ pycoze/ai/llm/text_to_image_prompt.py
|
|
14
14
|
pycoze/ai/llm/think.py
|
15
15
|
pycoze/api/__init__.py
|
16
16
|
pycoze/api/api.py
|
17
|
-
pycoze/api/
|
18
|
-
pycoze/api/window_cls.py
|
17
|
+
pycoze/api/lib/__init__.py
|
18
|
+
pycoze/api/lib/window_cls.py
|
19
19
|
pycoze/bot/__init__.py
|
20
20
|
pycoze/bot/agent_chat.py
|
21
21
|
pycoze/bot/bot.py
|
pycoze-0.1.256/pycoze/api/api.py
DELETED
@@ -1,103 +0,0 @@
|
|
1
|
-
import os
|
2
|
-
from pycoze import utils
|
3
|
-
from uuid import uuid4
|
4
|
-
from ps_view import ViewCls, WebsiteViewCls, FileViewCls, DirectoryViewCls, WorkflowCls
|
5
|
-
import time
|
6
|
-
from typing import Union
|
7
|
-
|
8
|
-
|
9
|
-
socket = utils.socket
|
10
|
-
|
11
|
-
class TabCls:
|
12
|
-
|
13
|
-
def open_path(self, item_path: str) -> FileViewCls | DirectoryViewCls:
|
14
|
-
if not os.path.isabs(item_path):
|
15
|
-
item_path = os.path.abspath(item_path)
|
16
|
-
if os.path.isdir(item_path):
|
17
|
-
return self.open_dir(item_path)
|
18
|
-
else:
|
19
|
-
return self.open_file(item_path)
|
20
|
-
|
21
|
-
def open_file(self, item_path: str) -> Union[FileViewCls, WebsiteViewCls, WorkflowCls]:
|
22
|
-
if not os.path.isabs(item_path):
|
23
|
-
item_path = os.path.abspath(item_path)
|
24
|
-
location = ["FileOrDir", item_path]
|
25
|
-
socket.post("add-tab", {"location": location, "name": os.path.basename(item_path)})
|
26
|
-
lower_suffix = item_path.lower().split(".")[-1]
|
27
|
-
if lower_suffix == 'workflow':
|
28
|
-
return WorkflowCls(location)
|
29
|
-
if len(location) > 1 and (location[0] == "Website" or location[1].endswith(".website") or location[1].endswith(".html") or location[1].endswith(".ipynb")):
|
30
|
-
return WebsiteViewCls(location)
|
31
|
-
return FileViewCls(location)
|
32
|
-
|
33
|
-
def open_dir(self, item_path: str) -> DirectoryViewCls:
|
34
|
-
if not os.path.isabs(item_path):
|
35
|
-
item_path = os.path.abspath(item_path)
|
36
|
-
location = ["FileOrDir", item_path]
|
37
|
-
socket.post("add-tab", {"location": location, "name": os.path.basename(item_path)})
|
38
|
-
return DirectoryViewCls(location)
|
39
|
-
|
40
|
-
def open_website(self, url: str, uid:str=None) -> WebsiteViewCls:
|
41
|
-
if uid is None:
|
42
|
-
uid = str(uuid4())
|
43
|
-
location = ["Website", url, uid]
|
44
|
-
socket.post("add-tab", {"location": location, "name": url})
|
45
|
-
return WebsiteViewCls(location)
|
46
|
-
|
47
|
-
def get_active(self) -> ViewCls:
|
48
|
-
result = socket.post_and_recv_result("get-active-tab", {})
|
49
|
-
return self._result_to_view(result)
|
50
|
-
|
51
|
-
def _result_to_view(self, result: list[str]) -> ViewCls:
|
52
|
-
if result[0] == "Website":
|
53
|
-
return WebsiteViewCls(result)
|
54
|
-
elif result[0] == "FileOrDir":
|
55
|
-
if os.path.isdir(result[1]):
|
56
|
-
return DirectoryViewCls(result)
|
57
|
-
else:
|
58
|
-
if result[1].lower().split(".")[-1] == 'workflow':
|
59
|
-
return WorkflowCls(result)
|
60
|
-
return FileViewCls(result)
|
61
|
-
return ViewCls(result)
|
62
|
-
|
63
|
-
def wait_for_tab_open(self, location: list[str] | ViewCls):
|
64
|
-
times = 0
|
65
|
-
while not self.is_tab_open(location):
|
66
|
-
time.sleep(0.01)
|
67
|
-
times += 1
|
68
|
-
if times > 1000:
|
69
|
-
raise Exception("Tab open timeout")
|
70
|
-
|
71
|
-
def get_all(self) -> list[ViewCls]:
|
72
|
-
results = socket.post_and_recv_result("get-all-tabs", {})
|
73
|
-
return [self._result_to_view(result) for result in results]
|
74
|
-
|
75
|
-
def close_tab(self, location: list[str] | ViewCls):
|
76
|
-
if isinstance(location, ViewCls):
|
77
|
-
location = location.location
|
78
|
-
self.wait_for_tab_open(location)
|
79
|
-
socket.post("close-tab", {"location": location})
|
80
|
-
|
81
|
-
def switch_tab(self, location: list[str] | ViewCls):
|
82
|
-
if isinstance(location, ViewCls):
|
83
|
-
location = location.location
|
84
|
-
self.wait_for_tab_open(location)
|
85
|
-
socket.post("switchTab", {"location": location})
|
86
|
-
|
87
|
-
def is_tab_open(self, location: list[str] | ViewCls):
|
88
|
-
if isinstance(location, ViewCls):
|
89
|
-
location = location.location
|
90
|
-
result = socket.post_and_recv_result("is-tab-open", {"location": location})
|
91
|
-
return result
|
92
|
-
|
93
|
-
def pin_tab(self, location: list[str] | ViewCls):
|
94
|
-
if isinstance(location, ViewCls):
|
95
|
-
location = location.location
|
96
|
-
self.wait_for_tab_open(location)
|
97
|
-
socket.post("pin-tab", {"location": location})
|
98
|
-
|
99
|
-
def unpin_tab(self, location: list[str] | ViewCls):
|
100
|
-
if isinstance(location, ViewCls):
|
101
|
-
location = location.location
|
102
|
-
self.wait_for_tab_open(location)
|
103
|
-
socket.post("unpin-tab", {"location": location})
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|