From 4a4f9d061b40f5c2527943af31639525d19e7798 Mon Sep 17 00:00:00 2001 From: Javier Sancho Date: Wed, 25 Jul 2018 20:07:45 +0200 Subject: [PATCH] Right strings in exported Kv --- kivyforms/formcanvas.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/kivyforms/formcanvas.py b/kivyforms/formcanvas.py index 073587c..0f4c183 100644 --- a/kivyforms/formcanvas.py +++ b/kivyforms/formcanvas.py @@ -231,10 +231,13 @@ class FormCanvas(BoxLayout): # Widget attributes for attr in ('height', 'size_hint', 'text'): if hasattr(widget, attr): + value = getattr(widget, attr) + if type(value) is str: + value = "'" + value + "'" kv += "{indent}{attr}: {value}\n".format( indent=indent*len(stack), attr=attr, - value=getattr(widget, attr) + value=value ) return kv -- 2.39.5