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
|
||||
|
||||
def evaluate(txt):
|
||||
try:
|
||||
return __import__('ast').literal_eval(txt)
|
||||
except Exception as e:
|
||||
print("Error evaluating clipboard data:")
|
||||
print(e)
|
||||
|
||||
def reset_variables(*args):
|
||||
"""Resets the given variables to their default values."""
|
||||
|
@ -520,9 +520,10 @@ screen colorpickerscreen(item=None):
|
||||
text "Alpha:[cp.alpha]"
|
||||
|
||||
if item:
|
||||
textbutton "Colour code: [item.color]":
|
||||
action Function(set_clipboard, str(item.color))
|
||||
#alternate [Function(item.set_color, evaluate(get_clipboard()))]
|
||||
$ colorcode = [i.hexcode for i in item.color]
|
||||
textbutton "Colour code: [colorcode]":
|
||||
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"]
|
||||
#alternate_keysym ["ctrl_K_v"]
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user