Right strings in exported Kv
authorJavier Sancho <jsf@jsancho.org>
Wed, 25 Jul 2018 18:07:45 +0000 (20:07 +0200)
committerJavier Sancho <jsf@jsancho.org>
Wed, 25 Jul 2018 18:07:45 +0000 (20:07 +0200)
kivyforms/formcanvas.py

index 073587c..0f4c183 100644 (file)
@@ -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