forked from SilverStudioGames/WTS
Bug fixes
* Fixed traceback crash (doh!) caused by uncaught ast eval exception * Fixed dev colour code info screen
This commit is contained in:
parent
dcdd54cdfe
commit
5fdf1e87fe
@ -94,7 +94,11 @@ init -1 python:
|
|||||||
return None
|
return None
|
||||||
|
|
||||||
def evaluate(txt):
|
def evaluate(txt):
|
||||||
return __import__('ast').literal_eval(txt)
|
try:
|
||||||
|
return __import__('ast').literal_eval(txt)
|
||||||
|
except Exception as e:
|
||||||
|
print("Error evaluating clipboard data:")
|
||||||
|
print(e)
|
||||||
|
|
||||||
def reset_variables(*args):
|
def reset_variables(*args):
|
||||||
"""Resets the given variables to their default values."""
|
"""Resets the given variables to their default values."""
|
||||||
|
@ -520,9 +520,10 @@ screen colorpickerscreen(item=None):
|
|||||||
text "Alpha:[cp.alpha]"
|
text "Alpha:[cp.alpha]"
|
||||||
|
|
||||||
if item:
|
if item:
|
||||||
textbutton "Colour code: [item.color]":
|
$ colorcode = [i.hexcode for i in item.color]
|
||||||
action Function(set_clipboard, str(item.color))
|
textbutton "Colour code: [colorcode]":
|
||||||
#alternate [Function(item.set_color, evaluate(get_clipboard()))]
|
action [Function(set_clipboard, json.dumps(colorcode)), Notify("Colorcode copied to clipboard.")]
|
||||||
|
#alternate [Function(item.set_color, evaluate(str(get_clipboard())))]
|
||||||
keysym ["ctrl_K_c"]
|
keysym ["ctrl_K_c"]
|
||||||
#alternate_keysym ["ctrl_K_v"]
|
#alternate_keysym ["ctrl_K_v"]
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user