]> git.jsancho.org Git - kivyforms.git/commitdiff
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 073587c0217f827fe3caddf9fb60717d43b1a7b1..0f4c18302cb6a97fd4170a960763da1c642ef77f 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