pycoze 0.1.269__tar.gz → 0.1.270__tar.gz
Sign up to get free protection for your applications and to get access to all the features.
- {pycoze-0.1.269 → pycoze-0.1.270}/PKG-INFO +1 -1
- {pycoze-0.1.269 → pycoze-0.1.270}/pycoze/api/lib/tab_cls.py +6 -15
- {pycoze-0.1.269 → pycoze-0.1.270}/pycoze.egg-info/PKG-INFO +1 -1
- {pycoze-0.1.269 → pycoze-0.1.270}/setup.py +1 -1
- {pycoze-0.1.269 → pycoze-0.1.270}/LICENSE +0 -0
- {pycoze-0.1.269 → pycoze-0.1.270}/README.md +0 -0
- {pycoze-0.1.269 → pycoze-0.1.270}/pycoze/__init__.py +0 -0
- {pycoze-0.1.269 → pycoze-0.1.270}/pycoze/ai/__init__.py +0 -0
- {pycoze-0.1.269 → pycoze-0.1.270}/pycoze/ai/llm/__init__.py +0 -0
- {pycoze-0.1.269 → pycoze-0.1.270}/pycoze/ai/llm/chat.py +0 -0
- {pycoze-0.1.269 → pycoze-0.1.270}/pycoze/ai/llm/text_to_image_prompt.py +0 -0
- {pycoze-0.1.269 → pycoze-0.1.270}/pycoze/ai/llm/think.py +0 -0
- {pycoze-0.1.269 → pycoze-0.1.270}/pycoze/ai/vram_reserve.py +0 -0
- {pycoze-0.1.269 → pycoze-0.1.270}/pycoze/api/__init__.py +0 -0
- {pycoze-0.1.269 → pycoze-0.1.270}/pycoze/api/lib/__init__.py +0 -0
- {pycoze-0.1.269 → pycoze-0.1.270}/pycoze/api/lib/view.py +0 -0
- {pycoze-0.1.269 → pycoze-0.1.270}/pycoze/api/lib/window_cls.py +0 -0
- {pycoze-0.1.269 → pycoze-0.1.270}/pycoze/bot/__init__.py +0 -0
- {pycoze-0.1.269 → pycoze-0.1.270}/pycoze/bot/agent/__init__.py +0 -0
- {pycoze-0.1.269 → pycoze-0.1.270}/pycoze/bot/agent/agent.py +0 -0
- {pycoze-0.1.269 → pycoze-0.1.270}/pycoze/bot/agent/agent_types/__init__.py +0 -0
- {pycoze-0.1.269 → pycoze-0.1.270}/pycoze/bot/agent/agent_types/const.py +0 -0
- {pycoze-0.1.269 → pycoze-0.1.270}/pycoze/bot/agent/agent_types/openai_func_call_agent.py +0 -0
- {pycoze-0.1.269 → pycoze-0.1.270}/pycoze/bot/agent/assistant.py +0 -0
- {pycoze-0.1.269 → pycoze-0.1.270}/pycoze/bot/agent/chat.py +0 -0
- {pycoze-0.1.269 → pycoze-0.1.270}/pycoze/bot/agent_chat.py +0 -0
- {pycoze-0.1.269 → pycoze-0.1.270}/pycoze/bot/bot.py +0 -0
- {pycoze-0.1.269 → pycoze-0.1.270}/pycoze/reference/__init__.py +0 -0
- {pycoze-0.1.269 → pycoze-0.1.270}/pycoze/reference/bot.py +0 -0
- {pycoze-0.1.269 → pycoze-0.1.270}/pycoze/reference/lib.py +0 -0
- {pycoze-0.1.269 → pycoze-0.1.270}/pycoze/reference/tool.py +0 -0
- {pycoze-0.1.269 → pycoze-0.1.270}/pycoze/reference/workflow.py +0 -0
- {pycoze-0.1.269 → pycoze-0.1.270}/pycoze/ui/__init__.py +0 -0
- {pycoze-0.1.269 → pycoze-0.1.270}/pycoze/ui/base.py +0 -0
- {pycoze-0.1.269 → pycoze-0.1.270}/pycoze/ui/color.py +0 -0
- {pycoze-0.1.269 → pycoze-0.1.270}/pycoze/ui/typ.py +0 -0
- {pycoze-0.1.269 → pycoze-0.1.270}/pycoze/ui/ui_def.py +0 -0
- {pycoze-0.1.269 → pycoze-0.1.270}/pycoze/utils/__init__.py +0 -0
- {pycoze-0.1.269 → pycoze-0.1.270}/pycoze/utils/arg.py +0 -0
- {pycoze-0.1.269 → pycoze-0.1.270}/pycoze/utils/env.py +0 -0
- {pycoze-0.1.269 → pycoze-0.1.270}/pycoze/utils/socket.py +0 -0
- {pycoze-0.1.269 → pycoze-0.1.270}/pycoze/utils/text_or_file.py +0 -0
- {pycoze-0.1.269 → pycoze-0.1.270}/pycoze.egg-info/SOURCES.txt +0 -0
- {pycoze-0.1.269 → pycoze-0.1.270}/pycoze.egg-info/dependency_links.txt +0 -0
- {pycoze-0.1.269 → pycoze-0.1.270}/pycoze.egg-info/top_level.txt +0 -0
- {pycoze-0.1.269 → pycoze-0.1.270}/setup.cfg +0 -0
@@ -1,38 +1,29 @@
|
|
1
1
|
import os
|
2
2
|
from .view import ViewCls, WorkflowCls
|
3
3
|
import time
|
4
|
-
from typing import Union
|
5
4
|
from pycoze import utils
|
6
5
|
|
7
6
|
|
8
7
|
socket = utils.socket
|
8
|
+
params = utils.params
|
9
9
|
|
10
10
|
class TabCls:
|
11
11
|
|
12
|
-
def open_workflow(self,
|
12
|
+
def open_workflow(self, workflow_id: str, wait_for_open) -> WorkflowCls:
|
13
|
+
item_path = os.path.join(params["workspacePath"], 'workflow', workflow_id)
|
13
14
|
if not os.path.isabs(item_path):
|
14
15
|
item_path = os.path.abspath(item_path)
|
15
16
|
location = ["FileOrDir", item_path]
|
16
17
|
socket.post("add-tab", {"location": location, "name": "todo"})
|
18
|
+
if wait_for_open:
|
19
|
+
self._wait_for_tab_open(location)
|
17
20
|
return WorkflowCls(location)
|
18
21
|
|
19
22
|
def get_active(self) -> ViewCls:
|
20
23
|
result = socket.post_and_recv_result("get-active-tab", {})
|
21
24
|
return self._result_to_view(result)
|
22
|
-
|
23
|
-
def _result_to_view(self, result: list[str]) -> ViewCls:
|
24
|
-
if result[0] == "Website":
|
25
|
-
return WebsiteViewCls(result)
|
26
|
-
elif result[0] == "FileOrDir":
|
27
|
-
if os.path.isdir(result[1]):
|
28
|
-
return DirectoryViewCls(result)
|
29
|
-
else:
|
30
|
-
if result[1].lower().split(".")[-1] == 'workflow':
|
31
|
-
return WorkflowCls(result)
|
32
|
-
return FileViewCls(result)
|
33
|
-
return ViewCls(result)
|
34
25
|
|
35
|
-
def
|
26
|
+
def _wait_for_tab_open(self, location: list[str] | ViewCls):
|
36
27
|
times = 0
|
37
28
|
while not self.is_tab_open(location):
|
38
29
|
time.sleep(0.01)
|
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
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|