pycoze 0.1.62__py3-none-any.whl → 0.1.64__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
pycoze/ui/base.py CHANGED
@@ -4,44 +4,45 @@ import json
4
4
  import inspect
5
5
 
6
6
 
7
- params_file = utils.read_arg('params_file', True)
7
+ params_file = utils.read_arg("params_file", True)
8
8
  params = None
9
9
  try:
10
- with open(params_file, 'r', encoding='utf-8') as f:
10
+ with open(params_file, "r", encoding="utf-8") as f:
11
11
  params = json.load(f)
12
12
  except Exception as e:
13
13
  print(e)
14
14
 
15
+
15
16
  def get_ui():
16
17
  if params is None:
17
18
  return {}
18
19
  stack = inspect.stack()
19
- stack_files = list(reversed([s.filename.replace('\\', '/') for s in stack]))
20
+ stack_files = list(reversed([s.filename.replace("\\", "/") for s in stack]))
20
21
  match_item = None
21
22
  for f in stack_files:
22
- for v in params["uiRecords"]:
23
- if v["uiFile"] == f:
23
+ for v in params["uiData"]["uiFiles"]:
24
+ if v == f:
24
25
  match_item = v
25
26
  break
26
27
  if match_item:
27
28
  break
28
29
 
29
30
  if not match_item:
30
- raise Exception("uiRecords not found for file")
31
+ raise Exception("uiData not found for file")
31
32
 
32
33
  by = match_item["by"]
33
34
 
34
35
  for i in range(10):
35
36
  try:
36
- if by == 'file':
37
+ if by == "file":
37
38
  json_file = match_item["Jsonfile"]
38
- with open(json_file, "r", encoding='utf-8') as f:
39
+ with open(json_file, "r", encoding="utf-8") as f:
39
40
  return json.load(f)
40
41
  else:
41
- assert by == 'node'
42
+ assert by == "node"
42
43
  workflow_file = match_item["workflowFile"]
43
44
  node_id = match_item["nodeId"]
44
- with open(workflow_file, "r", encoding='utf-8') as f:
45
+ with open(workflow_file, "r", encoding="utf-8") as f:
45
46
  cells = json.load(f)["graph"]["cells"]
46
47
  node = [cell for cell in cells if cell["id"] == node_id][0]
47
48
  return json.loads(node["data"]["ui"])
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pycoze
3
- Version: 0.1.62
3
+ Version: 0.1.64
4
4
  Summary: Package for pycoze only!
5
5
  Author: Yuan Jie Xiong
6
6
  Author-email: aiqqqqqqq@qq.com
@@ -15,15 +15,15 @@ pycoze/bot/agent/agent_types/react_prompt.py,sha256=jyovokGaPzNIe5bvTRvn0gmsWLx5
15
15
  pycoze/gpu/__init__.py,sha256=cuxwDdz2Oo-VcwZ50FtFtEIJXdqoz2el-n0QpSt_NMc,75
16
16
  pycoze/gpu/gpu_reserve.py,sha256=T-M1w8DiQQNtyNVok9Fj9qXGfTs5mxJp-gw-rxs50es,5410
17
17
  pycoze/ui/__init__.py,sha256=7xAfL2lfG7-jllPJEZUJO89xUE9sNzvo1y0WmBswjBI,458
18
- pycoze/ui/base.py,sha256=nXNXRTZ5Tl1AQp5nfjzLvOVzt_1nLSCn2IOyfxAN_fc,1471
18
+ pycoze/ui/base.py,sha256=tw5t_dm94ukEnS_fdQIkaCUQiNEt3EKrJ7jqVcaRwsQ,1467
19
19
  pycoze/ui/color.py,sha256=cT9Ib8uNzkOKxyW0IwVj46o4LwdB1xgNCj1_Rou9d_4,854
20
20
  pycoze/ui/typ.py,sha256=NpT0FrbHvByOszBZMFtroRp7I7pN-38tYz_zPOPejF4,1723
21
21
  pycoze/ui/ui_def.py,sha256=UhhU_yB3GV9ISbvTWT48hsHPHI250BhMILh6bu5Uioo,4206
22
22
  pycoze/utils/__init__.py,sha256=KExBkotf23dr2NfTEouWke5nJB1q2IuDXgHrmuyd95k,73
23
23
  pycoze/utils/arg.py,sha256=AhOobJNjifCf7dKKPZa7AsN7CcZg3OSECUp9TZIrDTI,748
24
24
  pycoze/utils/text_or_file.py,sha256=gpxZVWt2DW6YiEg_MnMuwg36VNf3TX383QD_1oZNB0Y,551
25
- pycoze-0.1.62.dist-info/LICENSE,sha256=QStd_Qsd0-kAam_-sOesCIp_uKrGWeoKwt9M49NVkNU,1090
26
- pycoze-0.1.62.dist-info/METADATA,sha256=dAe7QqqPLtozZulDRPv1bL_hPbZ3fjLyvDG7ywniPdU,719
27
- pycoze-0.1.62.dist-info/WHEEL,sha256=eOLhNAGa2EW3wWl_TU484h7q1UNgy0JXjjoqKoxAAQc,92
28
- pycoze-0.1.62.dist-info/top_level.txt,sha256=76dPeDhKvOCleL3ZC5gl1-y4vdS1tT_U1hxWVAn7sFo,7
29
- pycoze-0.1.62.dist-info/RECORD,,
25
+ pycoze-0.1.64.dist-info/LICENSE,sha256=QStd_Qsd0-kAam_-sOesCIp_uKrGWeoKwt9M49NVkNU,1090
26
+ pycoze-0.1.64.dist-info/METADATA,sha256=Oukw0jTWqbxVYhvpJ9oOREL75HUgYY2F5uMO5WBw-Dc,719
27
+ pycoze-0.1.64.dist-info/WHEEL,sha256=eOLhNAGa2EW3wWl_TU484h7q1UNgy0JXjjoqKoxAAQc,92
28
+ pycoze-0.1.64.dist-info/top_level.txt,sha256=76dPeDhKvOCleL3ZC5gl1-y4vdS1tT_U1hxWVAn7sFo,7
29
+ pycoze-0.1.64.dist-info/RECORD,,