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

Sign up to get free protection for your applications and to get access to all the features.
pycoze/ui/ui_def.py CHANGED
@@ -3,6 +3,7 @@ from .typ import useDefaultType
3
3
  from typing import Union, List
4
4
  from .color import hex_to_rgb, rgb_to_hsl, ColorFormat
5
5
  import sys
6
+ import inspect
6
7
 
7
8
 
8
9
  def useDefault(name, default):
@@ -51,7 +52,20 @@ def password(name, default, tip="", hide_if="", style="", cls="") -> str:
51
52
 
52
53
 
53
54
  def tool(name, default, tools, tip="", hide_if="", style="", cls="") -> str:
54
- return eval(useDefault(name, default))
55
+ ret = useDefault(name, default)
56
+ if isinstance(ret, str):
57
+ # 获取调用栈
58
+ frame = inspect.currentframe()
59
+ try:
60
+ # 获取调用者的全局变量
61
+ caller_globals = frame.f_back.f_globals
62
+ finally:
63
+ del frame
64
+
65
+ ret = eval(ret, caller_globals)
66
+ return ret
67
+ else:
68
+ return ret
55
69
 
56
70
 
57
71
  def color(
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pycoze
3
- Version: 0.1.61
3
+ Version: 0.1.62
4
4
  Summary: Package for pycoze only!
5
5
  Author: Yuan Jie Xiong
6
6
  Author-email: aiqqqqqqq@qq.com
@@ -18,12 +18,12 @@ pycoze/ui/__init__.py,sha256=7xAfL2lfG7-jllPJEZUJO89xUE9sNzvo1y0WmBswjBI,458
18
18
  pycoze/ui/base.py,sha256=nXNXRTZ5Tl1AQp5nfjzLvOVzt_1nLSCn2IOyfxAN_fc,1471
19
19
  pycoze/ui/color.py,sha256=cT9Ib8uNzkOKxyW0IwVj46o4LwdB1xgNCj1_Rou9d_4,854
20
20
  pycoze/ui/typ.py,sha256=NpT0FrbHvByOszBZMFtroRp7I7pN-38tYz_zPOPejF4,1723
21
- pycoze/ui/ui_def.py,sha256=HIi_FuXDYPGh-DsbNLyRG8PHrId91ZgfKzkZtkYgH00,3866
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.61.dist-info/LICENSE,sha256=QStd_Qsd0-kAam_-sOesCIp_uKrGWeoKwt9M49NVkNU,1090
26
- pycoze-0.1.61.dist-info/METADATA,sha256=4CMwJ8g4i37G1HzAw6ayoRAWFIvj8w6sjoDx4VclvRw,719
27
- pycoze-0.1.61.dist-info/WHEEL,sha256=eOLhNAGa2EW3wWl_TU484h7q1UNgy0JXjjoqKoxAAQc,92
28
- pycoze-0.1.61.dist-info/top_level.txt,sha256=76dPeDhKvOCleL3ZC5gl1-y4vdS1tT_U1hxWVAn7sFo,7
29
- pycoze-0.1.61.dist-info/RECORD,,
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,,